decodeHdrImage method

  1. @override
HdrImage? decodeHdrImage(
  1. List<int> bytes, {
  2. int frame = 0,
})
override

Decode the file and extract a single High Dynamic Range (HDR) image from it. HDR images are stored in floating-poing values. If the format of the file does not support HDR images, the regular image will be converted to an HDR image as (color / 255). If the file is animated, the specified frame will be decoded. If there was a problem decoding the file, null is returned.

Implementation

@override
HdrImage? decodeHdrImage(List<int> bytes, {int frame = 0}) {
  _input = InputBuffer(bytes);

  info = _readHeader(_input);
  if (info == null) {
    return null;
  }

  final image = info!.images[frame].decodeHdr(_input);
  image.exif = ExifData.fromInputBuffer(InputBuffer(bytes));

  return image;
}