Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #define JPEG_CJPEG_DJPEG
00013 #define JPEG_INTERNAL_OPTIONS
00014 #include "jinclude.h"
00015 #include "jpeglib.h"
00016 #include "jerror.h"
00017 #include "cderror.h"
00018
00019
00020
00021
00022
00023
00024 typedef struct cjpeg_source_struct * cjpeg_source_ptr;
00025
00026 struct cjpeg_source_struct {
00027 JMETHOD(void, start_input, (j_compress_ptr cinfo,
00028 cjpeg_source_ptr sinfo));
00029 JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
00030 cjpeg_source_ptr sinfo));
00031 JMETHOD(void, finish_input, (j_compress_ptr cinfo,
00032 cjpeg_source_ptr sinfo));
00033
00034 FILE *input_file;
00035
00036 JSAMPARRAY buffer;
00037 JDIMENSION buffer_height;
00038 };
00039
00040
00041
00042
00043
00044
00045 typedef struct djpeg_dest_struct * djpeg_dest_ptr;
00046
00047 struct djpeg_dest_struct {
00048
00049
00050
00051 JMETHOD(void, start_output, (j_decompress_ptr cinfo,
00052 djpeg_dest_ptr dinfo));
00053
00054 JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
00055 djpeg_dest_ptr dinfo,
00056 JDIMENSION rows_supplied));
00057
00058 JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
00059 djpeg_dest_ptr dinfo));
00060
00061
00062 FILE * output_file;
00063
00064
00065
00066
00067
00068 JSAMPARRAY buffer;
00069 JDIMENSION buffer_height;
00070 };
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 struct cdjpeg_progress_mgr {
00082 struct jpeg_progress_mgr pub;
00083 int completed_extra_passes;
00084 int total_extra_passes;
00085
00086 int percent_done;
00087 };
00088
00089 typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
00090
00091
00092
00093
00094 #ifdef NEED_SHORT_EXTERNAL_NAMES
00095 #define jinit_read_bmp jIRdBMP
00096 #define jinit_write_bmp jIWrBMP
00097 #define jinit_read_gif jIRdGIF
00098 #define jinit_write_gif jIWrGIF
00099 #define jinit_read_ppm jIRdPPM
00100 #define jinit_write_ppm jIWrPPM
00101 #define jinit_read_rle jIRdRLE
00102 #define jinit_write_rle jIWrRLE
00103 #define jinit_read_targa jIRdTarga
00104 #define jinit_write_targa jIWrTarga
00105 #define read_quant_tables RdQTables
00106 #define read_scan_script RdScnScript
00107 #define set_quant_slots SetQSlots
00108 #define set_sample_factors SetSFacts
00109 #define read_color_map RdCMap
00110 #define enable_signal_catcher EnSigCatcher
00111 #define start_progress_monitor StProgMon
00112 #define end_progress_monitor EnProgMon
00113 #define read_stdin RdStdin
00114 #define write_stdout WrStdout
00115 #endif
00116
00117
00118
00119 EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
00120 EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
00121 boolean is_os2));
00122 EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
00123 EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
00124 EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
00125 EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
00126 EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
00127 EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
00128 EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
00129 EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
00130
00131
00132
00133 EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
00134 int scale_factor, boolean force_baseline));
00135 EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
00136 EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
00137 EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
00138
00139
00140
00141 EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
00142
00143
00144
00145 EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
00146 EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
00147 cd_progress_ptr progress));
00148 EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
00149 EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
00150 EXTERN(FILE *) read_stdin JPP((void));
00151 EXTERN(FILE *) write_stdout JPP((void));
00152
00153
00154
00155 #ifdef DONT_USE_B_MODE
00156 #define READ_BINARY "r"
00157 #define WRITE_BINARY "w"
00158 #else
00159 #ifdef VMS
00160 #define READ_BINARY "rb", "ctx=stm"
00161 #define WRITE_BINARY "wb", "ctx=stm"
00162 #else
00163 #define READ_BINARY "rb"
00164 #define WRITE_BINARY "wb"
00165 #endif
00166 #endif
00167
00168 #ifndef EXIT_FAILURE
00169 #define EXIT_FAILURE 1
00170 #endif
00171 #ifndef EXIT_SUCCESS
00172 #ifdef VMS
00173 #define EXIT_SUCCESS 1
00174 #else
00175 #define EXIT_SUCCESS 0
00176 #endif
00177 #endif
00178 #ifndef EXIT_WARNING
00179 #ifdef VMS
00180 #define EXIT_WARNING 1
00181 #else
00182 #define EXIT_WARNING 2
00183 #endif
00184 #endif