![]() |
Imaging Control 4 C Library
1.2.0
|
Contains function pointers used to configure a custom allocator for image buffers. More...
Data Fields | |
void(* | release )(void *context) |
Notifies the user that the allocator will not receive any additional callback function calls. More... | |
bool(* | allocate_buffer )(void *context, size_t buffer_size, size_t alignment, void **buffer_ptr, void **user_data) |
Requests the allocator to allocate a memory buffer. More... | |
void(* | free_buffer )(void *context, void *buffer_ptr, void *user_data) |
Requests the allocator to free a previously-allocated memory buffer. More... | |
Contains function pointers used to configure a custom allocator for image buffers.
bool(* allocate_buffer(void *context, size_t buffer_size, size_t alignment, void **buffer_ptr, void **user_data) |
Requests the allocator to allocate a memory buffer.
[in] | context | The allocator_context parameter that was passed to the sink creation function |
[in] | buffer_size | The size of the requested memory buffer |
[in] | alignment | Requests memory to be allocated on a specific alignment boundary. This value is always a power of 2. |
[out] | buffer_ptr | A pointer to a pointer that receives the address of the newly-allocated buffer |
[out] | user_data | User data to attach to the buffer. The user data is passed to free_buffer when the allocated memory is freed again. |
true
on success. If the allocation could not be performed, return false
. void(* free_buffer(void *context, void *buffer_ptr, void *user_data) |
Requests the allocator to free a previously-allocated memory buffer.
[in] | context | The allocator_context parameter that was passed to the sink creation function |
[in] | buffer_ptr | Pointer to the memory buffer to be freed |
[in] | user_data | The user data that was returned from allocate_buffer when the memory buffer was allocated |
void(* release(void *context) |
Notifies the user that the allocator will not receive any additional callback function calls.
Any resources attached to the context
parameter can be released.
[in] | context | The allocator_context parameter that was passed to the sink creation function. |
release
callback function is executed on the thread that destroys the sink using the final call to ic4_sink_unref().