ReactOS 0.4.15-dev-8433-ge87f1d5
blend.h File Reference
#include "types.h"
Include dependency graph for blend.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gl_blend_span (GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte red[], GLubyte green[], GLubyte blue[], GLubyte alpha[], GLubyte mask[])
 
void gl_blend_pixels (GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte red[], GLubyte green[], GLubyte blue[], GLubyte alpha[], GLubyte mask[])
 
void gl_BlendFunc (GLcontext *ctx, GLenum sfactor, GLenum dfactor)
 

Function Documentation

◆ gl_blend_pixels()

void gl_blend_pixels ( GLcontext ctx,
GLuint  n,
const GLint  x[],
const GLint  y[],
GLubyte  red[],
GLubyte  green[],
GLubyte  blue[],
GLubyte  alpha[],
GLubyte  mask[] 
)

Definition at line 532 of file blend.c.

537{
538 GLubyte rdest[PB_SIZE], gdest[PB_SIZE], bdest[PB_SIZE], adest[PB_SIZE];
539
540 /* Read pixels from current color buffer */
541 (*ctx->Driver.ReadColorPixels)( ctx, n, x, y, rdest, gdest, bdest, adest, mask );
542 if (ctx->RasterMask & ALPHABUF_BIT) {
543 gl_read_alpha_pixels( ctx, n, x, y, adest, mask );
544 }
545
546 do_blend( ctx, n, mask, red, green, blue, alpha, rdest, gdest, bdest, adest );
547}
void gl_read_alpha_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte alpha[], const GLubyte mask[])
Definition: alphabuf.c:257
static void do_blend(GLcontext *ctx, GLuint n, const GLubyte mask[], GLubyte red[], GLubyte green[], GLubyte blue[], GLubyte alpha[], const GLubyte rdest[], const GLubyte gdest[], const GLubyte bdest[], const GLubyte adest[])
Definition: blend.c:127
#define ALPHABUF_BIT
Definition: types.h:1223
unsigned char GLubyte
Definition: gl.h:157
GLclampf green
Definition: gl.h:1740
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLclampf GLclampf blue
Definition: gl.h:1740
GLdouble n
Definition: glext.h:7729
GLenum GLint GLuint mask
Definition: glext.h:6028
#define red
Definition: linetest.c:67
#define PB_SIZE
Definition: pb.h:52

Referenced by gl_flush_pb().

◆ gl_blend_span()

void gl_blend_span ( GLcontext ctx,
GLuint  n,
GLint  x,
GLint  y,
GLubyte  red[],
GLubyte  green[],
GLubyte  blue[],
GLubyte  alpha[],
GLubyte  mask[] 
)

Definition at line 507 of file blend.c.

511{
512 GLubyte rdest[MAX_WIDTH], gdest[MAX_WIDTH];
513 GLubyte bdest[MAX_WIDTH], adest[MAX_WIDTH];
514
515 /* Read span of current frame buffer pixels */
516 gl_read_color_span( ctx, n, x, y, rdest, gdest, bdest, adest );
517
518 do_blend( ctx, n, mask, red, green, blue, alpha, rdest, gdest, bdest, adest );
519}
#define MAX_WIDTH
Definition: config.h:130
void gl_read_color_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte red[], GLubyte green[], GLubyte blue[], GLubyte alpha[])
Definition: span.c:850

Referenced by gl_write_color_span(), gl_write_monocolor_span(), and gl_write_texture_span().

◆ gl_BlendFunc()

void gl_BlendFunc ( GLcontext ctx,
GLenum  sfactor,
GLenum  dfactor 
)

Definition at line 76 of file blend.c.

77{
78 if (INSIDE_BEGIN_END(ctx)) {
79 gl_error( ctx, GL_INVALID_OPERATION, "glBlendFunc" );
80 return;
81 }
82
83 switch (sfactor) {
84 case GL_ZERO:
85 case GL_ONE:
86 case GL_DST_COLOR:
88 case GL_SRC_ALPHA:
90 case GL_DST_ALPHA:
93 ctx->Color.BlendSrc = sfactor;
94 break;
95 default:
96 gl_error( ctx, GL_INVALID_ENUM, "glBlendFunc(sfactor)" );
97 return;
98 }
99
100 switch (dfactor) {
101 case GL_ZERO:
102 case GL_ONE:
103 case GL_SRC_COLOR:
105 case GL_SRC_ALPHA:
107 case GL_DST_ALPHA:
109 ctx->Color.BlendDst = dfactor;
110 break;
111 default:
112 gl_error( ctx, GL_INVALID_ENUM, "glBlendFunc(dfactor)" );
113 }
114
115 ctx->NewState |= NEW_RASTER_OPS;
116}
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
#define NEW_RASTER_OPS
Definition: types.h:1233
#define GL_SRC_ALPHA_SATURATE
Definition: gl.h:384
#define GL_ONE_MINUS_DST_ALPHA
Definition: gl.h:381
#define GL_ONE_MINUS_DST_COLOR
Definition: gl.h:383
#define GL_SRC_ALPHA
Definition: gl.h:378
#define GL_INVALID_OPERATION
Definition: gl.h:696
#define GL_SRC_COLOR
Definition: gl.h:376
#define GL_ZERO
Definition: gl.h:374
#define GL_ONE_MINUS_SRC_ALPHA
Definition: gl.h:379
#define GL_ONE
Definition: gl.h:375
#define GL_DST_ALPHA
Definition: gl.h:380
#define GL_DST_COLOR
Definition: gl.h:382
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_ONE_MINUS_SRC_COLOR
Definition: gl.h:377
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum dfactor
Definition: glfuncs.h:252
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum sfactor
Definition: glfuncs.h:252
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135

Referenced by execute_list(), and init_exec_pointers().