Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/tiff.c')
-rw-r--r--source/blender/imbuf/intern/tiff.c62
1 files changed, 41 insertions, 21 deletions
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 9d5d7f58335..0c235445920 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -57,9 +57,10 @@
# include "utfconv.h"
#endif
-/***********************
- * Local declarations. *
- ***********************/
+/* -------------------------------------------------------------------- */
+/** \name Local Declarations
+ * \{ */
+
/* Reading and writing of an in-memory TIFF file. */
static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n);
static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n);
@@ -69,17 +70,22 @@ static toff_t imb_tiff_SizeProc(thandle_t handle);
static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t *pbase, toff_t *psize);
static void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size);
-/* Structure for in-memory TIFF file. */
+/** Structure for in-memory TIFF file. */
typedef struct ImbTIFFMemFile {
- const unsigned char *mem; /* Location of first byte of TIFF file. */
- toff_t offset; /* Current offset within the file. */
- tsize_t size; /* Size of the TIFF file. */
+ /** Location of first byte of TIFF file. */
+ const unsigned char *mem;
+ /** Current offset within the file. */
+ toff_t offset;
+ /** Size of the TIFF file. */
+ tsize_t size;
} ImbTIFFMemFile;
#define IMB_TIFF_GET_MEMFILE(x) ((ImbTIFFMemFile *)(x))
-/*****************************
- * Function implementations. *
- *****************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Function Implementations
+ * \{ */
static void imb_tiff_DummyUnmapProc(
thandle_t fd,
@@ -111,8 +117,8 @@ static int imb_tiff_DummyMapProc(
* Reads data from an in-memory TIFF file.
*
* \param handle: Handle of the TIFF file (pointer to #ImbTIFFMemFile).
- * \param data: Buffer to contain data (treat as (void *)).
- * \param n: Number of bytes to read.
+ * \param data: Buffer to contain data (treat as (void *)).
+ * \param n: Number of bytes to read.
*
* \return: Number of bytes actually read.
* 0 = EOF.
@@ -174,8 +180,8 @@ static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n)
/**
* Seeks to a new location in an in-memory TIFF file.
*
- * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
- * \param ofs: Offset value (interpreted according to whence below).
+ * \param handle: Handle of the TIFF file (pointer to #ImbTIFFMemFile).
+ * \param ofs: Offset value (interpreted according to whence below).
* \param whence: This can be one of three values:
* SEEK_SET - The offset is set to ofs bytes.
* SEEK_CUR - The offset is set to its current location plus ofs bytes.
@@ -226,7 +232,7 @@ static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence)
* are made to access the file after that point. However, no such
* attempts should ever be made (in theory).
*
- * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
+ * \param handle: Handle of the TIFF file (pointer to #ImbTIFFMemFile).
*
* \return: 0
*/
@@ -288,6 +294,12 @@ static TIFF *imb_tiff_client_open(ImbTIFFMemFile *memFile, const unsigned char *
imb_tiff_DummyUnmapProc);
}
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Load TIFF
+ * \{ */
+
/**
* Checks whether a given memory buffer contains a TIFF file.
*
@@ -539,10 +551,10 @@ void imb_inittiff(void)
/**
* Loads a TIFF file.
- * \param mem: Memory containing the TIFF file.
- * \param size: Size of the mem buffer.
+ * \param mem: Memory containing the TIFF file.
+ * \param size: Size of the mem buffer.
* \param flags: If flags has IB_test set then the file is not actually loaded,
- * but all other operations take place.
+ * but all other operations take place.
*
* \return: A newly allocated ImBuf structure if successful, otherwise NULL.
*/
@@ -726,17 +738,23 @@ void imb_loadtiletiff(
TIFFClose(image);
}
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Save TIFF
+ * \{ */
+
/**
* Saves a TIFF file.
*
- * ImBuf structures with 1, 3 or 4 bytes per pixel (GRAY, RGB, RGBA
+ * #ImBuf structures with 1, 3 or 4 bytes per pixel (GRAY, RGB, RGBA
* respectively) are accepted, and interpreted correctly. Note that the TIFF
* convention is to use pre-multiplied alpha, which can be achieved within
* Blender by setting "Premul" alpha handling. Other alpha conventions are
* not strictly correct, but are permitted anyhow.
*
- * \param ibuf: Image buffer.
- * \param name: Name of the TIFF file to create.
+ * \param ibuf: Image buffer.
+ * \param name: Name of the TIFF file to create.
* \param flags: Currently largely ignored.
*
* \return: 1 if the function is successful, 0 on failure.
@@ -958,3 +976,5 @@ int imb_savetiff(ImBuf *ibuf, const char *filepath, int flags)
}
return 1;
}
+
+/** \} */