36#if BITS_IN_JSAMPLE != 8
37 Sorry,
this code only copes with 8-bit JSAMPLEs.
53 { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind;
63typedef struct _rle_source_struct * rle_source_ptr;
65typedef struct _rle_source_struct {
93 switch (rle_get_setup(&(
source->header))) {
102 ERREXIT(cinfo, JERR_RLE_EMPTY);
106 ERREXIT(cinfo, JERR_RLE_BADERROR);
120 if (
source->header.ncolors == 1 &&
source->header.ncmap == 0) {
121 source->visual = GRAYSCALE;
123 }
else if (
source->header.ncolors == 1 &&
source->header.ncmap == 1) {
124 source->visual = MAPPEDGRAY;
126 1 <<
source->header.cmaplen);
127 }
else if (
source->header.ncolors == 1 &&
source->header.ncmap == 3) {
128 source->visual = PSEUDOCOLOR;
130 1 <<
source->header.cmaplen);
131 }
else if (
source->header.ncolors == 3 &&
source->header.ncmap == 3) {
132 source->visual = TRUECOLOR;
134 1 <<
source->header.cmaplen);
135 }
else if (
source->header.ncolors == 3 &&
source->header.ncmap == 0) {
136 source->visual = DIRECTCOLOR;
139 ERREXIT(cinfo, JERR_RLE_UNSUPPORTED);
141 if (
source->visual == GRAYSCALE ||
source->visual == MAPPEDGRAY) {
153 if (
source->visual != GRAYSCALE) {
154 source->rle_row = (rle_pixel **) (*cinfo->mem->alloc_sarray)
160 source->image = (*cinfo->mem->request_virt_sarray)
164#ifdef PROGRESS_REPORT
171 source->pub.buffer_height = 1;
187 source->pub.buffer = (*cinfo->mem->access_virt_sarray)
208 colormap =
source->header.cmap;
211 src_row = * (*cinfo->mem->access_virt_sarray)
240 JSAMPROW scanline, red_ptr, green_ptr, blue_ptr;
244#ifdef PROGRESS_REPORT
252 RLE_CLR_BIT(
source->header, RLE_ALPHA);
254#ifdef PROGRESS_REPORT
267 rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
269 rle_getrow(&
source->header, rle_row);
270#ifdef PROGRESS_REPORT
281 rle_row =
source->rle_row;
282 colormap =
source->header.cmap;
284 rle_getrow(&
source->header, rle_row);
285 scanline = * (*cinfo->mem->access_virt_sarray)
289 for (channel = 0; channel <
source->header.ncolors; channel++) {
291 (colormap[
GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8);
295#ifdef PROGRESS_REPORT
305 rle_row =
source->rle_row;
307 rle_getrow(&
source->header, rle_row);
308 scanline = * (*cinfo->mem->access_virt_sarray)
311 red_ptr = rle_row[0];
312 green_ptr = rle_row[1];
313 blue_ptr = rle_row[2];
316 *scanline++ = *red_ptr++;
317 *scanline++ = *green_ptr++;
318 *scanline++ = *blue_ptr++;
321#ifdef PROGRESS_REPORT
330#ifdef PROGRESS_REPORT
336 if (
source->visual == PSEUDOCOLOR) {
338 source->pub.get_pixel_rows = get_pseudocolor_row;
340 source->pub.get_pixel_rows = get_rle_row;
345 return (*
source->pub.get_pixel_rows) (cinfo,
sinfo);
370 source = (rle_source_ptr) (*cinfo->mem->alloc_small)
373 source->pub.start_input = start_input_rle;
374 source->pub.finish_input = finish_input_rle;
struct cdjpeg_progress_mgr * cd_progress_ptr
static HANDLE load_image(MSIDATABASE *db, const WCHAR *name, UINT type, UINT cx, UINT cy, UINT flags)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
#define TRACEMS2(cinfo, lvl, code, p1, p2)
#define TRACEMS3(cinfo, lvl, code, p1, p2, p3)
#define GETJSAMPLE(value)
int JSAMPARRAY int dest_row
struct jpeg_common_struct * j_common_ptr
struct jpeg_progress_mgr pub
int completed_extra_passes
J_COLOR_SPACE in_color_space