SANEI 1.3.1.74-c434
sanei_jpeg.h
1/*
2 * cdjpeg.h
3 *
4 * Copyright (C) 1994-1996, 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 "sane/sanei_jinclude.h"
15#include "jpeglib.h"
16#include "jerror.h" /* get library error codes too */
17#include "sane/sanei_cderror.h" /* get application-specific error codes */
18
19/*
20 * Object interface for djpeg's output file encoding modules
21 */
22
23typedef struct djpeg_dest_struct * djpeg_dest_ptr;
24
25struct djpeg_dest_struct {
26 /* start_output is called after jpeg_start_decompress finishes.
27 * The color map will be ready at this time, if one is needed.
28 */
29 JMETHOD(void, start_output, (j_decompress_ptr cinfo,
30 djpeg_dest_ptr dinfo));
31 /* Emit the specified number of pixel rows from the buffer. */
32 JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
33 djpeg_dest_ptr dinfo,
34 JDIMENSION rows_supplied,
35 char *data));
36 /* Finish up at the end of the image. */
37 JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
38 djpeg_dest_ptr dinfo));
39
40 /* Target file spec; filled in by djpeg.c after object is created. */
41 FILE * output_file;
42
43 /* Output pixel-row buffer. Created by module init or start_output.
44 * Width is cinfo->output_width * cinfo->output_components;
45 * height is buffer_height.
46 */
47 JSAMPARRAY buffer;
48 JDIMENSION buffer_height;
49};
50
51/* Module selection routines for I/O modules. */
52
53EXTERN(djpeg_dest_ptr) sanei_jpeg_jinit_write_ppm JPP((j_decompress_ptr cinfo));
54
55/* miscellaneous useful macros */