summaryrefslogtreecommitdiff
path: root/libs/freeimage/src/FreeImageIO.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-26 17:38:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-26 17:38:31 +0300
commitdea9c030340e50324eba97c72a27c151bed12e1c (patch)
tree6fc156f40f52a9fc6e6b29e60001959477ee1a5e /libs/freeimage/src/FreeImageIO.h
parentc6e8f8223cab9d799593b7b2cfa22134aa9745d6 (diff)
AdvaImg:
- freeimage extracted to the separate library; - FI_INTERFACE removed, all references to it are replaced with direct calls of FreeImage_* functions; - unified project for AdvaImg
Diffstat (limited to 'libs/freeimage/src/FreeImageIO.h')
-rw-r--r--libs/freeimage/src/FreeImageIO.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/libs/freeimage/src/FreeImageIO.h b/libs/freeimage/src/FreeImageIO.h
new file mode 100644
index 0000000000..c846b5bf0a
--- /dev/null
+++ b/libs/freeimage/src/FreeImageIO.h
@@ -0,0 +1,63 @@
+// ==========================================================
+// Input/Output functions
+//
+// Design and implementation by
+// - Floris van den Berg (flvdberg@wxs.nl)
+//
+// This file is part of FreeImage 3
+//
+// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
+// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
+// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
+// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
+// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
+// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
+// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+// THIS DISCLAIMER.
+//
+// Use at your own risk!
+// ==========================================================
+
+#ifndef FREEIMAGEIO_H
+#define FREEIMAGEIO_H
+
+#ifndef FREEIMAGE_H
+#include "FreeImage.h"
+#endif
+
+// ----------------------------------------------------------
+
+FI_STRUCT (FIMEMORYHEADER) {
+ /**
+ 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 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);
+
+void SetMemoryIO(FreeImageIO *io);
+
+#endif // !FREEIMAGEIO_H