Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/vncdll/winvnc/libjpeg/cdjpeg.h
Views: 11784
/*1* cdjpeg.h2*3* Copyright (C) 1994-1997, Thomas G. Lane.4* This file is part of the Independent JPEG Group's software.5* For conditions of distribution and use, see the accompanying README file.6*7* This file contains common declarations for the sample applications8* cjpeg and djpeg. It is NOT used by the core JPEG library.9*/1011#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */12#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */13#include "jinclude.h"14#include "jpeglib.h"15#include "jerror.h" /* get library error codes too */16#include "cderror.h" /* get application-specific error codes */171819/*20* Object interface for cjpeg's source file decoding modules21*/2223typedef struct cjpeg_source_struct * cjpeg_source_ptr;2425struct cjpeg_source_struct {26JMETHOD(void, start_input, (j_compress_ptr cinfo,27cjpeg_source_ptr sinfo));28JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,29cjpeg_source_ptr sinfo));30JMETHOD(void, finish_input, (j_compress_ptr cinfo,31cjpeg_source_ptr sinfo));3233FILE *input_file;3435JSAMPARRAY buffer;36JDIMENSION buffer_height;37};383940/*41* Object interface for djpeg's output file encoding modules42*/4344typedef struct djpeg_dest_struct * djpeg_dest_ptr;4546struct djpeg_dest_struct {47/* start_output is called after jpeg_start_decompress finishes.48* The color map will be ready at this time, if one is needed.49*/50JMETHOD(void, start_output, (j_decompress_ptr cinfo,51djpeg_dest_ptr dinfo));52/* Emit the specified number of pixel rows from the buffer. */53JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,54djpeg_dest_ptr dinfo,55JDIMENSION rows_supplied));56/* Finish up at the end of the image. */57JMETHOD(void, finish_output, (j_decompress_ptr cinfo,58djpeg_dest_ptr dinfo));5960/* Target file spec; filled in by djpeg.c after object is created. */61FILE * output_file;6263/* Output pixel-row buffer. Created by module init or start_output.64* Width is cinfo->output_width * cinfo->output_components;65* height is buffer_height.66*/67JSAMPARRAY buffer;68JDIMENSION buffer_height;69};707172/*73* cjpeg/djpeg may need to perform extra passes to convert to or from74* the source/destination file format. The JPEG library does not know75* about these passes, but we'd like them to be counted by the progress76* monitor. We use an expanded progress monitor object to hold the77* additional pass count.78*/7980struct cdjpeg_progress_mgr {81struct jpeg_progress_mgr pub; /* fields known to JPEG library */82int completed_extra_passes; /* extra passes completed */83int total_extra_passes; /* total extra */84/* last printed percentage stored here to avoid multiple printouts */85int percent_done;86};8788typedef struct cdjpeg_progress_mgr * cd_progress_ptr;899091/* Short forms of external names for systems with brain-damaged linkers. */9293#ifdef NEED_SHORT_EXTERNAL_NAMES94#define jinit_read_bmp jIRdBMP95#define jinit_write_bmp jIWrBMP96#define jinit_read_gif jIRdGIF97#define jinit_write_gif jIWrGIF98#define jinit_read_ppm jIRdPPM99#define jinit_write_ppm jIWrPPM100#define jinit_read_rle jIRdRLE101#define jinit_write_rle jIWrRLE102#define jinit_read_targa jIRdTarga103#define jinit_write_targa jIWrTarga104#define read_quant_tables RdQTables105#define read_scan_script RdScnScript106#define set_quant_slots SetQSlots107#define set_sample_factors SetSFacts108#define read_color_map RdCMap109#define enable_signal_catcher EnSigCatcher110#define start_progress_monitor StProgMon111#define end_progress_monitor EnProgMon112#define read_stdin RdStdin113#define write_stdout WrStdout114#endif /* NEED_SHORT_EXTERNAL_NAMES */115116/* Module selection routines for I/O modules. */117118EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));119EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,120boolean is_os2));121EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));122EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));123EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));124EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));125EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));126EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));127EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));128EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));129130/* cjpeg support routines (in rdswitch.c) */131132EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,133int scale_factor, boolean force_baseline));134EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));135EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));136EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));137138/* djpeg support routines (in rdcolmap.c) */139140EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));141142/* common support routines (in cdjpeg.c) */143144EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));145EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,146cd_progress_ptr progress));147EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));148EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));149EXTERN(FILE *) read_stdin JPP((void));150EXTERN(FILE *) write_stdout JPP((void));151152/* miscellaneous useful macros */153154#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */155#define READ_BINARY "r"156#define WRITE_BINARY "w"157#else158#ifdef VMS /* VMS is very nonstandard */159#define READ_BINARY "rb", "ctx=stm"160#define WRITE_BINARY "wb", "ctx=stm"161#else /* standard ANSI-compliant case */162#define READ_BINARY "rb"163#define WRITE_BINARY "wb"164#endif165#endif166167#ifndef EXIT_FAILURE /* define exit() codes if not provided */168#define EXIT_FAILURE 1169#endif170#ifndef EXIT_SUCCESS171#ifdef VMS172#define EXIT_SUCCESS 1 /* VMS is very nonstandard */173#else174#define EXIT_SUCCESS 0175#endif176#endif177#ifndef EXIT_WARNING178#ifdef VMS179#define EXIT_WARNING 1 /* VMS is very nonstandard */180#else181#define EXIT_WARNING 2182#endif183#endif184185186