Class HdrDecoder

java.lang.Object
org.ngengine.stbimage.HdrDecoder
All Implemented Interfaces:
StbDecoder

public class HdrDecoder extends Object implements StbDecoder
Radiance HDR decoder, RGBE to float conversion.
  • Constructor Details

    • HdrDecoder

      public HdrDecoder(ByteBuffer buffer, IntFunction<ByteBuffer> allocator, boolean flipVertically)
      Creates an HDR decoder instance.
      Parameters:
      buffer - source data
      allocator - output allocator
      flipVertically - true to vertically flip decoded output
  • Method Details

    • isHdr

      public static boolean isHdr(ByteBuffer buffer)
      Tests if the source starts with a Radiance HDR signature.
      Parameters:
      buffer - source bytes
      Returns:
      true if HDR signature is present
    • info

      public StbImageInfo info()
      Reads image metadata without fully decoding pixel data.
      Specified by:
      info in interface StbDecoder
      Returns:
      image information
    • getAllocator

      public IntFunction<ByteBuffer> getAllocator()
      Returns the allocator used by this decoder for output buffers.
      Specified by:
      getAllocator in interface StbDecoder
      Returns:
      allocator function
    • load

      public StbImageResult load(int desiredChannels)
      Decodes image pixels.
      Specified by:
      load in interface StbDecoder
      Parameters:
      desiredChannels - requested output channels (0 keeps source/default behavior)
      Returns:
      decoded image result