#include "swrast.h"
Data Structures | |
struct | sw_span_arrays |
More... | |
struct | sw_span |
The SWspan structure describes the colors, Z, fogcoord, texcoords, etc for either a horizontal run or an array of independent pixels. More... | |
Defines | |
#define | SPAN_RGBA 0x01 |
interpMask and arrayMask | |
#define | SPAN_INDEX 0x02 |
interpMask and arrayMask | |
#define | SPAN_Z 0x04 |
interpMask and arrayMask | |
#define | SPAN_FLAT 0x08 |
interpMask: flat shading? | |
#define | SPAN_XY 0x10 |
array.x[], y[] valid? | |
#define | SPAN_MASK 0x20 |
was array.mask[] filled in by caller? | |
#define | SPAN_LAMBDA 0x40 |
array.lambda[] valid? | |
#define | SPAN_COVERAGE 0x80 |
array.coverage[] valid? | |
#define | INIT_SPAN(S, PRIMITIVE) |
Typedefs | |
typedef struct sw_span_arrays | SWspanarrays |
typedef struct sw_span | SWspan |
Functions | |
void | _swrast_span_default_attribs (GLcontext *ctx, SWspan *span) |
Set default fragment attributes for the span using the current raster values. | |
void | _swrast_span_interpolate_z (const GLcontext *ctx, SWspan *span) |
Fill in the span.zArray array from the span->z, zStep values. | |
GLfloat | _swrast_compute_lambda (GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, GLfloat s, GLfloat t, GLfloat q, GLfloat invQ) |
Compute mipmap LOD from partial derivatives. | |
void | _swrast_write_index_span (GLcontext *ctx, SWspan *span) |
Apply all the per-fragment opertions to a span of color index fragments and write them to the enabled color drawbuffers. | |
void | _swrast_write_rgba_span (GLcontext *ctx, SWspan *span) |
Apply all the per-fragment operations to a span. | |
void | _swrast_read_rgba_span (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba) |
Read RGBA pixels from a renderbuffer. | |
void | _swrast_read_index_span (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLuint indx[]) |
Read CI pixels from a renderbuffer. | |
void | _swrast_get_values (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], void *values, GLuint valueSize) |
Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid reading values outside the buffer bounds. | |
void | _swrast_put_row (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLint x, GLint y, const GLvoid *values, GLuint valueSize) |
Wrapper for gl_renderbuffer::PutRow() which does clipping. | |
void | _swrast_get_row (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLint x, GLint y, GLvoid *values, GLuint valueSize) |
Wrapper for gl_renderbuffer::GetRow() which does clipping. | |
void * | _swrast_get_dest_rgba (GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span) |
Get RGBA pixels from the given renderbuffer. |
#define INIT_SPAN | ( | S, | |||
PRIMITIVE | ) |
Value:
do { \ (S).primitive = (PRIMITIVE); \ (S).interpMask = 0x0; \ (S).arrayMask = 0x0; \ (S).arrayAttribs = 0x0; \ (S).end = 0; \ (S).leftClip = 0; \ (S).facing = 0; \ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ } while (0)
typedef struct sw_span_arrays SWspanarrays |
GLfloat _swrast_compute_lambda | ( | GLfloat | dsdx, | |
GLfloat | dsdy, | |||
GLfloat | dtdx, | |||
GLfloat | dtdy, | |||
GLfloat | dqdx, | |||
GLfloat | dqdy, | |||
GLfloat | texW, | |||
GLfloat | texH, | |||
GLfloat | s, | |||
GLfloat | t, | |||
GLfloat | q, | |||
GLfloat | invQ | |||
) |
Compute mipmap LOD from partial derivatives.
This the ideal solution, as given in the OpenGL spec.
void* _swrast_get_dest_rgba | ( | GLcontext * | ctx, | |
struct gl_renderbuffer * | rb, | |||
SWspan * | span | |||
) |
Get RGBA pixels from the given renderbuffer.
Put the pixel colors into the span's specular color arrays. The specular color arrays should no longer be needed by time this function is called. Used by blending, logicop and masking functions.
void _swrast_get_row | ( | GLcontext * | ctx, | |
struct gl_renderbuffer * | rb, | |||
GLuint | count, | |||
GLint | x, | |||
GLint | y, | |||
GLvoid * | values, | |||
GLuint | valueSize | |||
) |
Wrapper for gl_renderbuffer::GetRow() which does clipping.
valueSize | size of each value (pixel) in bytes |
void _swrast_get_values | ( | GLcontext * | ctx, | |
struct gl_renderbuffer * | rb, | |||
GLuint | count, | |||
const GLint | x[], | |||
const GLint | y[], | |||
void * | values, | |||
GLuint | valueSize | |||
) |
Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid reading values outside the buffer bounds.
We can use this for reading any format/type of renderbuffer.
valueSize | is the size in bytes of each value (pixel) put into the values array. |
void _swrast_put_row | ( | GLcontext * | ctx, | |
struct gl_renderbuffer * | rb, | |||
GLuint | count, | |||
GLint | x, | |||
GLint | y, | |||
const GLvoid * | values, | |||
GLuint | valueSize | |||
) |
Wrapper for gl_renderbuffer::PutRow() which does clipping.
valueSize | size of each value (pixel) in bytes |
void _swrast_read_index_span | ( | GLcontext * | ctx, | |
struct gl_renderbuffer * | rb, | |||
GLuint | n, | |||
GLint | x, | |||
GLint | y, | |||
GLuint | index[] | |||
) |
Read CI pixels from a renderbuffer.
Clipping will be done to prevent reading ouside the buffer's boundaries.
void _swrast_read_rgba_span | ( | GLcontext * | ctx, | |
struct gl_renderbuffer * | rb, | |||
GLuint | n, | |||
GLint | x, | |||
GLint | y, | |||
GLenum | dstType, | |||
GLvoid * | rgba | |||
) |
Read RGBA pixels from a renderbuffer.
Clipping will be done to prevent reading ouside the buffer's boundaries.
dstType | datatype for returned colors | |
rgba | the returned colors |
Set default fragment attributes for the span using the current raster values.
Used prior to glDraw/CopyPixels and glBitmap.
Fill in the span.zArray array from the span->z, zStep values.
Apply all the per-fragment opertions to a span of color index fragments and write them to the enabled color drawbuffers.
The 'span' parameter can be considered to be const. Note that span->interpMask and span->arrayMask may be changed but will be restored to their original values before returning.
Apply all the per-fragment operations to a span.
This now includes texturing (_swrast_write_texture_span() is history). This function may modify any of the array values in the span. span->interpMask and span->arrayMask may be changed but will be restored to their original values before returning.