33 #if BITS_IN_JSAMPLE == 8 34 #define PUTPPMSAMPLE(ptr,v) *ptr++ = (char) (v) 35 #define BYTESPERSAMPLE 1 36 #define PPM_MAXVAL 255 39 #define PUTPPMSAMPLE(ptr,v) *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8)) 40 #define BYTESPERSAMPLE 1 41 #define PPM_MAXVAL 255 44 #define PUTPPMSAMPLE(ptr,v) \ 45 { register int val_ = v; \ 46 *ptr++ = (char) (val_ & 0xFF); \ 47 *ptr++ = (char) ((val_ >> 8) & 0xFF); \ 49 #define BYTESPERSAMPLE 2 50 #define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1) 95 (
void)
JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
109 register char * bufferptr;
113 ptr = dest->pub.buffer[0];
114 bufferptr = dest->iobuffer;
115 for (col = dest->samples_per_row; col > 0; col--) {
118 (
void)
JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
132 register char * bufferptr;
135 register JSAMPROW color_map0 = cinfo->colormap[0];
136 register JSAMPROW color_map1 = cinfo->colormap[1];
137 register JSAMPROW color_map2 = cinfo->colormap[2];
140 ptr = dest->pub.buffer[0];
141 bufferptr = dest->iobuffer;
142 for (col = cinfo->output_width; col > 0; col--) {
148 (
void)
JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
157 register char * bufferptr;
159 register JSAMPROW color_map = cinfo->colormap[0];
162 ptr = dest->pub.buffer[0];
163 bufferptr = dest->iobuffer;
164 for (col = cinfo->output_width; col > 0; col--) {
167 (
void)
JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);
181 switch (cinfo->out_color_space) {
184 fprintf(dest->pub.output_file,
"P5\n%ld %ld\n%d\n",
185 (
long) cinfo->output_width, (
long) cinfo->output_height,
190 fprintf(dest->pub.output_file,
"P6\n%ld %ld\n%d\n",
191 (
long) cinfo->output_width, (
long) cinfo->output_height,
195 ERREXIT(cinfo, JERR_PPM_COLORSPACE);
208 fflush(dinfo->output_file);
209 if (ferror(dinfo->output_file))
210 ERREXIT(cinfo, JERR_FILE_WRITE);
234 dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;
236 dest->iobuffer = (
char *) (*cinfo->mem->alloc_small)
245 dest->pub.buffer = (*cinfo->mem->alloc_sarray)
247 cinfo->output_width * cinfo->output_components, (
JDIMENSION) 1);
248 dest->pub.buffer_height = 1;
249 if (! cinfo->quantize_colors)
259 dest->pixrow = (
JSAMPROW) dest->iobuffer;
260 dest->pub.buffer = & dest->pixrow;
261 dest->pub.buffer_height = 1;
ppm_dest_struct * ppm_dest_ptr
struct jpeg_common_struct * j_common_ptr
put_demapped_rgb(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
copy_pixel_rows(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
#define JFWRITE(file, buf, sizeofbuf)
jpeg_calc_output_dimensions(j_decompress_ptr cinfo)
finish_output_ppm(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
put_pixel_rows(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
start_output_ppm(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
jinit_write_ppm(j_decompress_ptr cinfo)
put_demapped_gray(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
#define PUTPPMSAMPLE(ptr, v)