HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
_exr_decode_pipeline Struct Reference

#include <openexr_decode.h>

Public Attributes

size_t pipe_size
 
exr_coding_channel_info_tchannels
 
int16_t channel_count
 
uint16_t decode_flags
 
int part_index
 
exr_const_context_t context
 
exr_chunk_info_t chunk
 
int32_t user_line_begin_skip
 
int32_t user_line_end_ignore
 
uint64_t bytes_decompressed
 
voiddecoding_user_data
 
voidpacked_buffer
 
size_t packed_alloc_size
 
voidunpacked_buffer
 
size_t unpacked_alloc_size
 
voidpacked_sample_count_table
 
size_t packed_sample_count_alloc_size
 
int32_t * sample_count_table
 
size_t sample_count_alloc_size
 
voidscratch_buffer_1
 
size_t scratch_alloc_size_1
 
voidscratch_buffer_2
 
size_t scratch_alloc_size_2
 
void *(* alloc_fn )(exr_transcoding_pipeline_buffer_id_t, size_t)
 
void(* free_fn )(exr_transcoding_pipeline_buffer_id_t, void *)
 
exr_result_t(* read_fn )(struct _exr_decode_pipeline *pipeline)
 
exr_result_t(* decompress_fn )(struct _exr_decode_pipeline *pipeline)
 
exr_result_t(* realloc_nonimage_data_fn )(struct _exr_decode_pipeline *pipeline)
 
exr_result_t(* unpack_and_convert_fn )(struct _exr_decode_pipeline *pipeline)
 
exr_coding_channel_info_t _quick_chan_store [5]
 

Detailed Description

Struct meant to be used on a per-thread basis for reading exr data

As should be obvious, this structure is NOT thread safe, but rather meant to be used by separate threads, which can all be accessing the same context concurrently.

Definition at line 64 of file openexr_decode.h.

Member Data Documentation

exr_coding_channel_info_t _exr_decode_pipeline::_quick_chan_store[5]

Small stash of channel info values. This is faster than calling malloc when the channel count in the part is small (RGBAZ), which is super common, however if there are a large number of channels, it will allocate space for that, so do not rely on this being used.

Definition at line 266 of file openexr_decode.h.

void*(* _exr_decode_pipeline::alloc_fn)(exr_transcoding_pipeline_buffer_id_t, size_t)

Enable a custom allocator for the different buffers (if decoding on a GPU). If NULL, will use the allocator from the context.

Definition at line 201 of file openexr_decode.h.

uint64_t _exr_decode_pipeline::bytes_decompressed

How many bytes were actually decoded when items compressed

Definition at line 108 of file openexr_decode.h.

int16_t _exr_decode_pipeline::channel_count

Definition at line 84 of file openexr_decode.h.

exr_coding_channel_info_t* _exr_decode_pipeline::channels

The output channel information for this chunk.

User is expected to fill the channel pointers for the desired output channels (any that are NULL will be skipped) if you are going to use exr_decoding_choose_default_routines(). If all that is desired is to read and decompress the data, this can be left uninitialized.

Describes the channel information. This information is allocated dynamically during exr_decoding_initialize().

Definition at line 83 of file openexr_decode.h.

exr_chunk_info_t _exr_decode_pipeline::chunk

Definition at line 94 of file openexr_decode.h.

exr_const_context_t _exr_decode_pipeline::context

Definition at line 93 of file openexr_decode.h.

uint16_t _exr_decode_pipeline::decode_flags

Decode flags to control the behavior.

Definition at line 87 of file openexr_decode.h.

void* _exr_decode_pipeline::decoding_user_data

Can be used by the user to pass custom context data through the decode pipeline.

Definition at line 113 of file openexr_decode.h.

exr_result_t(* _exr_decode_pipeline::decompress_fn)(struct _exr_decode_pipeline *pipeline)

Function chosen based on the compression type of the part to decompress data.

If the user has a custom decompression method for the compression on this part, this can be changed after initialization.

If only compressed data is desired, then assign this to NULL after initialization.

Definition at line 235 of file openexr_decode.h.

void(* _exr_decode_pipeline::free_fn)(exr_transcoding_pipeline_buffer_id_t, void *)

Enable a custom allocator for the different buffers (if decoding on a GPU). If NULL, will use the allocator from the context.

Definition at line 207 of file openexr_decode.h.

size_t _exr_decode_pipeline::packed_alloc_size

Used when re-using the same decode pipeline struct to know if chunk is changed size whether current buffer is large enough.

Definition at line 128 of file openexr_decode.h.

void* _exr_decode_pipeline::packed_buffer

The (compressed) buffer.

If NULL, will be allocated during the run of the pipeline.

If the caller wishes to take control of the buffer, simple adopt the pointer and set it to NULL here. Be cognizant of any custom allocators.

Definition at line 123 of file openexr_decode.h.

