Go to the source code of this file.
Defines | |
#define | ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) |
#define | EXIT_FAILURE 1 |
#define | EXIT_SUCCESS 0 |
#define | JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ |
#define | M_COM 0xFE /* COMment */ |
#define | M_EOI 0xD9 /* End Of Image (end of datastream) */ |
#define | M_SOF0 0xC0 /* Start Of Frame N */ |
#define | M_SOF1 0xC1 /* N indicates which compression process */ |
#define | M_SOF10 0xCA |
#define | M_SOF11 0xCB |
#define | M_SOF13 0xCD |
#define | M_SOF14 0xCE |
#define | M_SOF15 0xCF |
#define | M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ |
#define | M_SOF3 0xC3 |
#define | M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ |
#define | M_SOF6 0xC6 |
#define | M_SOF7 0xC7 |
#define | M_SOF9 0xC9 |
#define | M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ |
#define | M_SOS 0xDA /* Start Of Scan (begins compressed data) */ |
#define | MAX_COM_LENGTH 65000L /* must be <= 65533 in any case */ |
#define | NEXTBYTE() getc(infile) |
#define | PUTBYTE(x) putc((x), outfile) |
#define | READ_BINARY "rb" |
#define | WRITE_BINARY "wb" |
Functions | |
static void | copy_rest_of_file (void) |
static void | copy_variable (void) |
static int | first_marker (void) |
static int | keymatch (char *arg, const char *keyword, int minchars) |
int | main (int argc, char **argv) |
static int | next_marker (void) |
static int | read_1_byte (void) |
static unsigned int | read_2_bytes (void) |
static int | scan_JPEG_header (int keep_COM) |
static void | skip_variable (void) |
static void | usage (void) |
static void | write_1_byte (int c) |
static void | write_2_bytes (unsigned int val) |
static void | write_marker (int marker) |
Variables | |
static FILE * | infile |
static FILE * | outfile |
static const char * | progname |
#define ERREXIT | ( | msg | ) | (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) |
Definition at line 87 of file wrjpgcom.c.
#define EXIT_FAILURE 1 |
Definition at line 51 of file wrjpgcom.c.
#define EXIT_SUCCESS 0 |
Definition at line 57 of file wrjpgcom.c.
#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ |
Definition at line 14 of file wrjpgcom.c.
#define M_COM 0xFE /* COMment */ |
Definition at line 173 of file wrjpgcom.c.
#define M_EOI 0xD9 /* End Of Image (end of datastream) */ |
Definition at line 171 of file wrjpgcom.c.
#define M_SOF0 0xC0 /* Start Of Frame N */ |
Definition at line 157 of file wrjpgcom.c.
#define M_SOF1 0xC1 /* N indicates which compression process */ |
Definition at line 158 of file wrjpgcom.c.
#define M_SOF10 0xCA |
Definition at line 165 of file wrjpgcom.c.
#define M_SOF11 0xCB |
Definition at line 166 of file wrjpgcom.c.
#define M_SOF13 0xCD |
Definition at line 167 of file wrjpgcom.c.
#define M_SOF14 0xCE |
Definition at line 168 of file wrjpgcom.c.
#define M_SOF15 0xCF |
Definition at line 169 of file wrjpgcom.c.
#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ |
Definition at line 159 of file wrjpgcom.c.
#define M_SOF3 0xC3 |
Definition at line 160 of file wrjpgcom.c.
#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ |
Definition at line 161 of file wrjpgcom.c.
#define M_SOF6 0xC6 |
Definition at line 162 of file wrjpgcom.c.
#define M_SOF7 0xC7 |
Definition at line 163 of file wrjpgcom.c.
#define M_SOF9 0xC9 |
Definition at line 164 of file wrjpgcom.c.
#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ |
Definition at line 170 of file wrjpgcom.c.
#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ |
Definition at line 172 of file wrjpgcom.c.
#define MAX_COM_LENGTH 65000L /* must be <= 65533 in any case */ |
Definition at line 66 of file wrjpgcom.c.
Definition at line 78 of file wrjpgcom.c.
#define READ_BINARY "rb" |
Definition at line 45 of file wrjpgcom.c.
#define WRITE_BINARY "wb" |
Definition at line 46 of file wrjpgcom.c.
static void copy_rest_of_file | ( | void | ) | [static] |
Definition at line 142 of file wrjpgcom.c.
static void copy_variable | ( | void | ) | [static] |
Definition at line 244 of file wrjpgcom.c.
static int first_marker | ( | void | ) | [static] |
Definition at line 222 of file wrjpgcom.c.
Definition at line 384 of file wrjpgcom.c.
Definition at line 413 of file wrjpgcom.c.
static int next_marker | ( | void | ) | [static] |
Definition at line 187 of file wrjpgcom.c.
static int read_1_byte | ( | void | ) | [static] |
Definition at line 92 of file wrjpgcom.c.
static unsigned int read_2_bytes | ( | void | ) | [static] |
Definition at line 105 of file wrjpgcom.c.
static int scan_JPEG_header | ( | int | keep_COM | ) | [static] |
Definition at line 289 of file wrjpgcom.c.
static void skip_variable | ( | void | ) | [static] |
Definition at line 264 of file wrjpgcom.c.
Definition at line 351 of file wrjpgcom.c.
static void write_1_byte | ( | int | c | ) | [static] |
Definition at line 122 of file wrjpgcom.c.
static void write_2_bytes | ( | unsigned int | val | ) | [static] |
Definition at line 128 of file wrjpgcom.c.
static void write_marker | ( | int | marker | ) | [static] |
Definition at line 135 of file wrjpgcom.c.
FILE* infile [static] |
Definition at line 75 of file wrjpgcom.c.
FILE* outfile [static] |
Definition at line 80 of file wrjpgcom.c.
Definition at line 347 of file wrjpgcom.c.