summaryrefslogtreecommitdiff
path: root/apps/include/tiff.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-20 23:10:25 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-20 23:10:25 +0000
commitdfa9ad91efa32959ed7b5c971aa6181a1704455d (patch)
treefa3777e1ff36e7e438f9bc8cc16d0b3f724cccec /apps/include/tiff.h
parent0e69fff93f13982c5f90a88050bcbd8bd1e0b2d7 (diff)
downloadnuttx-dfa9ad91efa32959ed7b5c971aa6181a1704455d.tar.gz
nuttx-dfa9ad91efa32959ed7b5c971aa6181a1704455d.tar.bz2
nuttx-dfa9ad91efa32959ed7b5c971aa6181a1704455d.zip
More TIFF logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3965 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/include/tiff.h')
-rw-r--r--apps/include/tiff.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/include/tiff.h b/apps/include/tiff.h
index 96d2241c9..9fa9a434a 100644
--- a/apps/include/tiff.h
+++ b/apps/include/tiff.h
@@ -232,6 +232,7 @@ struct tiff_header_s
uint8_t magic[2]; /* 2-3: 42 in appropriate byte order */
uint8_t offset[4]; /* 4-7: Offset to the first IFD */
};
+#define SIZEOF_TIFF_HEADER 8
/* "An Image File Directory (IFD) consists of a 2-byte count of the number
* of directory entries (i.e., the number of fields), followed by a sequence
@@ -248,6 +249,7 @@ struct tiff_ifdentry_s
uint8_t count[4]; /* 4-7: The number of values of the indicated type */
uint8_t offset[4]; /* 8-11: The Value Offset (or the value itself) */
};
+#define SIZEOF_IFD_ENTRY 12
/************************************************************************************/
/* Structures needed to interface with the TIFF file creation library )and also
@@ -281,6 +283,12 @@ struct tiff_info_s
FAR const char *tmpfile1; /* Full path to first temporary file */
FAR const char *tmpfile2; /* Full path to second temporary file */
+ uint8_t pmi; /* PhotometricInterpretation, See TAG_PMI_* definitions */
+ uint8_t bps; /* BitsPerSample, Greyscale bits per sample (4 or 8) */
+ nxgl_coord_t rps; /* RowsPerStrip */
+ nxgl_coord_t imgwidth; /* Number of columns in the image */
+ nxgl_coord_t imgheight; /* Number of rows in the image */
+
/* The second set of fields are used only internally by the TIFF file
* creation logic. These fields must be set to zero initially by the
* caller of tiff_initialize(). User logic should not depend upon any
@@ -335,20 +343,19 @@ EXTERN int tiff_initialize(FAR struct tiff_info_s *info);
* Name: tiff_addstrip
*
* Description:
- * Add an image data strip.
+ * Add an image data strip. The size of the strip in pixels must be equal to
+ * the RowsPerStrip x ImageWidth values that were provided to tiff_initialize().
*
* Input Parameters:
* info - A pointer to the caller allocated parameter passing/TIFF state instance.
* buffer - A buffer containing a single row of data.
- * npixels - The number of pixels (not necessarily bytes) in the row of data.
*
* Returned Value:
* Zero (OK) on success. A negated errno value on failure.
*
************************************************************************************/
-EXTERN int tiff_addstrip(FAR struct tiff_info_s *info, FAR uint8_t *buffer,
- nxgl_coord_t npixels);
+EXTERN int tiff_addstrip(FAR struct tiff_info_s *info, FAR uint8_t *strip);
/************************************************************************************
* Name: tiff_finalize