ReactOS  0.4.13-dev-482-ge57f103
masking.h File Reference
#include "types.h"
Include dependency graph for masking.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gl_IndexMask (GLcontext *ctx, GLuint mask)
 
void gl_ColorMask (GLcontext *ctx, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
 
void gl_mask_color_span (GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte red[], GLubyte green[], GLubyte blue[], GLubyte alpha[])
 
void gl_mask_color_pixels (GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte red[], GLubyte green[], GLubyte blue[], GLubyte alpha[], const GLubyte mask[])
 
void gl_mask_index_span (GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[])
 
void gl_mask_index_pixels (GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint index[], const GLubyte mask[])
 

Function Documentation

◆ gl_ColorMask()

void gl_ColorMask ( GLcontext ctx,
GLboolean  red,
GLboolean  green,
GLboolean  blue,
GLboolean  alpha 
)

Definition at line 76 of file masking.c.

78 {
79  if (INSIDE_BEGIN_END(ctx)) {
80  gl_error( ctx, GL_INVALID_OPERATION, "glColorMask" );
81  return;
82  }
83  ctx->Color.ColorMask = (red << 3) | (green << 2) | (blue << 1) | alpha;
84  ctx->NewState |= NEW_RASTER_OPS;
85 }
GLuint NewState
Definition: types.h:1355
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
struct gl_colorbuffer_attrib Color
Definition: types.h:1319
GLclampf GLclampf blue
Definition: gl.h:1740
GLclampf green
Definition: gl.h:1740
#define red
Definition: linetest.c:67
#define GL_INVALID_OPERATION
Definition: gl.h:696
#define NEW_RASTER_OPS
Definition: types.h:1233
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740

Referenced by execute_list(), and init_exec_pointers().

◆ gl_IndexMask()

void gl_IndexMask ( GLcontext ctx,
GLuint  mask 
)

Definition at line 64 of file masking.c.

65 {
66  if (INSIDE_BEGIN_END(ctx)) {
67  gl_error( ctx, GL_INVALID_OPERATION, "glIndexMask" );
68  return;
69  }
70  ctx->Color.IndexMask = mask;
71  ctx->NewState |= NEW_RASTER_OPS;
72 }
GLuint NewState
Definition: types.h:1355
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
GLenum GLint GLuint mask
Definition: glext.h:6028
struct gl_colorbuffer_attrib Color
Definition: types.h:1319
#define GL_INVALID_OPERATION
Definition: gl.h:696
#define NEW_RASTER_OPS
Definition: types.h:1233
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421

Referenced by execute_list(), and init_exec_pointers().

◆ gl_mask_color_pixels()

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

Definition at line 125 of file masking.c.

130 {
132 
133  (*ctx->Driver.ReadColorPixels)( ctx, n, x, y, r, g, b, a, mask );
134  if (ctx->RasterMask & ALPHABUF_BIT) {
135  gl_read_alpha_pixels( ctx, n, x, y, a, mask );
136  }
137 
138  if ((ctx->Color.ColorMask & 8) == 0) {
139  /* replace source reds with frame buffer reds */
140  MEMCPY( red, r, n );
141  }
142  if ((ctx->Color.ColorMask & 4) == 0) {
143  /* replace source greens with frame buffer greens */
144  MEMCPY( green, g, n );
145  }
146  if ((ctx->Color.ColorMask & 2) == 0) {
147  /* replace source blues with frame buffer blues */
148  MEMCPY( blue, b, n );
149  }
150  if ((ctx->Color.ColorMask & 1) == 0) {
151  /* replace source alphas with frame buffer alphas */
152  MEMCPY( alpha, a, n );
153  }
154 }
unsigned char GLubyte
Definition: gl.h:157
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint RasterMask
Definition: types.h:1361
struct dd_function_table Driver
Definition: types.h:1276
GLenum GLint GLuint mask
Definition: glext.h:6028
struct gl_colorbuffer_attrib Color
Definition: types.h:1319
GLclampf GLclampf blue
Definition: gl.h:1740
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define ALPHABUF_BIT
Definition: types.h:1223
void gl_read_alpha_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte alpha[], const GLubyte mask[])
Definition: alphabuf.c:257
#define MEMCPY(DST, SRC, BYTES)
Definition: macros.h:231
GLclampf green
Definition: gl.h:1740
#define red
Definition: linetest.c:67
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define PB_SIZE
Definition: pb.h:52

