19 #ifdef TARGA_SUPPORTED 27 #if BITS_IN_JSAMPLE != 8 28 Sorry,
this code only copes with 8-bit JSAMPLEs.
64 targaheader[5] = (char) (num_colors & 0xFF);
65 targaheader[6] = (char) (num_colors >> 8);
69 targaheader[12] = (char) (cinfo->output_width & 0xFF);
70 targaheader[13] = (char) (cinfo->output_width >> 8);
71 targaheader[14] = (char) (cinfo->output_height & 0xFF);
72 targaheader[15] = (char) (cinfo->output_height >> 8);
73 targaheader[17] = 0x20;
88 if (
JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18)
89 ERREXIT(cinfo, JERR_FILE_WRITE);
105 register char * outptr;
110 for (col = cinfo->output_width; col > 0; col--) {
114 inptr += 3, outptr += 3;
126 register char * outptr;
131 for (col = cinfo->output_width; col > 0; col--) {
149 register char * outptr;
150 register JSAMPROW color_map0 = cinfo->colormap[0];
155 for (col = cinfo->output_width; col > 0; col--) {
177 if (cinfo->quantize_colors)
181 }
else if (cinfo->out_color_space ==
JCS_RGB) {
182 if (cinfo->quantize_colors) {
184 num_colors = cinfo->actual_number_of_colors;
185 if (num_colors > 256)
186 ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors);
190 for (
i = 0;
i < num_colors;
i++) {
201 ERREXIT(cinfo, JERR_TGA_COLORSPACE);
214 fflush(dinfo->output_file);
215 if (ferror(dinfo->output_file))
216 ERREXIT(cinfo, JERR_FILE_WRITE);
240 dest->
buffer_width = cinfo->output_width * cinfo->output_components;
246 dest->
pub.
buffer = (*cinfo->mem->alloc_sarray)
put_gray_rows(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
struct djpeg_dest_struct pub
struct jpeg_common_struct * j_common_ptr
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
#define JFWRITE(file, buf, sizeofbuf)
jpeg_calc_output_dimensions(j_decompress_ptr cinfo)
start_output_tga(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
tga_dest_struct * tga_dest_ptr
put_pixel_rows(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
finish_output_tga(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
#define ERREXIT1(cinfo, code, p1)
write_header(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors)
#define MEMZERO(target, size)
put_demapped_gray(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
jinit_write_targa(j_decompress_ptr cinfo)