28#ifdef HAVE_UNSIGNED_CHAR
29typedef unsigned char U_CHAR;
30#define UCH(x) ((int) (x))
33#ifdef CHAR_IS_UNSIGNED
34#define UCH(x) ((int) (x))
36#define UCH(x) ((int) (x) & 0xFF)
41#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))
46typedef struct _tga_source_struct * tga_source_ptr;
48typedef struct _tga_source_struct {
79static const UINT8 c5to8bits[32] = {
80 0, 8, 16, 25, 33, 41, 49, 58,
81 66, 74, 82, 90, 99, 107, 115, 123,
82 132, 140, 148, 156, 165, 173, 181, 189,
83 197, 206, 214, 222, 230, 239, 247, 255
102read_colormap (tga_source_ptr
sinfo,
int cmaplen,
int mapentrysize)
108 if (mapentrysize != 24)
111 for (
i = 0;
i < cmaplen;
i++) {
124read_non_rle_pixel (tga_source_ptr
sinfo)
129 for (
i = 0;
i <
sinfo->pixel_size;
i++) {
135read_rle_pixel (tga_source_ptr
sinfo)
141 if (
sinfo->dup_pixel_count > 0) {
142 sinfo->dup_pixel_count--;
147 if (--
sinfo->block_count < 0) {
150 sinfo->dup_pixel_count =
i & 0x7F;
151 sinfo->block_count = 0;
153 sinfo->block_count =
i & 0x7F;
158 for (
i = 0;
i <
sinfo->pixel_size;
i++) {
198 colormap =
source->colormap;
199 cmaplen =
source->cmap_length;
204 ERREXIT(cinfo, JERR_TGA_BADPARMS);
205 *
ptr++ = colormap[0][
t];
206 *
ptr++ = colormap[1][
t];
207 *
ptr++ = colormap[2][
t];
225 t += UCH(
source->tga_pixel[1]) << 8;
265#define get_32bit_row get_24bit_row
314 source->pub.buffer = (*cinfo->mem->access_virt_sarray)
322 source->pub.get_pixel_rows = get_memory_row;
325 return get_memory_row(cinfo,
sinfo);
337 U_CHAR targaheader[18];
340 boolean is_bottom_up;
342#define GET_2B(offset) ((unsigned int) UCH(targaheader[offset]) + \
343 (((unsigned int) UCH(targaheader[offset+1])) << 8))
346 ERREXIT(cinfo, JERR_INPUT_EOF);
349 if (targaheader[16] == 15)
350 targaheader[16] = 16;
352 idlen = UCH(targaheader[0]);
353 cmaptype = UCH(targaheader[1]);
354 subtype = UCH(targaheader[2]);
358 source->pixel_size = UCH(targaheader[16]) >> 3;
359 flags = UCH(targaheader[17]);
361 is_bottom_up = ((
flags & 0x20) == 0);
362 interlace_type =
flags >> 6;
367 (UCH(targaheader[16]) & 7) != 0 ||
369 ERREXIT(cinfo, JERR_TGA_BADPARMS);
373 source->read_pixel = read_rle_pixel;
378 source->read_pixel = read_non_rle_pixel;
387 if (
source->pixel_size == 1 && cmaptype == 1)
388 source->get_pixel_rows = get_8bit_row;
390 ERREXIT(cinfo, JERR_TGA_BADPARMS);
394 switch (
source->pixel_size) {
396 source->get_pixel_rows = get_16bit_row;
399 source->get_pixel_rows = get_24bit_row;
402 source->get_pixel_rows = get_32bit_row;
405 ERREXIT(cinfo, JERR_TGA_BADPARMS);
412 if (
source->pixel_size == 1)
413 source->get_pixel_rows = get_8bit_gray_row;
415 ERREXIT(cinfo, JERR_TGA_BADPARMS);
419 ERREXIT(cinfo, JERR_TGA_BADPARMS);
424 source->whole_image = (*cinfo->mem->request_virt_sarray)
427 if (cinfo->progress !=
NULL) {
432 source->pub.buffer_height = 1;
433 source->pub.get_pixel_rows = preload_image;
439 source->pub.buffer_height = 1;
447 if (maplen > 256 || GET_2B(3) != 0)
448 ERREXIT(cinfo, JERR_TGA_BADCMAP);
454 read_colormap(
source, (
int) maplen, UCH(targaheader[7]));
457 ERREXIT(cinfo, JERR_TGA_BADPARMS);
490 source = (tga_source_ptr) (*cinfo->mem->alloc_small)
494 source->pub.start_input = start_input_tga;
495 source->pub.finish_input = finish_input_tga;
struct cdjpeg_progress_mgr * cd_progress_ptr
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
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLenum GLuint components
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
_Check_return_ _CRTIMP int __cdecl getc(_Inout_ FILE *_File)
#define TRACEMS2(cinfo, lvl, code, p1, p2)
#define JMETHOD(type, methodname, arglist)
struct jpeg_common_struct * j_common_ptr
struct jpeg_progress_mgr pub
int completed_extra_passes
J_COLOR_SPACE in_color_space
#define ReadOK(tif, buf, size)