Referenced by gl_flush_pb().

◆ gl_mask_color_span()

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

Definition at line 93 of file masking.c.

97 {
99 
100  gl_read_color_span( ctx, n, x, y, r, g, b, a );
101 
102  if ((ctx->Color.ColorMask & 8) == 0) {
103  /* replace source reds with frame buffer reds */
104  MEMCPY( red, r, n );
105  }
106  if ((ctx->Color.ColorMask & 4) == 0) {
107  /* replace source greens with frame buffer greens */
108  MEMCPY( green, g, n );
109  }
110  if ((ctx->Color.ColorMask & 2) == 0) {
111  /* replace source blues with frame buffer blues */
112  MEMCPY( blue, b, n );
113  }
114  if ((ctx->Color.ColorMask & 1) == 0) {
115  /* replace source alphas with frame buffer alphas */
116  MEMCPY( alpha, a, n );
117  }
118 }
unsigned char GLubyte
Definition: gl.h:157
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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
struct gl_colorbuffer_attrib Color
Definition: types.h:1319
GLclampf GLclampf blue
Definition: gl.h:1740
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define MAX_WIDTH
Definition: config.h:130
#define MEMCPY(DST, SRC, BYTES)
Definition: macros.h:231
GLclampf green
Definition: gl.h:1740
#define red
Definition: linetest.c:67
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

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

◆ gl_mask_index_pixels()

void gl_mask_index_pixels ( GLcontext ctx,
GLuint  n,
const GLint  x[],
const GLint  y[],
GLuint  index[],
const GLubyte  mask[] 
)

Definition at line 183 of file masking.c.

186 {
187  GLuint i;
188  GLuint fbindexes[PB_SIZE];
189  GLuint msrc, mdest;
190 
191  (*ctx->Driver.ReadIndexPixels)( ctx, n, x, y, fbindexes, mask );
192 
193  msrc = ctx->Color.IndexMask;
194  mdest = ~msrc;
195 
196  for (i=0;i<n;i++) {
197  index[i] = (index[i] & msrc) | (fbindexes[i] & mdest);
198  }
199 }
GLdouble n
Definition: glext.h:7729
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct dd_function_table Driver
Definition: types.h:1276
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 i
Definition: glfuncs.h:248
GLenum GLint GLuint mask
Definition: glext.h:6028
GLuint index
Definition: glext.h:6031
struct gl_colorbuffer_attrib Color
Definition: types.h:1319
unsigned int GLuint
Definition: gl.h:159
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define PB_SIZE
Definition: pb.h:52

Referenced by gl_flush_pb().

◆ gl_mask_index_span()

void gl_mask_index_span ( GLcontext ctx,
GLuint  n,
GLint  x,
GLint  y,
GLuint  index[] 
)

Definition at line 161 of file masking.c.

163 {
164  GLuint i;
165  GLuint fbindexes[MAX_WIDTH];
166  GLuint msrc, mdest;
167 
168  gl_read_index_span( ctx, n, x, y, fbindexes );
169 
170  msrc = ctx->Color.IndexMask;
171  mdest = ~msrc;
172 
173  for (i=0;i<n;i++) {
174  index[i] = (index[i] & msrc) | (fbindexes[i] & mdest);
175  }
176 }
GLdouble n
Definition: glext.h:7729
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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 i
Definition: glfuncs.h:248
void gl_read_index_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint indx[])
Definition: span.c:897
GLuint index
Definition: glext.h:6031
struct gl_colorbuffer_attrib Color
Definition: types.h:1319
#define MAX_WIDTH
Definition: config.h:130
unsigned int GLuint
Definition: gl.h:159
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by clear_color_buffer_with_masking(), gl_write_index_span(), and gl_write_monoindex_span().