size_t _exr_decode_pipeline::packed_sample_count_alloc_size

Definition at line 152 of file openexr_decode.h.

void* _exr_decode_pipeline::packed_sample_count_table

For deep or other non-image data: packed sample table (compressed, raw on disk representation).

Definition at line 151 of file openexr_decode.h.

int _exr_decode_pipeline::part_index

Copy of the parameters given to the initialize/update for convenience.

Definition at line 92 of file openexr_decode.h.

size_t _exr_decode_pipeline::pipe_size

Used for versioning the decode pipeline in the future.

EXR_DECODE_PIPELINE_INITIALIZER

Definition at line 70 of file openexr_decode.h.

exr_result_t(* _exr_decode_pipeline::read_fn)(struct _exr_decode_pipeline *pipeline)

Function chosen to read chunk data from the context.

Initialized to a default generic read routine, may be updated based on channel information when exr_decoding_choose_default_routines() is called. This is done such that if the file is uncompressed and the output channel data is planar and the same type, the read function can read straight into the output channels, getting closer to a zero-copy operation. Otherwise a more traditional read, decompress, then unpack pipeline will be used with a default reader.

This is allowed to be overridden, but probably is not necessary in most scenarios.

Definition at line 223 of file openexr_decode.h.

exr_result_t(* _exr_decode_pipeline::realloc_nonimage_data_fn)(struct _exr_decode_pipeline *pipeline)

Function which can be provided if you have bespoke handling for non-image data and need to re-allocate the data to handle the about-to-be unpacked data.

If left NULL, will assume the memory pointed to by the channel pointers is sufficient.

Definition at line 244 of file openexr_decode.h.

size_t _exr_decode_pipeline::sample_count_alloc_size

Definition at line 163 of file openexr_decode.h.

int32_t* _exr_decode_pipeline::sample_count_table

Usable, native sample count table. Depending on the flag set above, will be decoded to either a cumulative list (n, n+m, n+m+o, ...), or an individual table (n, m, o, ...). As an optimization, if the latter individual count table is chosen, an extra int32_t will be allocated at the end of the table to contain the total count of samples, so the table will be n+1 samples in size.

Definition at line 162 of file openexr_decode.h.

size_t _exr_decode_pipeline::scratch_alloc_size_1

Used when re-using the same decode pipeline struct to know if chunk is changed size whether current buffer is large enough.

Definition at line 179 of file openexr_decode.h.

size_t _exr_decode_pipeline::scratch_alloc_size_2

Used when re-using the same decode pipeline struct to know if chunk is changed size whether current buffer is large enough.

Definition at line 195 of file openexr_decode.h.

void* _exr_decode_pipeline::scratch_buffer_1

A scratch buffer of unpacked_size for intermediate results.

If NULL, will be allocated during the run of the pipeline when needed.

If the caller wishes to take control of the buffer, simple adopt the pointer and set it to NULL here. Be cognizant of any custom allocators.

Definition at line 174 of file openexr_decode.h.

void* _exr_decode_pipeline::scratch_buffer_2

Some decompression routines may need a second scratch buffer (zlib).

If NULL, will be allocated during the run of the pipeline when needed.

If the caller wishes to take control of the buffer, simple adopt the pointer and set it to NULL here. Be cognizant of any custom allocators.

Definition at line 190 of file openexr_decode.h.

exr_result_t(* _exr_decode_pipeline::unpack_and_convert_fn)(struct _exr_decode_pipeline *pipeline)

Function chosen based on the output layout of the channels of the part to decompress data.

This will be NULL after initialization, until the user specifies a custom routine, or initializes the channel data and calls exr_decoding_choose_default_routines().

If only compressed data is desired, then leave or assign this to NULL after initialization.

Definition at line 257 of file openexr_decode.h.

size_t _exr_decode_pipeline::unpacked_alloc_size

Used when re-using the same decode pipeline struct to know if chunk is changed size whether current buffer is large enough.

Definition at line 146 of file openexr_decode.h.

void* _exr_decode_pipeline::unpacked_buffer

The decompressed buffer (unpacked_size from the chunk block info), but still packed into storage order, only needed for compressed files.

If NULL, will be allocated during the run of the pipeline when needed.

If the caller wishes to take control of the buffer, simple adopt the pointer and set it to NULL here. Be cognizant of any custom allocators.

Definition at line 141 of file openexr_decode.h.

int32_t _exr_decode_pipeline::user_line_begin_skip

How many lines of the chunk to skip filling, assumes the pointer is at the beginning of data (i.e. includes this skip so does not need to be adjusted

Definition at line 100 of file openexr_decode.h.

int32_t _exr_decode_pipeline::user_line_end_ignore

How many lines of the chunk to ignore at the end, assumes the output is meant to be N lines smaller

Definition at line 105 of file openexr_decode.h.


The documentation for this struct was generated from the following file: