6 #ifndef OPENEXR_CONTEXT_H
7 #define OPENEXR_CONTEXT_H
62 exr_const_context_t ctxt,
exr_result_t code,
const char* fmt, ...)
75 exr_const_context_t ctxt,
exr_result_t code,
const char* msg);
89 exr_const_context_t ctxt,
void* userdata,
int failed);
102 exr_const_context_t ctxt,
void* userdata);
130 exr_const_context_t ctxt,
162 exr_const_context_t ctxt,
330 #define EXR_CONTEXT_FLAG_STRICT_HEADER (1 << 0)
337 #define EXR_CONTEXT_FLAG_SILENT_HEADER_PARSE (1 << 1)
345 #define EXR_CONTEXT_FLAG_DISABLE_CHUNK_RECONSTRUCTION (1 << 2)
348 #define EXR_CONTEXT_FLAG_WRITE_LEGACY_HEADER (1 << 3)
352 #define EXR_DEFAULT_CONTEXT_INITIALIZER \
353 { sizeof (exr_context_initializer_t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -1.f, 0, { 0, 0, 0, 0 } }
511 void (*destroy_unpacked_func_ptr) (
512 exr_context_t ctxt,
void* data, int32_t datasize));
EXR_EXPORT exr_result_t exr_start_write(exr_context_t *ctxt, const char *filename, exr_default_write_mode_t default_mode, const exr_context_initializer_t *ctxtdata)
Create and initialize a write-only context.
void(* exr_memory_free_func_t)(void *ptr)
Function pointer used to hold a free-like routine.
GT_API const UT_StringHolder filename
exr_query_size_func_ptr_t size_fn
Custom size query routine.
exr_default_write_mode
Enum describing how default files are handled during write.
Struct used to pass function pointers into the context initialization routines.
size_t size
Size member to tag initializer for version stability.
int64_t(* exr_write_func_ptr_t)(exr_const_context_t ctxt, void *userdata, const void *buffer, uint64_t sz, uint64_t offset, exr_stream_error_func_ptr_t error_cb)
EXR_EXPORT exr_result_t exr_start_inplace_header_update(exr_context_t *ctxt, const char *filename, const exr_context_initializer_t *ctxtdata)
Create a new context for updating an exr file in place.
exr_error_handler_cb_t error_handler_fn
Error callback function pointer.
exr_destroy_stream_func_ptr_t destroy_fn
Optional function to destroy the user data block of a custom stream.
exr_read_func_ptr_t read_fn
Custom read routine.
const struct _priv_exr_context_t * exr_const_context_t
struct _exr_context_initializer_v3 exr_context_initializer_t
Struct used to pass function pointers into the context initialization routines.
exr_memory_free_func_t free_fn
int64_t(* exr_read_func_ptr_t)(exr_const_context_t ctxt, void *userdata, void *buffer, uint64_t sz, uint64_t offset, exr_stream_error_func_ptr_t error_cb)
Read custom function pointer.
exr_result_t(* exr_stream_error_func_ptr_t)(exr_const_context_t ctxt, exr_result_t code, const char *fmt,...) EXR_PRINTF_FUNC_ATTRIBUTE
Stream error notifier.
EXR_EXPORT exr_result_t exr_start_read(exr_context_t *ctxt, const char *filename, const exr_context_initializer_t *ctxtdata)
Create and initialize a read-only exr read context.
EXR_EXPORT exr_result_t exr_get_user_data(exr_const_context_t ctxt, void **userdata)
Query the user data the context was constructed with. This is perhaps useful in the error handler cal...
void(* exr_error_handler_cb_t)(exr_const_context_t ctxt, exr_result_t code, const char *msg)
Error callback function.
struct _priv_exr_context_t * exr_context_t
EXR_EXPORT exr_result_t exr_get_file_name(exr_const_context_t ctxt, const char **name)
Retrieve the file name the context is for as provided during the start routine.
GLuint const GLchar * name
void(* exr_destroy_stream_func_ptr_t)(exr_const_context_t ctxt, void *userdata, int failed)
exr_memory_allocation_func_t alloc_fn
#define EXR_PRINTF_FUNC_ATTRIBUTE
EXR_EXPORT exr_result_t exr_finish(exr_context_t *ctxt)
Close and free any internally allocated memory, calling any provided destroy function for custom stre...
enum exr_default_write_mode exr_default_write_mode_t
Enum describing how default files are handled during write.
void *(* exr_memory_allocation_func_t)(size_t bytes)
Function pointer used to hold a malloc-like routine.
int64_t(* exr_query_size_func_ptr_t)(exr_const_context_t ctxt, void *userdata)
EXR_EXPORT exr_result_t exr_write_header(exr_context_t ctxt)
Write the header data.
EXR_EXPORT exr_result_t exr_test_file_header(const char *filename, const exr_context_initializer_t *ctxtdata)
Check the magic number of the file and report EXR_ERR_SUCCESS if the file appears to be a valid file ...
EXR_EXPORT exr_result_t exr_register_attr_type_handler(exr_context_t ctxt, const char *type, exr_result_t(*unpack_func_ptr)(exr_context_t ctxt, const void *data, int32_tattrsize, int32_t *outsize, void **outbuffer), exr_result_t(*pack_func_ptr)(exr_context_t ctxt, const void *data, int32_tdatasize, int32_t *outsize, void *outbuffer), void(*destroy_unpacked_func_ptr)(exr_context_t ctxt, void *data, int32_t datasize))
EXR_EXPORT exr_result_t exr_set_longname_support(exr_context_t ctxt, int onoff)
Enable long name support in the output context.
exr_write_func_ptr_t write_fn
Custom write routine.