HdrImage.create constructor

HdrImage.create(
  1. int? width,
  2. int? height,
  3. int channels,
  4. int type,
  5. int bitsPerSample,
)

Create an RGBA image.

Implementation

HdrImage.create(
    int? width, int? height, int channels, int type, int bitsPerSample) {
  if (channels < 0 || channels > 4) {
    return;
  }
  const channelList = [R, G, B, A];
  for (var i = 0; i < channels; ++i) {
    addSlice(HdrSlice(channelList[i], width!, height!, type, bitsPerSample));
  }
}