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) 109 register char * bufferptr;
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];
142 for (col = cinfo->output_width; col > 0; col--) {
157 register char * bufferptr;
159 register JSAMPROW color_map = cinfo->colormap[0];
164 for (col = cinfo->output_width; col > 0; col--) {
181 switch (cinfo->out_color_space) {
185 (
long) cinfo->output_width, (
long) cinfo->output_height,
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);
249 if (! cinfo->quantize_colors)
ppm_dest_struct * ppm_dest_ptr
JDIMENSION samples_per_row
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)
#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)
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
struct djpeg_dest_struct pub
put_demapped_gray(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
#define PUTPPMSAMPLE(ptr, v)