Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otImageFile Class Reference
[Image File - Class for image saving in different formats, Image File - Class for image saving in different formats]

Class for image saving in different formats.

#include <otImageFile.h>


Public Member Functions

 otImageFile ()
void init (otFILE *fs)
bool save (const char *fileName, otImage *img, int frame=-1, int quality=4)
 Save an image in several common formats.
The library recognizes the format to be used by the file name extension used.
Four different formats are recognized:
-AVI:
Common multimedia container format.
JPEG compression is used in this implementation. It is a good format for saving stacks of images.
Only 8bit image depth is allowed.
The entire stack of images is saved.
Extension used .avi
-BMP:
Common raster graphics file format.
This implementation saves without compression and only in monochrome.
It takes up a lot of space and is very slow, not recommended.
If the image to be saved is a stack, multiple files are created.
Only 8bit image depth is allowed.
Extension used .bmp
-JPEG:
Commonly used method of lossy compression for digital images.
You can choose the compression factor used is quite fast (5 images per second @ 752x480) and takes up little space.
If the image to be saved is a stack, multiple files are created.
Only 8bit image depth is allowed.
Extension used .jpg
-RAW:
It is a proprietary binary format without compression.
It is the fastest saving format and allows you to save the 16bit image.
The entire stack of images is saved.
Extension used .raw
.
avi_t * openAVI (const char *fileName, U16 width, U16 height)
void addFrameAVI (struct avi_t *avi, const U8 *img, U32 len)
void setFrameRateAVI (struct avi_t *avi, F32 fps)
void closeAVI (struct avi_t *avi)
U32 jpegCompress (U8 *output, otImage *img, int frame=-1, int quality=4)


Constructor & Destructor Documentation

otImageFile.otImageFile (   ) 
 

Create the class


Member Function Documentation

void otImageFile.addFrameAVI (  struct avi_t *  avi,
const U8 *  img,
U32  len
) 
 

void otImageFile.closeAVI (  struct avi_t *  avi  ) 
 

void otImageFile.init (  otFILE *  fs  ) 
 

Init the class and specify the library for file system access

Parameters:
fs File system access

U32 otImageFile.jpegCompress (  U8 *  output,
otImage *  img,
int  frame = -1,
int  quality = 4
) 
 

Parameters:
output Output buffer
img Image container to be compressed
frame Only selected frame will be saved. If set to -1 all image stack will be saved.
quality Compression factor for AVI and JPEG file format, 1= Lowest quality, 8 = Highest
Returns:
Dimension of compressed data

struct avi_t* otImageFile.openAVI (  const char *  fileName,
U16  width,
U16  height
) 
 

bool otImageFile.save (  const char *  fileName,
otImage *  img,
int  frame = -1,
int  quality = 4
) 
 

Parameters:
fileName File path name where the image(s) will be saved
img Image container to be save
frame Only selected frame will be saved. If set to -1 all image stack will be saved.
quality Compression factor for AVI and JPEG file format, 1= Lowest quality, 8 = Highest
Returns:
True on success

void otImageFile.setFrameRateAVI (  struct avi_t *  avi,
F32  fps
) 
 


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0