22 #ifdef TARGA_SUPPORTED 27 #ifdef HAVE_UNSIGNED_CHAR 29 #define UCH(x) ((int) (x)) 31 #ifdef CHAR_IS_UNSIGNED 33 #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))) 59 JMETHOD(
void, read_pixel, (tga_source_ptr sinfo));
79 0, 8, 16, 25, 33, 41, 49, 58,
80 66, 74, 82, 90, 99, 107, 115, 123,
81 132, 140, 148, 156, 165, 173, 181, 189,
82 197, 206, 214, 222, 230, 239, 247, 255
91 register FILE *
infile = sinfo->pub.input_file;
94 if ((c = getc(infile)) == EOF)
95 ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);
107 if (mapentrysize != 24)
108 ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);
110 for (i = 0; i < cmaplen; i++) {
126 register FILE *
infile = sinfo->pub.input_file;
129 for (
i = 0;
i < sinfo->pixel_size;
i++) {
139 register FILE *
infile = sinfo->pub.input_file;
143 if (sinfo->dup_pixel_count > 0) {
144 sinfo->dup_pixel_count--;
149 if (--sinfo->block_count < 0) {
152 sinfo->dup_pixel_count =
i & 0x7F;
153 sinfo->block_count = 0;
155 sinfo->block_count =
i & 0x7F;
160 for (
i = 0;
i < sinfo->pixel_size;
i++) {
183 (*source->read_pixel) (source);
201 (*source->read_pixel) (source);
221 (*source->read_pixel) (source);
248 (*source->read_pixel) (source);
263 #define get_32bit_row get_24bit_row 281 source_row = cinfo->image_height - source->
current_row - 1;
284 source->
pub.
buffer = (*cinfo->mem->access_virt_sarray)
308 if (progress != NULL) {
315 (*source->get_pixel_rows) (
cinfo, sinfo);
317 if (progress != NULL)
337 int idlen, cmaptype, subtype,
flags, interlace_type, components;
339 boolean is_bottom_up;
341 #define GET_2B(offset) ((unsigned int) UCH(targaheader[offset]) + \ 342 (((unsigned int) UCH(targaheader[offset+1])) << 8)) 348 if (targaheader[16] == 15)
349 targaheader[16] = 16;
351 idlen =
UCH(targaheader[0]);
352 cmaptype =
UCH(targaheader[1]);
353 subtype =
UCH(targaheader[2]);
360 is_bottom_up = ((
flags & 0x20) == 0);
361 interlace_type =
flags >> 6;
365 (
UCH(targaheader[16]) & 7) != 0 ||
427 if (
cinfo->progress != NULL) {
441 source->
pub.get_pixel_rows = source->get_pixel_rows;
448 if (maplen > 256 ||
GET_2B(3) != 0)
486 tga_source_ptr source;
struct _tga_source_struct tga_source_struct
JMETHOD(void, read_pixel,(tga_source_ptr sinfo))
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
#define TRACEMS2(cinfo, lvl, code, p1, p2)
static const UINT8 c5to8bits[32]
J_COLOR_SPACE in_color_space
jvirt_sarray_ptr whole_image
png_infop png_uint_32 * width
struct _tga_source_struct * tga_source_ptr
jinit_read_targa(j_compress_ptr cinfo)
get_8bit_gray_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
get_16bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
struct cjpeg_source_struct pub
png_infop png_uint_32 png_uint_32 * height
get_memory_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
get_24bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
preload_image(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
get_8bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
struct jpeg_progress_mgr pub
read_colormap(tga_source_ptr sinfo, int cmaplen, int mapentrysize)
read_non_rle_pixel(tga_source_ptr sinfo)
int completed_extra_passes
struct cdjpeg_progress_mgr * cd_progress_ptr
read_byte(tga_source_ptr sinfo)
start_input_tga(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
finish_input_tga(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
read_rle_pixel(tga_source_ptr sinfo)
#define ReadOK(file, buffer, len)