From 537ce7ddb32932a2100ae767b1eca51a9dd1c35f Mon Sep 17 00:00:00 2001 From: scuri Date: Thu, 1 Oct 2009 14:14:53 +0000 Subject: New: ASCII compression for RAW format to access text data instead of binary. --- include/im_binfile.h | 10 ++++++++++ include/im_format_all.h | 2 +- include/im_format_ecw.h | 2 +- include/im_format_raw.h | 14 +++++++++++--- 4 files changed, 23 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/im_binfile.h b/include/im_binfile.h index 6bac31e..08af47a 100644 --- a/include/im_binfile.h +++ b/include/im_binfile.h @@ -73,6 +73,16 @@ unsigned long imBinFileWrite(imBinFile* bfile, void* pValues, unsigned long pCou * \ingroup binfile */ unsigned long imBinFilePrintf(imBinFile* bfile, char *format, ...); +/** Reads an integer number from the current position until found a non integer character. + * Returns a non zero value if sucessfull. + * \ingroup binfile */ +int imBinFileReadInteger(imBinFile* handle, int *value); + +/** Reads an floating point number from the current position until found a non number character. + * Returns a non zero value if sucessfull. + * \ingroup binfile */ +int imBinFileReadFloat(imBinFile* handle, float *value); + /** Moves the file pointer from the begining of the file.\n * When writing to a file seeking can go beyond the end of the file. * \ingroup binfile */ diff --git a/include/im_format_all.h b/include/im_format_all.h index bb43816..fc439d5 100644 --- a/include/im_format_all.h +++ b/include/im_format_all.h @@ -94,7 +94,7 @@ extern "C" { Tags BlackLevel, DefaultCropOrigin and DefaultCropSize are incorrectly interpreted by libTIFF so they are ignored. Raw image is loaded in place of the thumbnail image in the main IFD. SubIFDCount IM_USHORT (1) [Number of subifds of the current image.] - SubIFDSelect IM_USHORT (1) [Subifd number to be readed. Must be set before reading image info.] + SubIFDSelect IM_USHORT (1) [Subifd number to be read. Must be set before reading image info.] (other attributes can be obtained by using libTIFF directly using the Handle(1) function) Comments: diff --git a/include/im_format_ecw.h b/include/im_format_ecw.h index 701bac3..c9e91a3 100644 --- a/include/im_format_ecw.h +++ b/include/im_format_ecw.h @@ -76,7 +76,7 @@ extern "C" { Only read support is implemented. To read a region of the image you must set the View* attributes before reading the image data. After reading a partial image the width and height returned in ReadImageInfo is the view size. - The view limits define the region to be readed. + The view limits define the region to be read. The view size is the actual size of the image, so the result can be zoomed. \endverbatim * \ingroup format */ diff --git a/include/im_format_raw.h b/include/im_format_raw.h index 80a8203..4600271 100644 --- a/include/im_format_raw.h +++ b/include/im_format_raw.h @@ -22,9 +22,10 @@ extern "C" { * \par * Internal Implementation. * \par - * Supports RAW binary images. This is a unstructured and uncompressed binary data. + * Supports RAW binary images. This is an unstructured and uncompressed binary data. * It is NOT a Camera RAW file generated in many professional digital cameras. \n - * You must know image parameters a priori and must set the IM_INT attributes "Width", "Height", "ColorMode", "DataType" before the imFileReadImageInfo/imFileWriteImageInfo functions. + * You must know image parameters a priori and must set the IM_INT attributes "Width", "Height", "ColorMode", "DataType" + * before the imFileReadImageInfo/imFileWriteImageInfo functions. * \par * The data must be in binary form, but can start in an arbitrary offset from the begining of the file, use attribute "StartOffset". * The default is at 0 offset. @@ -36,6 +37,9 @@ extern "C" { * \par * The lines can be aligned to a BYTE (1), WORD (2) or DWORD (4) boundaries, ue attribute "Padding" with the respective value. * \par + * If the compression is ASCII the data is stored in textual format, instead of binary. + * In this case SwitchType and ByteOrder are ignored, and Padding should be 0. + * \par * See \ref im_raw.h * * \section Features @@ -44,7 +48,8 @@ extern "C" { Data Types: Color Spaces: all, except MAP. Compressions: - NONE - no compression + NONE - no compression [default] + ASCII (textual data) Can have more than one image, depends on "StartOffset" attribute. Can have an alpha channel. Components can be packed or not. @@ -53,6 +58,9 @@ extern "C" { Attributes: Width, Height, ColorMode, DataType IM_INT (1) ImageCount[1], StartOffset[0], SwitchType[FALSE], ByteOrder[IM_LITTLEENDIAN], Padding[0] IM_INT (1) + + Comments: + In fact ASCII is an expansion, not a compression, because the file will be larger than binary data. \endverbatim * \ingroup format */ imFormat* imFormatInitRAW(void); -- cgit v1.2.3