ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

cdjpeg.h
Go to the documentation of this file.
00001 /*
00002  * cdjpeg.h
00003  *
00004  * Copyright (C) 1994-1997, Thomas G. Lane.
00005  * This file is part of the Independent JPEG Group's software.
00006  * For conditions of distribution and use, see the accompanying README file.
00007  *
00008  * This file contains common declarations for the sample applications
00009  * cjpeg and djpeg.  It is NOT used by the core JPEG library.
00010  */
00011 
00012 #define JPEG_CJPEG_DJPEG    /* define proper options in jconfig.h */
00013 #define JPEG_INTERNAL_OPTIONS   /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
00014 #include "jinclude.h"
00015 #include "jpeglib.h"
00016 #include "jerror.h"     /* get library error codes too */
00017 #include "cderror.h"        /* get application-specific error codes */
00018 
00019 
00020 /*
00021  * Object interface for cjpeg's source file decoding modules
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  * Object interface for djpeg's output file encoding modules
00043  */
00044 
00045 typedef struct djpeg_dest_struct * djpeg_dest_ptr;
00046 
00047 struct djpeg_dest_struct {
00048   /* start_output is called after jpeg_start_decompress finishes.
00049    * The color map will be ready at this time, if one is needed.
00050    */
00051   JMETHOD(void, start_output, (j_decompress_ptr cinfo,
00052                    djpeg_dest_ptr dinfo));
00053   /* Emit the specified number of pixel rows from the buffer. */
00054   JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
00055                  djpeg_dest_ptr dinfo,
00056                  JDIMENSION rows_supplied));
00057   /* Finish up at the end of the image. */
00058   JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
00059                 djpeg_dest_ptr dinfo));
00060 
00061   /* Target file spec; filled in by djpeg.c after object is created. */
00062   FILE * output_file;
00063 
00064   /* Output pixel-row buffer.  Created by module init or start_output.
00065    * Width is cinfo->output_width * cinfo->output_components;
00066    * height is buffer_height.
00067    */
00068   JSAMPARRAY buffer;
00069   JDIMENSION buffer_height;
00070 };
00071 
00072 
00073 /*
00074  * cjpeg/djpeg may need to perform extra passes to convert to or from
00075  * the source/destination file format.  The JPEG library does not know
00076  * about these passes, but we'd like them to be counted by the progress
00077  * monitor.  We use an expanded progress monitor object to hold the
00078  * additional pass count.
00079  */
00080 
00081 struct cdjpeg_progress_mgr {
00082   struct jpeg_progress_mgr pub; /* fields known to JPEG library */
00083   int completed_extra_passes;   /* extra passes completed */
00084   int total_extra_passes;   /* total extra */
00085   /* last printed percentage stored here to avoid multiple printouts */
00086   int percent_done;
00087 };
00088 
00089 typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
00090 
00091 
00092 /* Short forms of external names for systems with brain-damaged linkers. */
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_quality_ratings     SetQRates
00108 #define set_quant_slots     SetQSlots
00109 #define set_sample_factors  SetSFacts
00110 #define read_color_map      RdCMap
00111 #define enable_signal_catcher   EnSigCatcher
00112 #define start_progress_monitor  StProgMon
00113 #define end_progress_monitor    EnProgMon
00114 #define read_stdin      RdStdin
00115 #define write_stdout        WrStdout
00116 #endif /* NEED_SHORT_EXTERNAL_NAMES */
00117 
00118 /* Module selection routines for I/O modules. */
00119 
00120 EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
00121 EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
00122                         boolean is_os2));
00123 EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
00124 EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
00125 EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
00126 EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
00127 EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
00128 EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
00129 EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
00130 EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
00131 
00132 /* cjpeg support routines (in rdswitch.c) */
00133 
00134 EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
00135                        boolean force_baseline));
00136 EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
00137 EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,
00138                      boolean force_baseline));
00139 EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
00140 EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
00141 
00142 /* djpeg support routines (in rdcolmap.c) */
00143 
00144 EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
00145 
00146 /* common support routines (in cdjpeg.c) */
00147 
00148 EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
00149 EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
00150                      cd_progress_ptr progress));
00151 EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
00152 EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
00153 EXTERN(FILE *) read_stdin JPP((void));
00154 EXTERN(FILE *) write_stdout JPP((void));
00155 
00156 /* miscellaneous useful macros */
00157 
00158 #ifdef DONT_USE_B_MODE      /* define mode parameters for fopen() */
00159 #define READ_BINARY "r"
00160 #define WRITE_BINARY    "w"
00161 #else
00162 #ifdef VMS          /* VMS is very nonstandard */
00163 #define READ_BINARY "rb", "ctx=stm"
00164 #define WRITE_BINARY    "wb", "ctx=stm"
00165 #else               /* standard ANSI-compliant case */
00166 #define READ_BINARY "rb"
00167 #define WRITE_BINARY    "wb"
00168 #endif
00169 #endif
00170 
00171 #ifndef EXIT_FAILURE        /* define exit() codes if not provided */
00172 #define EXIT_FAILURE  1
00173 #endif
00174 #ifndef EXIT_SUCCESS
00175 #ifdef VMS
00176 #define EXIT_SUCCESS  1     /* VMS is very nonstandard */
00177 #else
00178 #define EXIT_SUCCESS  0
00179 #endif
00180 #endif
00181 #ifndef EXIT_WARNING
00182 #ifdef VMS
00183 #define EXIT_WARNING  1     /* VMS is very nonstandard */
00184 #else
00185 #define EXIT_WARNING  2
00186 #endif
00187 #endif

Generated on Sat May 26 2012 04:31:57 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.