Class PsdDecoder

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

public class PsdDecoder extends Object implements StbDecoder
PSD decoder for composited RGB view, 8/16-bit.
  • Constructor Details

    • PsdDecoder

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

    • isPsd

      public static boolean isPsd(ByteBuffer buffer)
      Tests whether the source starts with a valid PSD signature/version.
      Parameters:
      buffer - source bytes
      Returns:
      true when file header matches PSD
    • getAllocator

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

      public StbImageInfo info()
      Reads image metadata without fully decoding pixel data.
      Specified by:
      info in interface StbDecoder
      Returns:
      image information
    • 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