diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-21 21:57:11 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-21 21:57:11 +0000 |
commit | 4a6bae6e0114f9856d6b31228faf9cc14144f1f2 (patch) | |
tree | bb37c5370fdc9e6537410c34a7a876e0c5c30baf /apps/graphics/tiff/tiff_internal.h | |
parent | 5501b0d32807dca70cf0b6d4f252fa8b050751db (diff) | |
download | nuttx-4a6bae6e0114f9856d6b31228faf9cc14144f1f2.tar.gz nuttx-4a6bae6e0114f9856d6b31228faf9cc14144f1f2.tar.bz2 nuttx-4a6bae6e0114f9856d6b31228faf9cc14144f1f2.zip |
Code complete on TIFF creation logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3968 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/graphics/tiff/tiff_internal.h')
-rw-r--r-- | apps/graphics/tiff/tiff_internal.h | 89 |
1 files changed, 88 insertions, 1 deletions
diff --git a/apps/graphics/tiff/tiff_internal.h b/apps/graphics/tiff/tiff_internal.h index 5c8050601..ac14e0ad7 100644 --- a/apps/graphics/tiff/tiff_internal.h +++ b/apps/graphics/tiff/tiff_internal.h @@ -51,7 +51,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ -/* Image Type **************************************************************/ +/* Image Type ***************************************************************/ #define IMGFLAGS_BILEV_BIT (1 << 0) #define IMGFLAGS_GREY_BIT (1 << 1) @@ -97,6 +97,24 @@ extern "C" { ****************************************************************************/ /**************************************************************************** + * Name: tiff_read + * + * Description: + * Read TIFF data from the specified file + * + * Input Parameters: + * fd - Open file descriptor to read from + * buffer - Read-only buffer containing the data to be written + * count - The number of bytes to write + * + * Returned Value: + * Zero (OK) on success. A negated errno value on failure. + * + ****************************************************************************/ + +EXTERN int tiff_read(int fd, FAR void *buffer, size_t count); + +/**************************************************************************** * Name: tiff_write * * Description: @@ -114,6 +132,75 @@ extern "C" { EXTERN int tiff_write(int fd, FAR const void *buffer, size_t count); +/**************************************************************************** + * Name: tiff_putint16 + * + * Description: + * Write two bytes to the outfile. + * + * Input Parameters: + * fd - File descriptor to be used. + * value - The 2-byte, uint16_t value to write + * + * Returned Value: + * Zero (OK) on success. A negated errno value on failure. + * + ****************************************************************************/ + +EXTERN int tiff_putint16(int fd, uint16_t value); + +/**************************************************************************** + * Name: tiff_putint32 + * + * Description: + * Write four bytes to the outfile. + * + * Input Parameters: + * fd - File descriptor to be used. + * value - The 4-byte, uint32_t value to write + * + * Returned Value: + * Zero (OK) on success. A negated errno value on failure. + * + ****************************************************************************/ + +EXTERN int tiff_putint32(int fd, uint32_t value); + +/**************************************************************************** + * Name: tiff_putstring + * + * Description: + * Write a string of fixed length to the outfile. + * + * Input Parameters: + * fd - File descriptor to be used. + * string - A pointer to the memory containing the string + * len - The length of the string (including the NUL terminator) + * + * Returned Value: + * Zero (OK) on success. A negated errno value on failure. + * + ****************************************************************************/ + +EXTERN int tiff_putstring(int fd, FAR const char *string, int len); + +/**************************************************************************** + * Name: tiff_wordalign + * + * Description: + * Pad a file with zeros as necessary to achieve word alignament. + * + * Input Parameters: + * fd - File descriptor to be used. + * size - The current size of the file + * + * Returned Value: + * The new size of the file on success. A negated errno value on failure. + * + ****************************************************************************/ + +EXTERN ssize_t tiff_wordalign(int fd, size_t size); + #undef EXTERN #if defined(__cplusplus) } |