Class EXRHeader

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class EXRHeader extends Struct<EXRHeader> implements NativeResource

Layout


 struct EXRHeader {
     float pixel_aspect_ratio;
     int line_order;
     EXRBox2i data_window;
     EXRBox2i display_window;
     float screen_window_center[2];
     float screen_window_width;
     int chunk_count;
     int tiled;
     int tile_size_x;
     int tile_size_y;
     int tile_level_mode;
     int tile_rounding_mode;
     int long_name;
     int non_image();
     int multipart;
     unsigned int header_len;
     int num_custom_attributes();
     EXRAttribute * custom_attributes();
     EXRChannelInfo * channels;
     int * pixel_types();
     int num_channels;
     int compression_type();
     int * requested_pixel_types();
     char name()[256];
 }
  • Field Details

    • SIZEOF

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

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

      public static final int PIXEL_ASPECT_RATIO
      The struct member offsets.
    • LINE_ORDER

      public static final int LINE_ORDER
      The struct member offsets.
    • DATA_WINDOW

      public static final int DATA_WINDOW
      The struct member offsets.
    • DISPLAY_WINDOW

      public static final int DISPLAY_WINDOW
      The struct member offsets.
    • SCREEN_WINDOW_CENTER

      public static final int SCREEN_WINDOW_CENTER
      The struct member offsets.
    • SCREEN_WINDOW_WIDTH

      public static final int SCREEN_WINDOW_WIDTH
      The struct member offsets.
    • CHUNK_COUNT

      public static final int CHUNK_COUNT
      The struct member offsets.
    • TILED

      public static final int TILED
      The struct member offsets.
    • TILE_SIZE_X

      public static final int TILE_SIZE_X
      The struct member offsets.
    • TILE_SIZE_Y

      public static final int TILE_SIZE_Y
      The struct member offsets.
    • TILE_LEVEL_MODE

      public static final int TILE_LEVEL_MODE
      The struct member offsets.
    • TILE_ROUNDING_MODE

      public static final int TILE_ROUNDING_MODE
      The struct member offsets.
    • LONG_NAME

      public static final int LONG_NAME
      The struct member offsets.
    • NON_IMAGE

      public static final int NON_IMAGE
      The struct member offsets.
    • MULTIPART

      public static final int MULTIPART
      The struct member offsets.
    • HEADER_LEN

      public static final int HEADER_LEN
      The struct member offsets.
    • NUM_CUSTOM_ATTRIBUTES

      public static final int NUM_CUSTOM_ATTRIBUTES
      The struct member offsets.
    • CUSTOM_ATTRIBUTES

      public static final int CUSTOM_ATTRIBUTES
      The struct member offsets.
    • CHANNELS

      public static final int CHANNELS
      The struct member offsets.
    • PIXEL_TYPES

      public static final int PIXEL_TYPES
      The struct member offsets.
    • NUM_CHANNELS

      public static final int NUM_CHANNELS
      The struct member offsets.
    • COMPRESSION_TYPE

      public static final int COMPRESSION_TYPE
      The struct member offsets.
    • REQUESTED_PIXEL_TYPES

      public static final int REQUESTED_PIXEL_TYPES
      The struct member offsets.
    • NAME

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

    • EXRHeader

      public EXRHeader(ByteBuffer container)
      Creates a EXRHeader 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<EXRHeader>
    • pixel_aspect_ratio

      public float pixel_aspect_ratio()
      Returns:
      the value of the pixel_aspect_ratio field.
    • line_order

      public int line_order()
      Returns:
      the value of the line_order field.
    • data_window

      public EXRBox2i data_window()
      Returns:
      a EXRBox2i view of the data_window field.
    • display_window

      public EXRBox2i display_window()
      Returns:
      a EXRBox2i view of the display_window field.
    • screen_window_center

      public FloatBuffer screen_window_center()
      Returns:
      a FloatBuffer view of the screen_window_center field.
    • screen_window_center

      public float screen_window_center(int index)
      Returns:
      the value at the specified index of the screen_window_center field.
    • screen_window_width

      public float screen_window_width()
      Returns:
      the value of the screen_window_width field.
    • chunk_count

      public int chunk_count()
      Returns:
      the value of the chunk_count field.
    • tiled

      public boolean tiled()
      Returns:
      the value of the tiled field.
    • tile_size_x

      public int tile_size_x()
      Returns:
      the value of the tile_size_x field.
    • tile_size_y

      public int tile_size_y()
      Returns:
      the value of the tile_size_y field.
    • tile_level_mode

      public int tile_level_mode()
      Returns:
      the value of the tile_level_mode field.
    • tile_rounding_mode

      public int tile_rounding_mode()
      Returns:
      the value of the tile_rounding_mode field.
    • long_name

      public boolean long_name()
      Returns:
      the value of the long_name field.
    • non_image

      public boolean non_image()
      For a single-part file, agree with the version field bit 11. For a multi-part file, it is consistent with the type of part.
    • multipart

      public boolean multipart()
      Returns:
      the value of the multipart field.
    • header_len

      public int header_len()
      Returns:
      the value of the header_len field.
    • num_custom_attributes

      public int num_custom_attributes()
      number of EXRAttribute in the custom_attributes array
    • custom_attributes

      @Nullable public EXRAttribute.Buffer custom_attributes()
      custom attributes (excludes required attributes, e.g. `channels`, `compression`, etc)
    • channels

      public EXRChannelInfo.Buffer channels()
      Returns:
      a EXRChannelInfo.Buffer view of the struct array pointed to by the channels field.
    • pixel_types

      public IntBuffer pixel_types()
      loaded pixel type (TINYEXR_PIXELTYPE_*) of images for each channel. This is overwritten with requested_pixel_types when loading.
    • num_channels

      public int num_channels()
      Returns:
      the value of the num_channels field.
    • compression_type

      public int compression_type()
      compression type (TINYEXR_COMPRESSIONTYPE_*)
    • requested_pixel_types

      public IntBuffer requested_pixel_types()
      filled initially by ParseEXRHeaderFrom(Memory|File), then users can edit it (only valid for HALF pixel type channel)
    • name

      public ByteBuffer name()
      Name attribute required for multipart files.

      Must be unique and non empty (according to spec.). Use TinyEXR.EXRSetNameAttr(org.lwjgl.util.tinyexr.EXRHeader, java.nio.ByteBuffer) for setting value. Max 255 characters allowed - excluding terminating zero.

    • nameString

      public String nameString()
      Name attribute required for multipart files.

      Must be unique and non empty (according to spec.). Use TinyEXR.EXRSetNameAttr(org.lwjgl.util.tinyexr.EXRHeader, java.nio.ByteBuffer) for setting value. Max 255 characters allowed - excluding terminating zero.

    • pixel_aspect_ratio

      public EXRHeader pixel_aspect_ratio(float value)
      Sets the specified value to the pixel_aspect_ratio field.
    • line_order

      public EXRHeader line_order(int value)
      Sets the specified value to the line_order field.
    • data_window

      public EXRHeader data_window(EXRBox2i value)
      Copies the specified EXRBox2i to the data_window field.
    • data_window

      public EXRHeader data_window(Consumer<EXRBox2i> consumer)
      Passes the data_window field to the specified Consumer.
    • display_window

      public EXRHeader display_window(EXRBox2i value)
      Copies the specified EXRBox2i to the display_window field.
    • display_window

      public EXRHeader display_window(Consumer<EXRBox2i> consumer)
      Passes the display_window field to the specified Consumer.
    • screen_window_center

      public EXRHeader screen_window_center(FloatBuffer value)
      Copies the specified FloatBuffer to the screen_window_center field.
    • screen_window_center

      public EXRHeader screen_window_center(int index, float value)
      Sets the specified value at the specified index of the screen_window_center field.
    • screen_window_width

      public EXRHeader screen_window_width(float value)
      Sets the specified value to the screen_window_width field.
    • chunk_count

      public EXRHeader chunk_count(int value)
      Sets the specified value to the chunk_count field.
    • tiled

      public EXRHeader tiled(boolean value)
      Sets the specified value to the tiled field.
    • tile_size_x

      public EXRHeader tile_size_x(int value)
      Sets the specified value to the tile_size_x field.
    • tile_size_y

      public EXRHeader tile_size_y(int value)
      Sets the specified value to the tile_size_y field.
    • tile_level_mode

      public EXRHeader tile_level_mode(int value)
      Sets the specified value to the tile_level_mode field.
    • tile_rounding_mode

      public EXRHeader tile_rounding_mode(int value)
      Sets the specified value to the tile_rounding_mode field.
    • long_name

      public EXRHeader long_name(boolean value)
      Sets the specified value to the long_name field.
    • non_image

      public EXRHeader non_image(boolean value)
      Sets the specified value to the non_image() field.
    • multipart

      public EXRHeader multipart(boolean value)
      Sets the specified value to the multipart field.
    • header_len

      public EXRHeader header_len(int value)
      Sets the specified value to the header_len field.
    • num_custom_attributes

      public EXRHeader num_custom_attributes(int value)
      Sets the specified value to the num_custom_attributes() field.
    • custom_attributes

      public EXRHeader custom_attributes(@Nullable EXRAttribute.Buffer value)
      Sets the address of the specified EXRAttribute.Buffer to the custom_attributes() field.
    • channels

      public EXRHeader channels(EXRChannelInfo.Buffer value)
      Sets the address of the specified EXRChannelInfo.Buffer to the channels field.
    • pixel_types

      public EXRHeader pixel_types(IntBuffer value)
      Sets the address of the specified IntBuffer to the pixel_types() field.
    • num_channels

      public EXRHeader num_channels(int value)
      Sets the specified value to the num_channels field.
    • compression_type

      public EXRHeader compression_type(int value)
      Sets the specified value to the compression_type() field.
    • requested_pixel_types

      public EXRHeader requested_pixel_types(IntBuffer value)
      Sets the address of the specified IntBuffer to the requested_pixel_types() field.
    • name

      public EXRHeader name(ByteBuffer value)
      Copies the specified encoded string to the name() field.
    • set

      public EXRHeader set(float pixel_aspect_ratio, int line_order, EXRBox2i data_window, EXRBox2i display_window, FloatBuffer screen_window_center, float screen_window_width, int chunk_count, boolean tiled, int tile_size_x, int tile_size_y, int tile_level_mode, int tile_rounding_mode, boolean long_name, boolean non_image, boolean multipart, int header_len, int num_custom_attributes, @Nullable EXRAttribute.Buffer custom_attributes, EXRChannelInfo.Buffer channels, IntBuffer pixel_types, int num_channels, int compression_type, IntBuffer requested_pixel_types, ByteBuffer name)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static EXRHeader mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static EXRHeader callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static EXRHeader mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static EXRHeader callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static EXRHeader.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static EXRHeader.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static EXRHeader.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static EXRHeader.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

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

      public static EXRHeader.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new EXRHeader.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
    • npixel_aspect_ratio

      public static float npixel_aspect_ratio(long struct)
      Unsafe version of pixel_aspect_ratio().
    • nline_order

      public static int nline_order(long struct)
      Unsafe version of line_order().
    • ndata_window

      public static EXRBox2i ndata_window(long struct)
      Unsafe version of data_window().
    • ndisplay_window

      public static EXRBox2i ndisplay_window(long struct)
      Unsafe version of display_window().
    • nscreen_window_center

      public static FloatBuffer nscreen_window_center(long struct)
      Unsafe version of screen_window_center().
    • nscreen_window_center

      public static float nscreen_window_center(long struct, int index)
      Unsafe version of screen_window_center.
    • nscreen_window_width

      public static float nscreen_window_width(long struct)
      Unsafe version of screen_window_width().
    • nchunk_count

      public static int nchunk_count(long struct)
      Unsafe version of chunk_count().
    • ntiled

      public static int ntiled(long struct)
      Unsafe version of tiled().
    • ntile_size_x

      public static int ntile_size_x(long struct)
      Unsafe version of tile_size_x().
    • ntile_size_y

      public static int ntile_size_y(long struct)
      Unsafe version of tile_size_y().
    • ntile_level_mode

      public static int ntile_level_mode(long struct)
      Unsafe version of tile_level_mode().
    • ntile_rounding_mode

      public static int ntile_rounding_mode(long struct)
      Unsafe version of tile_rounding_mode().
    • nlong_name

      public static int nlong_name(long struct)
      Unsafe version of long_name().
    • nnon_image

      public static int nnon_image(long struct)
      Unsafe version of non_image().
    • nmultipart

      public static int nmultipart(long struct)
      Unsafe version of multipart().
    • nheader_len

      public static int nheader_len(long struct)
      Unsafe version of header_len().
    • nnum_custom_attributes

      public static int nnum_custom_attributes(long struct)
      Unsafe version of num_custom_attributes().
    • ncustom_attributes

      @Nullable public static EXRAttribute.Buffer ncustom_attributes(long struct)
      Unsafe version of custom_attributes().
    • nchannels

      public static EXRChannelInfo.Buffer nchannels(long struct)
      Unsafe version of channels().
    • npixel_types

      public static IntBuffer npixel_types(long struct)
      Unsafe version of pixel_types.
    • nnum_channels

      public static int nnum_channels(long struct)
      Unsafe version of num_channels().
    • ncompression_type

      public static int ncompression_type(long struct)
      Unsafe version of compression_type().
    • nrequested_pixel_types

      public static IntBuffer nrequested_pixel_types(long struct)
      Unsafe version of requested_pixel_types.
    • nname

      public static ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static String nnameString(long struct)
      Unsafe version of nameString().
    • npixel_aspect_ratio

      public static void npixel_aspect_ratio(long struct, float value)
      Unsafe version of pixel_aspect_ratio.
    • nline_order

      public static void nline_order(long struct, int value)
      Unsafe version of line_order.
    • ndata_window

      public static void ndata_window(long struct, EXRBox2i value)
      Unsafe version of data_window.
    • ndisplay_window

      public static void ndisplay_window(long struct, EXRBox2i value)
      Unsafe version of display_window.
    • nscreen_window_center

      public static void nscreen_window_center(long struct, FloatBuffer value)
      Unsafe version of screen_window_center.
    • nscreen_window_center

      public static void nscreen_window_center(long struct, int index, float value)
      Unsafe version of screen_window_center.
    • nscreen_window_width

      public static void nscreen_window_width(long struct, float value)
      Unsafe version of screen_window_width.
    • nchunk_count

      public static void nchunk_count(long struct, int value)
      Unsafe version of chunk_count.
    • ntiled

      public static void ntiled(long struct, int value)
      Unsafe version of tiled.
    • ntile_size_x

      public static void ntile_size_x(long struct, int value)
      Unsafe version of tile_size_x.
    • ntile_size_y

      public static void ntile_size_y(long struct, int value)
      Unsafe version of tile_size_y.
    • ntile_level_mode

      public static void ntile_level_mode(long struct, int value)
      Unsafe version of tile_level_mode.
    • ntile_rounding_mode

      public static void ntile_rounding_mode(long struct, int value)
      Unsafe version of tile_rounding_mode.
    • nlong_name

      public static void nlong_name(long struct, int value)
      Unsafe version of long_name.
    • nnon_image

      public static void nnon_image(long struct, int value)
      Unsafe version of non_image.
    • nmultipart

      public static void nmultipart(long struct, int value)
      Unsafe version of multipart.
    • nheader_len

      public static void nheader_len(long struct, int value)
      Unsafe version of header_len.
    • nnum_custom_attributes

      public static void nnum_custom_attributes(long struct, int value)
      Sets the specified value to the num_custom_attributes field of the specified struct.
    • ncustom_attributes

      public static void ncustom_attributes(long struct, @Nullable EXRAttribute.Buffer value)
      Unsafe version of custom_attributes.
    • nchannels

      public static void nchannels(long struct, EXRChannelInfo.Buffer value)
      Unsafe version of channels.
    • npixel_types

      public static void npixel_types(long struct, IntBuffer value)
      Unsafe version of pixel_types.
    • nnum_channels

      public static void nnum_channels(long struct, int value)
      Sets the specified value to the num_channels field of the specified struct.
    • ncompression_type

      public static void ncompression_type(long struct, int value)
      Unsafe version of compression_type.
    • nrequested_pixel_types

      public static void nrequested_pixel_types(long struct, IntBuffer value)
      Unsafe version of requested_pixel_types.
    • nname

      public static void nname(long struct, ByteBuffer value)
      Unsafe version of name.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate