cdjpeg.h
Go to the documentation of this file.
1 /*
2  * cdjpeg.h
3  *
4  * Copyright (C) 1994-1997, Thomas G. Lane.
5  * This file is part of the Independent JPEG Group's software.
6  * For conditions of distribution and use, see the accompanying README file.
7  *
8  * This file contains common declarations for the sample applications
9  * cjpeg and djpeg. It is NOT used by the core JPEG library.
10  */
11 
12 #define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
13 #define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
14 #include "jinclude.h"
15 #include "jpeglib.h"
16 #include "jerror.h" /* get library error codes too */
17 #include "cderror.h" /* get application-specific error codes */
18 
19 
20 /*
21  * Object interface for cjpeg's source file decoding modules
22  */
23 
25 
27  JMETHOD(void, start_input, (j_compress_ptr cinfo,
28  cjpeg_source_ptr sinfo));
29  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
30  cjpeg_source_ptr sinfo));
31  JMETHOD(void, finish_input, (j_compress_ptr cinfo,
32  cjpeg_source_ptr sinfo));
33 
34  FILE *input_file;
35 
38 };
39 
40 
41 /*
42  * Object interface for djpeg's output file encoding modules
43  */
44 
46 
48  /* start_output is called after jpeg_start_decompress finishes.
49  * The color map will be ready at this time, if one is needed.
50  */
51  JMETHOD(void, start_output, (j_decompress_ptr cinfo,
52  djpeg_dest_ptr dinfo));
53  /* Emit the specified number of pixel rows from the buffer. */
55  djpeg_dest_ptr dinfo,
56  JDIMENSION rows_supplied));
57  /* Finish up at the end of the image. */
58  JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
59  djpeg_dest_ptr dinfo));
60 
61  /* Target file spec; filled in by djpeg.c after object is created. */
62  FILE * output_file;
63 
64  /* Output pixel-row buffer. Created by module init or start_output.
65  * Width is cinfo->output_width * cinfo->output_components;
66  * height is buffer_height.
67  */
70 };
71 
72 
73 /*
74  * cjpeg/djpeg may need to perform extra passes to convert to or from
75  * the source/destination file format. The JPEG library does not know
76  * about these passes, but we'd like them to be counted by the progress
77  * monitor. We use an expanded progress monitor object to hold the
78  * additional pass count.
79  */
80 
82  struct jpeg_progress_mgr pub; /* fields known to JPEG library */
83  int completed_extra_passes; /* extra passes completed */
84  int total_extra_passes; /* total extra */
85  /* last printed percentage stored here to avoid multiple printouts */
87 };
88 
90 
91 
92 /* Short forms of external names for systems with brain-damaged linkers. */
93 
94 #ifdef NEED_SHORT_EXTERNAL_NAMES
95 #define jinit_read_bmp jIRdBMP
96 #define jinit_write_bmp jIWrBMP
97 #define jinit_read_gif jIRdGIF
98 #define jinit_write_gif jIWrGIF
99 #define jinit_read_ppm jIRdPPM
100 #define jinit_write_ppm jIWrPPM
101 #define jinit_read_rle jIRdRLE
102 #define jinit_write_rle jIWrRLE
103 #define jinit_read_targa jIRdTarga
104 #define jinit_write_targa jIWrTarga
105 #define read_quant_tables RdQTables
106 #define read_scan_script RdScnScript
107 #define set_quant_slots SetQSlots
108 #define set_sample_factors SetSFacts
109 #define read_color_map RdCMap
110 #define enable_signal_catcher EnSigCatcher
111 #define start_progress_monitor StProgMon
112 #define end_progress_monitor EnProgMon
113 #define read_stdin RdStdin
114 #define write_stdout WrStdout
115 #endif /* NEED_SHORT_EXTERNAL_NAMES */
116 
117 /* Module selection routines for I/O modules. */
118 
121  boolean is_os2));
126 EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
127 EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
130 
131 /* cjpeg support routines (in rdswitch.c) */
132 
134  int scale_factor, boolean force_baseline));
135 EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
136 EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
137 EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
138 
139 /* djpeg support routines (in rdcolmap.c) */
140 
142 
143 /* common support routines (in cdjpeg.c) */
144 
145 EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
146 EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
148 EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
149 EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
150 EXTERN(FILE *) read_stdin JPP((void));
151 EXTERN(FILE *) write_stdout JPP((void));
152 
153 /* miscellaneous useful macros */
154 
155 #ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
156 #define READ_BINARY "r"
157 #define WRITE_BINARY "w"
158 #else
159 #ifdef VMS /* VMS is very nonstandard */
160 #define READ_BINARY "rb", "ctx=stm"
161 #define WRITE_BINARY "wb", "ctx=stm"
162 #else /* standard ANSI-compliant case */
163 #define READ_BINARY "rb"
164 #define WRITE_BINARY "wb"
165 #endif
166 #endif
167 
168 #ifndef EXIT_FAILURE /* define exit() codes if not provided */
169 #define EXIT_FAILURE 1
170 #endif
171 #ifndef EXIT_SUCCESS
172 #ifdef VMS
173 #define EXIT_SUCCESS 1 /* VMS is very nonstandard */
174 #else
175 #define EXIT_SUCCESS 0
176 #endif
177 #endif
178 #ifndef EXIT_WARNING
179 #ifdef VMS
180 #define EXIT_WARNING 1 /* VMS is very nonstandard */
181 #else
182 #define EXIT_WARNING 2
183 #endif
184 #endif
djpeg_dest_struct::output_file
FILE * output_file
Definition: cdjpeg.h:62
jpeglib.h
djpeg_dest_struct::buffer_height
JDIMENSION buffer_height
Definition: cdjpeg.h:69
jinit_write_gif
jinit_write_gif(j_decompress_ptr cinfo)
Definition: wrgif.c:360
put_pixel_rows
put_pixel_rows(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
Definition: wrgif.c:319
jinit_write_ppm
jinit_write_ppm(j_decompress_ptr cinfo)
Definition: wrppm.c:219
cdjpeg_progress_mgr::pub
struct jpeg_progress_mgr pub
Definition: cdjpeg.h:82
jinit_write_targa
jinit_write_targa(j_decompress_ptr cinfo)
Definition: wrtarga.c:225
cjpeg_source_ptr
struct cjpeg_source_struct * cjpeg_source_ptr
Definition: cdjpeg.h:24
progress
cd_progress_ptr progress
Definition: cdjpeg.h:147
write_stdout
write_stdout(void)
Definition: cdjpeg.c:167
arg
char * arg
Definition: cdjpeg.h:136
cdjpeg_progress_mgr::completed_extra_passes
int completed_extra_passes
Definition: cdjpeg.h:83
jinclude.h
jinit_read_bmp
jinit_read_bmp(j_compress_ptr cinfo)
Definition: rdbmp.c:423
cjpeg_source_struct::JMETHOD
JMETHOD(void, start_input,(j_compress_ptr cinfo, cjpeg_source_ptr sinfo))
read_color_map
read_color_map(j_decompress_ptr cinfo, FILE *infile)
Definition: rdcolmap.c:231
set_sample_factors
set_sample_factors(j_compress_ptr cinfo, char *arg)
Definition: rdswitch.c:301
keyword
const char * keyword
Definition: cdjpeg.h:149
force_baseline
char int boolean force_baseline
Definition: cdjpeg.h:134
cjpeg_source_struct::buffer_height
JDIMENSION buffer_height
Definition: cdjpeg.h:37
jpeg_common_struct
Definition: jpeglib.h:253
cderror.h
jpeg_compress_struct
Definition: jpeglib.h:268
djpeg_dest_struct
Definition: cdjpeg.h:47
JPP
#define JPP(arglist)
Definition: jpeglib.h:818
jinit_read_targa
jinit_read_targa(j_compress_ptr cinfo)
Definition: rdtarga.c:484
read_scan_script
read_scan_script(j_compress_ptr cinfo, char *filename)
Definition: rdswitch.c:158
filename
char * filename
Definition: cdjpeg.h:133
JDIMENSION
unsigned int JDIMENSION
Definition: jmorecfg.h:171
infile
FILE * infile
Definition: cdjpeg.h:141
cd_progress_ptr
struct cdjpeg_progress_mgr * cd_progress_ptr
Definition: cdjpeg.h:89
read_stdin
read_stdin(void)
Definition: cdjpeg.c:149
cjpeg_source_struct::buffer
JSAMPARRAY buffer
Definition: cdjpeg.h:36
jerror.h
EXTERN
EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo))
is_os2
boolean is_os2
Definition: cdjpeg.h:121
keymatch
keymatch(char *arg, const char *keyword, int minchars)
Definition: cdjpeg.c:122
minchars
const char int minchars
Definition: cdjpeg.h:149
jinit_read_gif
jinit_read_gif(j_compress_ptr cinfo)
Definition: rdgif.c:31
cdjpeg_progress_mgr::percent_done
int percent_done
Definition: cdjpeg.h:86
scale_factor
char int scale_factor
Definition: cdjpeg.h:134
djpeg_dest_struct::buffer
JSAMPARRAY buffer
Definition: cdjpeg.h:68
jpeg_progress_mgr
Definition: jpeglib.h:701
cdjpeg_progress_mgr::total_extra_passes
int total_extra_passes
Definition: cdjpeg.h:84
cdjpeg_progress_mgr
Definition: cdjpeg.h:81
jinit_write_bmp
jinit_write_bmp(j_decompress_ptr cinfo, boolean is_os2)
Definition: wrbmp.c:390
cjpeg_source_struct::input_file
FILE * input_file
Definition: cdjpeg.h:34
read_quant_tables
read_quant_tables(j_compress_ptr cinfo, char *filename, int scale_factor, boolean force_baseline)
Definition: rdswitch.c:73
cjpeg_source_struct
Definition: cdjpeg.h:26
JSAMPARRAY
JSAMPROW * JSAMPARRAY
Definition: jpeglib.h:67
set_quant_slots
set_quant_slots(j_compress_ptr cinfo, char *arg)
Definition: rdswitch.c:266
djpeg_dest_struct::JMETHOD
JMETHOD(void, start_output,(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo))
djpeg_dest_ptr
struct djpeg_dest_struct * djpeg_dest_ptr
Definition: cdjpeg.h:45
jinit_read_ppm
jinit_read_ppm(j_compress_ptr cinfo)
Definition: rdppm.c:443
jpeg_decompress_struct
Definition: jpeglib.h:411


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:02