📄 glview.cpp
字号:
}void MesaDriver::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] ){ printf("WriteCI32SpanFront() not implemented yet!\n"); // TODO}void MesaDriver::WriteCI8SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] ){ printf("WriteCI8SpanFront() not implemented yet!\n"); // TODO}void MesaDriver::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ){ printf("WriteMonoCISpanFront() not implemented yet!\n"); // TODO}void MesaDriver::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] ){ printf("WriteCI32PixelsFront() not implemented yet!\n"); // TODO}void MesaDriver::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ){ printf("WriteMonoCIPixelsFront() not implemented yet!\n"); // TODO}void MesaDriver::ReadCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[] ){ printf("ReadCI32SpanFront() not implemented yet!\n"); // TODO}void MesaDriver::ReadRGBASpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ){ printf("ReadRGBASpanFront() not implemented yet!\n"); // TODO}void MesaDriver::ReadCI32PixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint indx[], const GLubyte mask[] ){ printf("ReadCI32PixelsFront() not implemented yet!\n"); // TODO}void MesaDriver::ReadRGBAPixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ){ printf("ReadRGBAPixelsFront() not implemented yet!\n"); // TODO}void MesaDriver::WriteRGBASpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, CONST GLubyte rgba[][4], const GLubyte mask[]){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; BBitmap *bitmap = md->m_bitmap; assert(bitmap); int row = md->m_bottom - y; uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; uint32 * pixel = (uint32 *) ptr; if (mask) { while(n--) { if (*mask++) *pixel = PACK_B_RGBA32(rgba[0]); pixel++; rgba++; }; } else { while(n--) { *pixel++ = PACK_B_RGBA32(rgba[0]); rgba++; }; }; }void MesaDriver::WriteRGBSpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, CONST GLubyte rgb[][3], const GLubyte mask[]){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; BBitmap *bitmap = md->m_bitmap; assert(bitmap); int row = md->m_bottom - y; uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; uint32 * pixel = (uint32 *) ptr; if (mask) { while(n--) { if (*mask++) *pixel = PACK_B_RGB32(rgb[0]); pixel++; rgb++; }; } else { while(n--) { *pixel++ = PACK_B_RGB32(rgb[0]); rgb++; }; };}void MesaDriver::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; BBitmap *bitmap = md->m_bitmap; assert(bitmap); int row = md->m_bottom - y; uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; uint32 * pixel = (uint32 *) ptr; uint32 pixel_color = PACK_B_RGBA32(color); if (mask) { while(n--) { if (*mask++) *pixel = pixel_color; pixel++; }; } else { while(n--) { *pixel++ = pixel_color; }; };}void MesaDriver::WriteRGBAPixelsBack(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], CONST GLubyte rgba[][4], const GLubyte mask[] ){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; BBitmap *bitmap = md->m_bitmap; assert(bitmap);#if 0 while(n--) { if (*mask++) { int row = md->m_bottom - *y; uint8 * pixel = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + *x * 4; *((uint32 *) pixel) = PACK_B_RGBA32(rgba[0]); }; x++; y++; rgba++; };#else if (mask) { for (GLuint i = 0; i < n; i++) { if (mask[i]) { GLubyte *pixel = (GLubyte *) bitmap->Bits() + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; pixel[BE_RCOMP] = rgba[i][RCOMP]; pixel[BE_GCOMP] = rgba[i][GCOMP]; pixel[BE_BCOMP] = rgba[i][BCOMP]; pixel[BE_ACOMP] = rgba[i][ACOMP]; } } } else { for (GLuint i = 0; i < n; i++) { GLubyte *pixel = (GLubyte *) bitmap->Bits() + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; pixel[BE_RCOMP] = rgba[i][RCOMP]; pixel[BE_GCOMP] = rgba[i][GCOMP]; pixel[BE_BCOMP] = rgba[i][BCOMP]; pixel[BE_ACOMP] = rgba[i][ACOMP]; } }#endif}void MesaDriver::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; BBitmap *bitmap = md->m_bitmap; assert(bitmap); uint32 pixel_color = PACK_B_RGBA32(color);#if 0 while(n--) { if (*mask++) { int row = md->m_bottom - *y; uint8 * pixel = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + *x * 4; *((uint32 *) pixel) = pixel_color; }; x++; y++; };#else if (mask) { for (GLuint i = 0; i < n; i++) { if (mask[i]) { GLubyte * ptr = (GLubyte *) bitmap->Bits() + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; *((uint32 *) ptr) = pixel_color; } } } else { for (GLuint i = 0; i < n; i++) { GLubyte * ptr = (GLubyte *) bitmap->Bits() + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; *((uint32 *) ptr) = pixel_color; } }#endif}void MesaDriver::WriteCI32SpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] ){ printf("WriteCI32SpanBack() not implemented yet!\n"); // TODO}void MesaDriver::WriteCI8SpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] ){ printf("WriteCI8SpanBack() not implemented yet!\n"); // TODO}void MesaDriver::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ){ printf("WriteMonoCISpanBack() not implemented yet!\n"); // TODO}void MesaDriver::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] ){ printf("WriteCI32PixelsBack() not implemented yet!\n"); // TODO}void MesaDriver::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ){ printf("WriteMonoCIPixelsBack() not implemented yet!\n"); // TODO}void MesaDriver::ReadCI32SpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[] ){ printf("ReadCI32SpanBack() not implemented yet!\n"); // TODO}void MesaDriver::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; const BBitmap *bitmap = md->m_bitmap; assert(bitmap); int row = md->m_bottom - y; const GLubyte *pixel = (GLubyte *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; for (GLuint i = 0; i < n; i++) { rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP]; rgba[i][BCOMP] = pixel[BE_BCOMP]; rgba[i][ACOMP] = pixel[BE_ACOMP]; pixel += 4; }}void MesaDriver::ReadCI32PixelsBack( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint indx[], const GLubyte mask[] ){ printf("ReadCI32PixelsBack() not implemented yet!\n"); // TODO}void MesaDriver::ReadRGBAPixelsBack( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ){ MesaDriver *md = (MesaDriver *) ctx->DriverCtx; const BBitmap *bitmap = md->m_bitmap; assert(bitmap); if (mask) { for (GLuint i = 0; i < n; i++) { if (mask[i]) { GLubyte *pixel = (GLubyte *) bitmap->Bits() + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP]; rgba[i][BCOMP] = pixel[BE_BCOMP]; rgba[i][ACOMP] = pixel[BE_ACOMP]; }; }; } else { for (GLuint i = 0; i < n; i++) { GLubyte *pixel = (GLubyte *) bitmap->Bits() + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP]; rgba[i][BCOMP] = pixel[BE_BCOMP]; rgba[i][ACOMP] = pixel[BE_ACOMP]; }; };}const char * color_space_name(color_space space){#define C2N(a) case a: return #a switch (space) { C2N(B_RGB24); C2N(B_RGB32); C2N(B_RGBA32); C2N(B_RGB32_BIG); C2N(B_RGBA32_BIG); C2N(B_GRAY8); C2N(B_GRAY1); C2N(B_RGB16); C2N(B_RGB15); C2N(B_RGBA15); C2N(B_CMAP8); default: return "Unknown!"; };#undef C2N};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -