23
23
/* If you happen not to want the image transform support, disable it here */
24
24
#ifndef TRANSFORMS_SUPPORTED
25
#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */
25
#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */
28
28
/* Short forms of external names for systems with brain-damaged linkers. */
30
30
#ifdef NEED_SHORT_EXTERNAL_NAMES
31
#define jtransform_request_workspace jTrRequest
32
#define jtransform_adjust_parameters jTrAdjust
33
#define jtransform_execute_transformation jTrExec
34
#define jcopy_markers_setup jCMrkSetup
35
#define jcopy_markers_execute jCMrkExec
31
#define jtransform_request_workspace jTrRequest
32
#define jtransform_adjust_parameters jTrAdjust
33
#define jtransform_execute_transformation jTrExec
34
#define jcopy_markers_setup jCMrkSetup
35
#define jcopy_markers_execute jCMrkExec
36
36
#endif /* NEED_SHORT_EXTERNAL_NAMES */
40
39
* Codes for supported types of image transformations.
44
JXFORM_NONE, /* no transformation */
45
JXFORM_FLIP_H, /* horizontal flip */
46
JXFORM_FLIP_V, /* vertical flip */
47
JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */
48
JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */
49
JXFORM_ROT_90, /* 90-degree clockwise rotation */
50
JXFORM_ROT_180, /* 180-degree rotation */
51
JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */
43
JXFORM_NONE, /* no transformation */
44
JXFORM_FLIP_H, /* horizontal flip */
45
JXFORM_FLIP_V, /* vertical flip */
46
JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */
47
JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */
48
JXFORM_ROT_90, /* 90-degree clockwise rotation */
49
JXFORM_ROT_180, /* 180-degree rotation */
50
JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */
90
/* Options: set by caller */
91
JXFORM_CODE transform; /* image transform operator */
92
boolean trim; /* if TRUE, trim partial MCUs as needed */
93
boolean force_grayscale; /* if TRUE, convert color image to grayscale */
89
/* Options: set by caller */
90
JXFORM_CODE transform; /* image transform operator */
91
boolean trim; /* if TRUE, trim partial MCUs as needed */
92
boolean force_grayscale; /* if TRUE, convert color image to grayscale */
95
/* Internal workspace: caller should not touch these */
96
int num_components; /* # of components in workspace */
97
jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
94
/* Internal workspace: caller should not touch these */
95
int num_components; /* # of components in workspace */
96
jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
98
97
} jpeg_transform_info;
101
99
#if TRANSFORMS_SUPPORTED
103
101
/* Request any required workspace */
104
102
EXTERN(void) jtransform_request_workspace
105
JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
103
JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
106
104
/* Adjust output image parameters */
107
105
EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
108
JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
109
jvirt_barray_ptr *src_coef_arrays,
110
jpeg_transform_info *info));
106
JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
107
jvirt_barray_ptr *src_coef_arrays,
108
jpeg_transform_info *info));
111
109
/* Execute the actual transformation, if any */
112
110
EXTERN(void) jtransform_execute_transformation
113
JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
114
jvirt_barray_ptr *src_coef_arrays,
115
jpeg_transform_info *info));
111
JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
112
jvirt_barray_ptr *src_coef_arrays,
113
jpeg_transform_info *info));
117
115
#endif /* TRANSFORMS_SUPPORTED */
121
118
* Support for copying optional markers from source to destination file.
125
JCOPYOPT_NONE, /* copy no optional markers */
126
JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */
127
JCOPYOPT_ALL /* copy all optional markers */
122
JCOPYOPT_NONE, /* copy no optional markers */
123
JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */
124
JCOPYOPT_ALL /* copy all optional markers */
130
#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */
127
#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */
132
129
/* Setup decompression object to save desired markers in memory */
133
130
EXTERN(void) jcopy_markers_setup
134
JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
131
JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
135
132
/* Copy markers saved in the given source object to the destination object */
136
133
EXTERN(void) jcopy_markers_execute
137
JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
138
JCOPY_OPTION option));
134
JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
135
JCOPY_OPTION option));