@@ -235,7 +235,7 @@ - (nullable JXLSystemImage *)decode:(nonnull NSInputStream *)inputStream
235235
236236 std::vector<uint8_t > iccProfile;
237237 size_t xSize, ySize;
238- bool useFloats ;
238+ bool use16BitImage ;
239239 int depth;
240240 std::vector<uint8_t > outputData;
241241 int components;
@@ -248,14 +248,14 @@ - (nullable JXLSystemImage *)decode:(nonnull NSInputStream *)inputStream
248248 case kR8 :
249249 pixelFormat = r8;
250250 break ;
251- case kFloat16 :
252- pixelFormat = float16 ;
251+ case kR16 :
252+ pixelFormat = r16 ;
253253 break ;
254254 }
255255 auto decoded = DecodeJpegXlOneShot (imageData.data (), imageData.size (),
256256 &outputData, &xSize, &ySize,
257257 &iccProfile, &depth, &components,
258- &useFloats , &jxlExposedOrientation,
258+ &use16BitImage , &jxlExposedOrientation,
259259 pixelFormat);
260260 if (!decoded) {
261261 *error = [[NSError alloc ] initWithDomain: @" JXLCoder"
@@ -277,7 +277,7 @@ - (nullable JXLSystemImage *)decode:(nonnull NSInputStream *)inputStream
277277 if (rescale.width > 0 && rescale.height > 0 ) {
278278 auto scaleResult = [RgbaScaler scaleData: outputData width: (int )xSize height: (int )ySize
279279 newWidth: (int )rescale.width newHeight: (int )rescale.height
280- components: components pixelFormat: useFloats ? kF16 : kU8 ];
280+ components: components pixelFormat: use16BitImage ? kF16 : kU8 ];
281281 if (!scaleResult) {
282282 *error = [[NSError alloc ] initWithDomain: @" JXLCoder"
283283 code: 500
@@ -309,11 +309,11 @@ - (nullable JXLSystemImage *)decode:(nonnull NSInputStream *)inputStream
309309 }
310310 }
311311
312- int stride = components*(int )xSize * (int )(useFloats ? sizeof (uint16_t ) : sizeof (uint8_t ));
312+ int stride = components*(int )xSize * (int )(use16BitImage ? sizeof (uint16_t ) : sizeof (uint8_t ));
313313
314314 int flags;
315- if (useFloats ) {
316- flags = (int )kCGBitmapByteOrder16Host | ( int ) kCGBitmapFloatComponents ;
315+ if (use16BitImage ) {
316+ flags = (int )kCGBitmapByteOrder16Host ;
317317 if (components == 4 ) {
318318 flags |= (int )kCGImageAlphaLast ;
319319 } else {
@@ -343,7 +343,7 @@ - (nullable JXLSystemImage *)decode:(nonnull NSInputStream *)inputStream
343343 return nullptr ;
344344 }
345345
346- int bitsPerComponent = (useFloats ? sizeof (uint16_t ) : sizeof (uint8_t )) * 8 ;
346+ int bitsPerComponent = (use16BitImage ? sizeof (uint16_t ) : sizeof (uint8_t )) * 8 ;
347347 int bitsPerPixel = bitsPerComponent*components;
348348
349349 CGImageRef imageRef = CGImageCreate (xSize, ySize, bitsPerComponent,
0 commit comments