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
31typedef 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
50extern "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
64dlldir int IoCreateAVIGray(void **AviRef, const char *filename,int width,int height,double fps);
68dlldir int IoCreateAVIGrayW(void **AviRef, const LPCWSTR filename,int width,int height,double fps);
72dlldir int IoCreateAVIColor(void **AviRef, const char *filename,int width,int height,double fps);
76dlldir int IoCreateAVIColorW(void **AviRef, const LPCWSTR filename,int width,int height,double fps);
80dlldir int IoWriteAVIPicture(void *AviRef,int PicNr,const void *buffer);
84dlldir int IoReadAVIPicture(void *AviRef,int PicNr,void *buffer);
88dlldir int IoCloseAVI(void *AviRef);
92dlldir int IoOpenAVI(void **AviRef, const char *fileName,int* width,int* height,int *bitDepth);
93
107dlldir size_t IoCalculateBufferSize(int width, int height, int bits);
108
125dlldir void *IoReadBmp(const char *filename,unsigned char **data,int *width,int *height,int *bits);
129dlldir int IoCloseBmp(void *bmpHandle);
133dlldir int IoWriteBmp(const char *filename, unsigned char *data, int width, int height, int bits);
137dlldir int IoWriteBmpW(const LPCWSTR filename,unsigned char *data,int width,int height,int bits);
138
139dlldir int IoWriteRaw(const char *filename, unsigned char *data, int width, int height, int bits);
140dlldir int IoWriteRawW(const LPCWSTR filename, unsigned char *data, int width, int height, int bits);
141dlldir int IoReadRaw(const char *filename, unsigned char**data, int *width, int *height, int *bits);
142dlldir int IoFreeRaw(unsigned char *data);
143
144// create a image sequence file
145dlldir 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
151dlldir int IoWriteSeqPicture(void *SeqRef,int PicNr,const void *buffer);
152#ifdef __cplusplus
153static 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
161dlldir int IoCloseSeq(void *SeqRef);
162
163// Open file with image sequence
164dlldir int IoOpenSeq(void **SeqRef, const char *pFilename, int* width, int* height, int* bitdepth, int flags);
165// get information about image sequence file
166dlldir 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
170dlldir int DEPRECATED(IoReadSeqPicture(void *SeqRef,int SeqIndex,void *buffer));
171// load next picture in sequence
172dlldir int IoReadNextSeqPicture(void *SeqRef,int* PicNr,void *buffer);
173// create an AVI file from the given range of images
174dlldir int IoSeqCreateAvi(void *SeqRef,const char* aviFilename,int StartSeqIndex,int StopSeqIndex);
175
176
188dlldir int IoWriteTiff(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel);
189
208dlldir int IoWriteTiffEx(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int RGBSequence);
209
210
226dlldir int IoWriteTiffW(const LPCWSTR filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel);
227
228
245dlldir int IoWriteTiffExW(const LPCWSTR filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int RGBSequence);
246
247
261dlldir void *IoReadTiff(const char *filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel);
262
276dlldir void *IoReadTiffW(const LPCWSTR filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel);
277
296dlldir void *IoReadTiffEx(const char *filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel, int RGBSequence);
297
303dlldir void *IoReadTiffExW(const LPCWSTR filename, unsigned char**data, int *width, int *height, int *bitPerSample, int *samplePerPixel, int RGBSequence);
304
309dlldir int IoFreeTiff(unsigned char *data);
310
311dlldir 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
317#else /* __cplusplus */
318typedef struct SisoIoImageEngine_s SisoIoImageEngine;
319#endif /* __cplusplus */
320#else /* SISOIO_STRICT_POINTER */
321typedef void SisoIoImageEngine;
322#endif /* SISOIO_STRICT_POINTER */
323
348dlldir SisoIoImageEngine *IoOpenImage(const char *filename);
349
386dlldir SisoIoImageEngine *IoOpenImageExt(const char *filename, unsigned char **data, int *width, int *height, int *bits);
387
409dlldir int IoImageOpen(const char *filename, SisoIoImageEngine **handle);
410
417dlldir int IoImageOpenEx(const char *filename, SisoIoImageEngine **handle, int RGBSequence);
418
446dlldir int IoSaveImageExt(const char *filename, void *data, int width, int height, int bits);
447
455
462dlldir const void *IoImageGetData(const SisoIoImageEngine *handle);
463
464#ifdef __cplusplus
465}
466#endif /* __cplusplus */
467
468#endif /* _SISOIO_H */
Definitions for platform dependent types.
dlldir int IoGetBitsPerComponent(const SisoIoImageEngine *handle)
dlldir int IoCreateAVIColorW(void **AviRef, const LPCWSTR filename, int width, int height, double fps)
dlldir int IoWriteRawW(const LPCWSTR filename, unsigned char *data, int width, int height, int bits)
dlldir int IoCloseBmp(void *bmpHandle)
dlldir int IoCreateSeq(void **SeqRef, const char *pFilename, int width, int height, int bitdepth, int flags)
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)
#define dlldir
Definition sisoIo.h:57
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 IoReadAVIPicture(void *AviRef, int PicNr, void *buffer)
dlldir int IoCloseSeq(void *SeqRef)
dlldir int IoSeqCreateAvi(void *SeqRef, const char *aviFilename, int StartSeqIndex, int StopSeqIndex)
dlldir int IoOpenAVI(void **AviRef, const char *fileName, int *width, int *height, int *bitDepth)
dlldir SisoIoImageEngine * IoOpenImageExt(const char *filename, unsigned char **data, int *width, int *height, int *bits)
open an existing image file
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 IoGetHeight(const SisoIoImageEngine *handle)
dlldir int IoWriteSeqPicture(void *SeqRef, int PicNr, const void *buffer)
dlldir int IoFreeRaw(unsigned char *data)
dlldir int IoWriteRaw(const char *filename, unsigned char *data, int width, int height, int bits)
void SisoIoImageEngine
Definition sisoIo.h:321
dlldir int IoGetSeqInfo(void *SeqRef, int *nrOfImages, int *nrOfLostImages)
dlldir int IoWriteBmp(const char *filename, unsigned char *data, int width, int height, int bits)
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 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 IoOpenSeq(void **SeqRef, const char *pFilename, int *width, int *height, int *bitdepth, int flags)
dlldir void * IoReadTiffW(const LPCWSTR filename, unsigned char **data, int *width, int *height, int *bitPerSample, int *samplePerPixel)
Load a TIF file into a buffer,.
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.
dlldir int IoReadNextSeqPicture(void *SeqRef, int *PicNr, void *buffer)
dlldir int IoCloseAVI(void *AviRef)
dlldir int IoWriteAVIPicture(void *AviRef, int PicNr, const void *buffer)
dlldir const void * IoImageGetData(const SisoIoImageEngine *handle)
query the pixel data from an image. The channel order for color images is BLUE GREEN RED.
dlldir int IoReadRaw(const char *filename, unsigned char **data, int *width, int *height, int *bits)
dlldir int IoImageOpenEx(const char *filename, SisoIoImageEngine **handle, int RGBSequence)
open an existing image file
#define IoWriteNextSeqPicture(SeqRef, SeqIndex, Buffer)
Definition sisoIo.h:158
dlldir int IoConvert1BitTo8BitData(SisoIoImageEngine *handle)
converts a bitmap in an 8 bit gray image. It normalizes the gray values.
dlldir int DEPRECATED(IoReadSeqPicture(void *SeqRef, int SeqIndex, void *buffer))
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 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 int IoWriteTiffCompression(const char *filename, unsigned char *data, int width, int height, int bitPerSample, int samplePerPixel, int compressionFlag)
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 IoGetNrOfComponents(const SisoIoImageEngine *handle)
dlldir int IoCreateAVIColor(void **AviRef, const char *filename, int width, int height, double fps)
dlldir int IoCreateAVIGrayW(void **AviRef, const LPCWSTR filename, int width, int height, double fps)
dlldir int IoImageOpen(const char *filename, SisoIoImageEngine **handle)
open an existing image file. The channel order for color images is BLUE GREEN RED....
dlldir int IoFreeTiff(unsigned char *data)
Release the memory resources of previously read image files.
char * LPCWSTR
Definition sisoIo.h:31
dlldir int IoFreeImage(SisoIoImageEngine *handle)
dlldir int IoGetWidth(const SisoIoImageEngine *handle)
dlldir int IoGetBitsPerPixel(const SisoIoImageEngine *handle)
dlldir SisoIoImageEngine * IoOpenImage(const char *filename)
open an existing image file
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 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 ...