Silicon Software Logo

sisoIo.h Source File

sisoIo.h
Go to the documentation of this file.
1 
21 #ifndef _SISOIO_H
22 #define _SISOIO_H
23 
24 #include "os_type.h"
25 #include "os_funcs.h"
26 
27 #ifdef _WIN32
28 #include <stdio.h>
29 #include <vfw.h>
30 #else
31 typedef char* LPCWSTR;
32 #endif
33 
34 #define COMPRESSION_NONE 1 // dump mode
35 #define COMPRESSION_CCITTRLE 2 // CCITT modified Huffman RLE
36 #define COMPRESSION_CCITTFAX3 3 // CCITT Group 3 fax encoding
37 #define COMPRESSION_CCITT_T4 3 // CCITT T.4 (TIFF 6 name)
38 #define COMPRESSION_CCITTFAX4 4 // CCITT Group 4 fax encoding
39 #define COMPRESSION_CCITT_T6 4 // CCITT T.6 (TIFF 6 name)
40 #define COMPRESSION_LZW 5 // Lempel-Ziv & Welch
41 #define COMPRESSION_OJPEG 6 // !6.0 JPEG
42 #define COMPRESSION_JPEG 7 // %JPEG DCT compression
43 #define COMPRESSION_NEXT 32766 // NeXT 2-bit RLE
44 #define COMPRESSION_CCITTRLEW 32771 // #1 w/ word alignment
45 #define COMPRESSION_PACKBITS 32773 // Macintosh RLE
46 #define COMPRESSION_THUNDERSCAN 32809 // ThunderScan RLE
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif /* __cplusplus */
52 
53 #ifdef IMP_DLL
54 #define dlldir __declspec( dllimport)
55 #else
56 #ifndef dlldir
57 #define dlldir
58 #endif
59 #endif
60 
64 dlldir int IoCreateAVIGray(void **AviRef, const char *filename,int width,int height,double fps);
68 dlldir int IoCreateAVIGrayW(void **AviRef, const LPCWSTR filename,int width,int height,double fps);
72 dlldir int IoCreateAVIColor(void **AviRef, const char *filename,int width,int height,double fps);
76 dlldir int IoCreateAVIColorW(void **AviRef, const LPCWSTR filename,int width,int height,double fps);
80 dlldir int IoWriteAVIPicture(void *AviRef,int PicNr,const void *buffer);
84 dlldir int IoReadAVIPicture(void *AviRef,int PicNr,void *buffer);
88 dlldir int IoCloseAVI(void *AviRef);
92 dlldir int IoOpenAVI(void **AviRef, const char *fileName,int* width,int* height,int *bitDepth);
93 
107 dlldir size_t IoCalculateBufferSize(int width, int height, int bits);
108 
125 dlldir void *IoReadBmp(const char *filename,unsigned char **data,int *width,int *height,int *bits);
129 dlldir int IoCloseBmp(void *bmpHandle);
133 dlldir int IoWriteBmp(const char *filename, unsigned char *data, int width, int height, int bits);
137 dlldir int IoWriteBmpW(const LPCWSTR filename,unsigned char *data,int width,int height,int bits);
138 
139 dlldir int IoWriteRaw(const char *filename, unsigned char *data, int width, int height, int bits);
140 dlldir int IoWriteRawW(const LPCWSTR filename, unsigned char *data, int width, int height, int bits);
141 dlldir int IoReadRaw(const char *filename, unsigned char**data, int *width, int *height, int *bits);
142 dlldir int IoFreeRaw(unsigned char *data);
143 
144 // create a image sequence file
145 dlldir int IoCreateSeq(void **SeqRef, const char *pFilename, int width, int height, int bitdepth, int flags);
146 // append the given image to the end of the file and assign it a picture number
147 // NOTE: this function does not work as advertised by older Runtimes
148 // it writes a new image to the file and assigns it a picture number
149 // it will not write the image at a given sequence index in the file (there is no way to provide a sequence index)
150 // the correct name for the function would be IoWriteNextSeqPicture; a wrapper for this is provided
151 dlldir int IoWriteSeqPicture(void *SeqRef,int PicNr,const void *buffer);
152 #ifdef __cplusplus
153 static inline int IoWriteNextSeqPicture(void *SeqRef, int PicNr, const void *buffer)
154 {
155  return IoWriteSeqPicture(SeqRef, PicNr, buffer);
156 }
157 #else
158 #define IoWriteNextSeqPicture(SeqRef,SeqIndex,Buffer) IoWriteSeqPicture(SeqRef, SeqIndex, Buffer)
159 #endif
160 // close image sequence file
161 dlldir int IoCloseSeq(void *SeqRef);
162 
163 // Open file with image sequence
164 dlldir int IoOpenSeq(void **SeqRef, const char *pFilename, int* width, int* height, int* bitdepth, int flags);
165 // get information about image sequence file
166 dlldir int IoGetSeqInfo(void *SeqRef,int *nrOfImages,int *nrOfLostImages);
167 // load the image at the sequence index
168 // NOTE: there is no way to access the picture number for the image
169 // use IoReadNextSeqPicture instead
170 dlldir int DEPRECATED(IoReadSeqPicture(void *SeqRef,int SeqIndex,void *buffer));
171 // load next picture in sequence
172 dlldir int IoReadNextSeqPicture(void *SeqRef,int* PicNr,void *buffer);
173 // create an AVI file from the given range of images
174 dlldir int IoSeqCreateAvi(void *SeqRef,const char* aviFilename,int StartSeqIndex,int StopSeqIndex);
175 
176 
188 dlldir int IoWriteTiff(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel);
189 
208 dlldir int IoWriteTiffEx(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int RGBSequence);
209 
210 
226 dlldir int IoWriteTiffW(const LPCWSTR filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel);
227 
228 
245 dlldir int IoWriteTiffExW(const LPCWSTR filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int RGBSequence);
246 
247 
261 dlldir void *IoReadTiff(const char *filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel);
262 
276 dlldir void *IoReadTiffW(const LPCWSTR filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel);
277 
296 dlldir void *IoReadTiffEx(const char *filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel, int RGBSequence);
297 
303 dlldir void *IoReadTiffExW(const LPCWSTR filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel, int RGBSequence);
304 
309 dlldir int IoFreeTiff(unsigned char *data);
310 
311 dlldir int IoWriteTiffCompression(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int compressionFlag);
312 
313 // -------------------------------------------------------------------
314 #ifdef SISOIO_STRICT_POINTER
315 #ifdef __cplusplus
316 class SisoIoImageEngine;
317 #else /* __cplusplus */
318 typedef struct SisoIoImageEngine_s SisoIoImageEngine;
319 #endif /* __cplusplus */
320 #else /* SISOIO_STRICT_POINTER */
321 typedef void SisoIoImageEngine;
322 #endif /* SISOIO_STRICT_POINTER */
323 
348 dlldir SisoIoImageEngine *IoOpenImage(const char *filename);
349 
386 dlldir SisoIoImageEngine *IoOpenImageExt(const char *filename, unsigned char **data, int *width, int *height, int *bits);
387 
411 dlldir int IoImageOpen(const char *filename, SisoIoImageEngine **handle);
412 
419 dlldir int IoImageOpenEx(const char *filename, SisoIoImageEngine **handle, int RGBSequence);
420 
422 dlldir int IoGetWidth(const SisoIoImageEngine *handle);
423 dlldir int IoGetHeight(const SisoIoImageEngine *handle);
424 dlldir int IoGetBitsPerPixel(const SisoIoImageEngine *handle);
426 dlldir int IoGetNrOfComponents(const SisoIoImageEngine *handle);
448 dlldir int IoSaveImageExt(const char *filename, void *data, int width, int height, int bits);
449 
457 
464 dlldir const void *IoImageGetData(const SisoIoImageEngine *handle);
465 
466 #ifdef __cplusplus
467 }
468 #endif /* __cplusplus */
469 
470 #endif /* _SISOIO_H */
dlldir int IoWriteRaw(const char *filename, unsigned char *data, int width, int height, int bits)
dlldir int IoWriteTiffW(const LPCWSTR filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel)
Save Image data to to a file in TIF format.
dlldir SisoIoImageEngine * IoOpenImage(const char *filename)
open an existing image file
dlldir int IoSeqCreateAvi(void *SeqRef, const char *aviFilename, int StartSeqIndex, int StopSeqIndex)
dlldir int IoSaveImageExt(const char *filename, void *data, int width, int height, int bits)
save image to File. The channel order for color images is RED GREEN BLUE. Supported file formats:
dlldir int IoOpenAVI(void **AviRef, const char *fileName, int *width, int *height, int *bitDepth)
dlldir int IoReadNextSeqPicture(void *SeqRef, int *PicNr, void *buffer)
#define dlldir
Definition: sisoIo.h:57
Definitions for platform dependent types.
dlldir int DEPRECATED(IoReadSeqPicture(void *SeqRef, int SeqIndex, void *buffer))
char * LPCWSTR
Definition: sisoIo.h:31
dlldir int IoGetSeqInfo(void *SeqRef, int *nrOfImages, int *nrOfLostImages)
dlldir int IoGetNrOfComponents(const SisoIoImageEngine *handle)
dlldir void * IoReadTiffW(const LPCWSTR filename, unsigned char **data, int *width, int *height, int *bitPerSample, int *samplePerPixel)
Load a TIF file into a buffer,.
void SisoIoImageEngine
Definition: sisoIo.h:321
dlldir size_t IoCalculateBufferSize(int width, int height, int bits)
Calculate the buffer size according to the bit depth This function will return the buffer size for a ...
dlldir int IoReadAVIPicture(void *AviRef, int PicNr, void *buffer)
dlldir int IoWriteSeqPicture(void *SeqRef, int PicNr, const void *buffer)
dlldir int IoOpenSeq(void **SeqRef, const char *pFilename, int *width, int *height, int *bitdepth, int flags)
dlldir int IoFreeImage(SisoIoImageEngine *handle)
dlldir int IoCreateAVIColorW(void **AviRef, const LPCWSTR filename, int width, int height, double fps)
dlldir int IoCloseSeq(void *SeqRef)
dlldir int IoReadRaw(const char *filename, unsigned char **data, int *width, int *height, int *bits)
dlldir int IoCreateSeq(void **SeqRef, const char *pFilename, int width, int height, int bitdepth, int flags)
dlldir int IoWriteAVIPicture(void *AviRef, int PicNr, const void *buffer)
dlldir int IoWriteBmp(const char *filename, unsigned char *data, int width, int height, int bits)
dlldir int IoGetHeight(const SisoIoImageEngine *handle)
dlldir void * IoReadTiffEx(const char *filename, unsigned char **data, int *width, int *height, int *bitPerSample, int *samplePerPixel, int RGBSequence)
Load a TIF file into a memory buffer (enhanced version).
dlldir void * IoReadTiffExW(const LPCWSTR filename, unsigned char **data, int *width, int *height, int *bitPerSample, int *samplePerPixel, int RGBSequence)
Load a TIF file into a memory buffer.
dlldir int IoWriteTiffCompression(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int compressionFlag)
dlldir int IoGetBitsPerComponent(const SisoIoImageEngine *handle)
dlldir void * IoReadTiff(const char *filename, unsigned char **data, int *width, int *height, int *bitPerSample, int *samplePerPixel)
Load a TIF file into a memory buffer.
dlldir int IoImageOpenEx(const char *filename, SisoIoImageEngine **handle, int RGBSequence)
open an existing image file
dlldir int IoFreeTiff(unsigned char *data)
Release the memory resources of previously read image files.
dlldir void * IoReadBmp(const char *filename, unsigned char **data, int *width, int *height, int *bits)
Load data from a bitmap file to a memory buffer This functions loads the image data of a bitmap file ...
dlldir int IoConvert1BitTo8BitData(SisoIoImageEngine *handle)
converts a bitmap in an 8 bit gray image. It normalizes the gray values.
dlldir int IoCreateAVIGray(void **AviRef, const char *filename, int width, int height, double fps)
dlldir int IoWriteBmpW(const LPCWSTR filename, unsigned char *data, int width, int height, int bits)
dlldir int IoWriteRawW(const LPCWSTR filename, unsigned char *data, int width, int height, int bits)
dlldir int IoGetBitsPerPixel(const SisoIoImageEngine *handle)
dlldir int IoCloseBmp(void *bmpHandle)
dlldir int IoCloseAVI(void *AviRef)
dlldir int IoCreateAVIColor(void **AviRef, const char *filename, int width, int height, double fps)
#define IoWriteNextSeqPicture(SeqRef, SeqIndex, Buffer)
Definition: sisoIo.h:158
dlldir int IoWriteTiff(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel)
Save Image data to to a file in TIF format.
dlldir int IoCreateAVIGrayW(void **AviRef, const LPCWSTR filename, int width, int height, double fps)
dlldir int IoFreeRaw(unsigned char *data)
dlldir int IoWriteTiffExW(const LPCWSTR filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int RGBSequence)
Save Image data to to a file in TIF format.
dlldir int IoGetWidth(const SisoIoImageEngine *handle)
dlldir int IoWriteTiffEx(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int RGBSequence)
Save Image data to to a file in TIF format.
const dlldir void * IoImageGetData(const SisoIoImageEngine *handle)
query the pixel data from an image. The channel order for color images is BLUE GREEN RED.
dlldir SisoIoImageEngine * IoOpenImageExt(const char *filename, unsigned char **data, int *width, int *height, int *bits)
open an existing image file
dlldir int IoImageOpen(const char *filename, SisoIoImageEngine **handle)
open an existing image file. The channel order for color images is BLUE GREEN RED....