w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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,
31  JMETHOD(void, finish_input, (j_compress_ptr cinfo,
33 
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  */
53  /* Emit the specified number of pixel rows from the buffer. */
56  JDIMENSION rows_supplied));
57  /* Finish up at the end of the image. */
60 
61  /* Target file spec; filled in by djpeg.c after object is created. */
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));
130 
131 /* cjpeg support routines (in rdswitch.c) */
132 
133 EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
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 
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 "rb"
157 #define WRITE_BINARY "wb"
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
int dinfo()
Definition: dt2dv.c:867
struct cdjpeg_progress_mgr * cd_progress_ptr
Definition: cdjpeg.h:89
cjpeg_source_ptr jinit_read_targa(j_compress_ptr cinfo)
Definition: rdtarga.c:484
void end_progress_monitor(j_common_ptr cinfo)
cjpeg_source_ptr jinit_read_rle(j_compress_ptr cinfo)
djpeg_dest_ptr jinit_write_gif(j_decompress_ptr cinfo)
Definition: wrgif.c:360
void enable_signal_catcher(j_common_ptr cinfo)
djpeg_dest_ptr jinit_write_ppm(j_decompress_ptr cinfo)
Definition: wrppm.c:219
struct djpeg_dest_struct * djpeg_dest_ptr
Definition: cdjpeg.h:45
cjpeg_source_ptr jinit_read_bmp(j_compress_ptr cinfo)
Definition: rdbmp.c:423
FILE * read_stdin(void)
Definition: cdjpeg.c:149
boolean read_quant_tables(j_compress_ptr cinfo, char *filename, int scale_factor, boolean force_baseline)
Definition: ppmtojpeg.c:567
djpeg_dest_ptr jinit_write_targa(j_decompress_ptr cinfo)
Definition: wrtarga.c:225
boolean keymatch(char *arg, const char *keyword, int minchars)
Definition: cdjpeg.c:122
FILE * write_stdout(void)
Definition: cdjpeg.c:167
cjpeg_source_ptr jinit_read_gif(j_compress_ptr cinfo)
Definition: rdgif.c:31
djpeg_dest_ptr jinit_write_rle(j_decompress_ptr cinfo)
djpeg_dest_ptr jinit_write_bmp(j_decompress_ptr cinfo, boolean is_os2)
Definition: wrbmp.c:390
boolean set_quant_slots(j_compress_ptr cinfo, char *arg)
Definition: ppmtojpeg.c:759
cjpeg_source_ptr jinit_read_ppm(j_compress_ptr cinfo)
Definition: rdppm.c:443
struct cjpeg_source_struct * cjpeg_source_ptr
Definition: cdjpeg.h:24
void start_progress_monitor(j_common_ptr cinfo, cd_progress_ptr progress)
boolean read_scan_script(j_compress_ptr cinfo, char *filename)
Definition: ppmtojpeg.c:650
void read_color_map(j_decompress_ptr cinfo, FILE *infile)
Definition: rdcolmap.c:231
boolean set_sample_factors(j_compress_ptr cinfo, char *arg)
Definition: ppmtojpeg.c:795
unsigned int JDIMENSION
Definition: jmorecfg.h:171
#define JMETHOD(type, methodname, arglist)
Definition: jmorecfg.h:202
#define EXTERN(type)
Definition: jmorecfg.h:190
#define JPP(arglist)
Definition: jpeglib.h:818
JSAMPROW * JSAMPARRAY
Definition: jpeglib.h:67
static FILE * infile
Definition: rdjpgcom.c:61
char * filename[256]
Definition: pbmtopk.c:46
static bool progress
Definition: pdftoppm.cc:141
int total_extra_passes
Definition: cdjpeg.h:84
struct jpeg_progress_mgr pub
Definition: cdjpeg.h:82
int completed_extra_passes
Definition: cdjpeg.h:83
JDIMENSION buffer_height
Definition: cdjpeg.h:37
JSAMPARRAY buffer
Definition: cdjpeg.h:36
void(* finish_input)(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
Definition: cdjpeg.h:32
FILE * input_file
Definition: cdjpeg.h:34
void(* start_input)(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
Definition: cdjpeg.h:28
JDIMENSION(* get_pixel_rows)(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
Definition: cdjpeg.h:30
void(* start_output)(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
Definition: cdjpeg.h:52
void(* put_pixel_rows)(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied)
Definition: cdjpeg.h:56
void(* finish_output)(j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
Definition: cdjpeg.h:59
JDIMENSION buffer_height
Definition: cdjpeg.h:69
JSAMPARRAY buffer
Definition: cdjpeg.h:68
FILE * output_file
Definition: cdjpeg.h:62
def_key keyword[6]
Definition: t1part.c:256
#define FILE
Definition: t1stdio.h:34
static double scale_factor
Definition: ttf2pt1.c:170