diff options
Diffstat (limited to 'plugins/AdvaImg/src/FreeImageIO.h')
-rw-r--r-- | plugins/AdvaImg/src/FreeImageIO.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/plugins/AdvaImg/src/FreeImageIO.h b/plugins/AdvaImg/src/FreeImageIO.h index b251d474f6..c846b5bf0a 100644 --- a/plugins/AdvaImg/src/FreeImageIO.h +++ b/plugins/AdvaImg/src/FreeImageIO.h @@ -29,16 +29,31 @@ // ---------------------------------------------------------- FI_STRUCT (FIMEMORYHEADER) { - /// remember to delete the buffer + /** + Flag used to remember to delete the 'data' buffer. + When the buffer is a wrapped buffer, it is read-only, no need to delete it. + When the buffer is a read/write buffer, it is allocated dynamically and must be deleted when no longer needed. + */ BOOL delete_me; - /// file length - long filelen; - /// buffer size - long datalen; - /// current position - long curpos; - /// start buffer address + /** + file_length is equal to the input buffer size when the buffer is a wrapped buffer, i.e. file_length == data_length. + file_length is the amount of the written bytes when the buffer is a read/write buffer. + */ + long file_length; + /** + When using read-only input buffers, data_length is equal to the input buffer size, i.e. the file_length. + When using read/write buffers, data_length is the size of the allocated buffer, + whose size is greater than or equal to file_length. + */ + long data_length; + /** + start buffer address + */ void *data; + /** + Current position into the memory stream + */ + long current_position; }; void SetDefaultIO(FreeImageIO *io); |