13
13
* This function checks for both the JPEG‑XL container signature and the
14
14
* JPEG‑XL stream signature.
15
15
*/
16
- static int
17
- _cf_is_jpegxl (const unsigned char * header , size_t len )
16
+ int
17
+ _cfIsJPEGXL (const unsigned char * header , size_t len )
18
18
{
19
19
if (len < 12 )
20
20
return 0 ;
@@ -104,9 +104,6 @@ _cf_image_create_from_jxl_decoder(JxlDecoder *decoder)
104
104
img -> ysize = (int )basic_info .ysize ;
105
105
img -> xppi = (basic_info .uses_original_profile ) ? 300 : 72 ; // Adjust if necessary
106
106
img -> yppi = (basic_info .uses_original_profile ) ? 300 : 72 ; // Adjust if necessary
107
- #ifdef HAVE_BITS_PER_COMPONENT
108
- img -> bitsPerComponent = (int )basic_info .bits_per_sample ;
109
- #endif
110
107
111
108
/* For JPEG‑XL, we assume the decoded format is RGB. */
112
109
img -> colorspace = CF_IMAGE_RGB ;
@@ -132,7 +129,7 @@ _cf_image_create_from_jxl_decoder(JxlDecoder *decoder)
132
129
* Returns 0 on success, nonzero on failure.
133
130
*/
134
131
int
135
- _cf_image_read_jpegxl (cf_image_t * img , FILE * fp ,
132
+ _cfImageReadJPEGXL (cf_image_t * img , FILE * fp ,
136
133
cf_icspace_t primary , cf_icspace_t secondary ,
137
134
int saturation , int hue , const cf_ib_t * lut )
138
135
{
@@ -190,7 +187,7 @@ _cf_image_read_jpegxl(cf_image_t *img, FILE *fp,
190
187
}
191
188
192
189
/* Create an image from the decoder output */
193
- cf_image_t * new_img = _cf_image_create_from_jxl_decoder (decoder );
190
+ cf_image_t * new_img = _cfImageReadJPEGXL (decoder );
194
191
if (!new_img ) {
195
192
DEBUG_printf ("DEBUG: JPEG‑XL: Failed to create image from decoder data.\n" );
196
193
JxlDecoderDestroy (decoder );
@@ -216,14 +213,14 @@ _cf_image_read_jpegxl(cf_image_t *img, FILE *fp,
216
213
* Returns a pointer to a cf_image_t on success, or NULL on failure.
217
214
*/
218
215
cf_image_t *
219
- _cf_image_open_jpegxl (FILE * fp , cf_icspace_t primary , cf_icspace_t secondary ,
216
+ _cfImageOpenJPEGXL (FILE * fp , cf_icspace_t primary , cf_icspace_t secondary ,
220
217
int saturation , int hue , const cf_ib_t * lut )
221
218
{
222
219
cf_image_t * img = calloc (1 , sizeof (cf_image_t ));
223
220
if (img == NULL )
224
221
return NULL ;
225
222
226
- if (_cf_image_read_jpegxl (img , fp , primary , secondary , saturation , hue , lut )) {
223
+ if (_cfImageReadJPEGXL (img , fp , primary , secondary , saturation , hue , lut )) {
227
224
cfImageClose (img );
228
225
return NULL ;
229
226
}
0 commit comments