Class spng_ihdr

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class spng_ihdr extends Struct<spng_ihdr> implements NativeResource

 struct spng_ihdr {
     uint32_t width;
     uint32_t height;
     uint8_t bit_depth;
     uint8_t color_type;
     uint8_t compression_method;
     uint8_t filter_method;
     uint8_t interlace_method;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • WIDTH

      public static final int WIDTH
      The struct member offsets.
    • HEIGHT

      public static final int HEIGHT
      The struct member offsets.
    • BIT_DEPTH

      public static final int BIT_DEPTH
      The struct member offsets.
    • COLOR_TYPE

      public static final int COLOR_TYPE
      The struct member offsets.
    • COMPRESSION_METHOD

      public static final int COMPRESSION_METHOD
      The struct member offsets.
    • FILTER_METHOD

      public static final int FILTER_METHOD
      The struct member offsets.
    • INTERLACE_METHOD

      public static final int INTERLACE_METHOD
      The struct member offsets.
  • Constructor Details

    • spng_ihdr

      public spng_ihdr(ByteBuffer container)
      Creates a spng_ihdr instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<spng_ihdr>
    • width

      public int width()
      Returns:
      the value of the width field.
    • height

      public int height()
      Returns:
      the value of the height field.
    • bit_depth

      public byte bit_depth()
      Returns:
      the value of the bit_depth field.
    • color_type

      public byte color_type()
      Returns:
      the value of the color_type field.
    • compression_method

      public byte compression_method()
      Returns:
      the value of the compression_method field.
    • filter_method

      public byte filter_method()
      Returns:
      the value of the filter_method field.
    • interlace_method

      public byte interlace_method()
      Returns:
      the value of the interlace_method field.
    • width

      public spng_ihdr width(int value)
      Sets the specified value to the width field.
    • height

      public spng_ihdr height(int value)
      Sets the specified value to the height field.
    • bit_depth

      public spng_ihdr bit_depth(byte value)
      Sets the specified value to the bit_depth field.
    • color_type

      public spng_ihdr color_type(byte value)
      Sets the specified value to the color_type field.
    • compression_method

      public spng_ihdr compression_method(byte value)
      Sets the specified value to the compression_method field.
    • filter_method

      public spng_ihdr filter_method(byte value)
      Sets the specified value to the filter_method field.
    • interlace_method

      public spng_ihdr interlace_method(byte value)
      Sets the specified value to the interlace_method field.
    • set

      public spng_ihdr set(int width, int height, byte bit_depth, byte color_type, byte compression_method, byte filter_method, byte interlace_method)
      Initializes this struct with the specified values.
    • set

      public spng_ihdr set(spng_ihdr src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static spng_ihdr malloc()
      Returns a new spng_ihdr instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static spng_ihdr calloc()
      Returns a new spng_ihdr instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static spng_ihdr create()
      Returns a new spng_ihdr instance allocated with BufferUtils.
    • create

      public static spng_ihdr create(long address)
      Returns a new spng_ihdr instance for the specified memory address.
    • createSafe

      public static @Nullable spng_ihdr createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static spng_ihdr.Buffer malloc(int capacity)
      Returns a new spng_ihdr.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static spng_ihdr.Buffer calloc(int capacity)
      Returns a new spng_ihdr.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static spng_ihdr.Buffer create(int capacity)
      Returns a new spng_ihdr.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static spng_ihdr.Buffer create(long address, int capacity)
      Create a spng_ihdr.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable spng_ihdr.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static spng_ihdr malloc(MemoryStack stack)
      Returns a new spng_ihdr instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static spng_ihdr calloc(MemoryStack stack)
      Returns a new spng_ihdr instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static spng_ihdr.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new spng_ihdr.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static spng_ihdr.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new spng_ihdr.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nwidth

      public static int nwidth(long struct)
      Unsafe version of width().
    • nheight

      public static int nheight(long struct)
      Unsafe version of height().
    • nbit_depth

      public static byte nbit_depth(long struct)
      Unsafe version of bit_depth().
    • ncolor_type

      public static byte ncolor_type(long struct)
      Unsafe version of color_type().
    • ncompression_method

      public static byte ncompression_method(long struct)
      Unsafe version of compression_method().
    • nfilter_method

      public static byte nfilter_method(long struct)
      Unsafe version of filter_method().
    • ninterlace_method

      public static byte ninterlace_method(long struct)
      Unsafe version of interlace_method().
    • nwidth

      public static void nwidth(long struct, int value)
      Unsafe version of width.
    • nheight

      public static void nheight(long struct, int value)
      Unsafe version of height.
    • nbit_depth

      public static void nbit_depth(long struct, byte value)
      Unsafe version of bit_depth.
    • ncolor_type

      public static void ncolor_type(long struct, byte value)
      Unsafe version of color_type.
    • ncompression_method

      public static void ncompression_method(long struct, byte value)
      Unsafe version of compression_method.
    • nfilter_method

      public static void nfilter_method(long struct, byte value)
      Unsafe version of filter_method.
    • ninterlace_method

      public static void ninterlace_method(long struct, byte value)
      Unsafe version of interlace_method.