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

vetCodec_IMG Class Reference

Inheritance diagram for vetCodec_IMG:

vetCodec vetInput vetOutput vetObject

Public Member Functions

 vetCodec_IMG (vetCodec_IMGParameters *initParams=NULL)
 Default constructor, initializa parameters and superclasses.
 vetCodec_IMG (char *filename)
 Creates a new frame from given dimensions, call superclass vetFrameRGB constructor.
VETRESULT save ()
 Save current buffered image to current filename, first setup current filename and format then call this function.
VETRESULT save (char *filename)
 Save current buffered image to given filename and format.
VETRESULT load ()
 Load a BMP format image into current buffer (vetFrameRGB), first setup current filename and format then call this function.
VETRESULT load (char *filename)
 Load a BMP format image into current buffer (vetFrameRGB).
VETRESULT setParameters (vetCodec_IMGParameters *initParams)
 Set parameters for (de)coding.
vetCodec_IMGParametersgetParameters ()
 Get parameters for (de)coding.
VETRESULT setFilterParameters (vetFilterParameters *initParams)
vetFilterParametersgetFilterParameters ()
bool EoF ()
 Get the state of current data source.
void setFileNameProgression (bool value)
 Enable or disable filename progression, for example: basefile name is "output", index is 13 so filename is output13.bmp, if filename progression is enabled, when an operation is done onto file, idex is incremented (output14.bmp).
void setAutoOutputEnabled (bool value=true)
 Enable or disable auto input feature,.
void setAutoInputEnabled (bool value=true)
void setDoBuffering (bool value=true)
void setFileName (const char *filename)
int getFileNameIndex ()
 Read current file name index, used in file name progression routines.
bool isFileNameProgressionEnabled ()
bool isAutoInputEnabled ()
bool isAutoOutputEnabled ()
bool isBufferingEnabled ()
void getFileName (char *filename)
 Read base filename, if progression is enabled it's the base fixed name.
void getFileNameCurrent (char *filename)
 Read current filename, if progression is enabled it's the base fixed name + current index + bmp extension.
VETRESULT reset ()
 Reset filename related setup.
VETRESULT setHeight (unsigned int value)
 read current image's width.read current image's height.Set current canvas' height.
VETRESULT setWidth (unsigned int value)
 Set current canvas' width.
long getVideoStreamLength (int stream=-1)
 Get movie's video stream frame count.
long getAudioStreamLength (int stream=-1)
 Get movie's video stream sample count.
int getAudioStreamCount ()
int getVideoStreamCount ()
bool hasAudio ()
bool hasVideo ()
VETRESULT extractTo (vetFrameYUV420 &img)
 Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.
VETRESULT extractTo (vetFrameRGB24 &img)
 Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.
VETRESULT extractTo (vetFrameT< unsigned char > &img)
 Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.
VETRESULT importFrom (vetFrameYUV420 &img)
 Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.
VETRESULT importFrom (vetFrameRGB24 &img)
 Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.
VETRESULT importFrom (vetFrameT< unsigned char > &img)
 Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.
bool isEncodingAvailable ()
 Check ability to encode data.
bool isDecodingAvailable ()
 Check ability to decode data.

Static Public Member Functions

static VETRESULT save (vetFrameYUV420 &source, const char *filename)
 Save given image to a BMP file.
static VETRESULT save (vetFrameRGB24 &source, const char *filename)
 Save given image to a BMP file.
static VETRESULT save (vetFrameT< unsigned char > &source, const char *filename)
 Save given image to a BMP file.
static VETRESULT load (vetFrameYUV420 &source, const char *filename)
 Load a BMP format image into given image.
static VETRESULT load (vetFrameRGB24 &source, const char *filename)
 Load a BMP format image into given image.
static VETRESULT load (vetFrameT< unsigned char > &source, const char *filename)
 Load a BMP format image into given image.

Protected Member Functions

void doFileNameCurrent ()

Static Protected Member Functions

static void * im_load (char *filename, unsigned int &w, unsigned int &h, char *prog_path)
static void im_get_data (void *image, int *rgb)
static void im_get_data (void *img, unsigned char *rgb)
static void im_get_data_grey (void *image, int *d)
static void im_free (void *img)

Protected Attributes

vetCodec_IMGParametersmyParams
unsigned int width
unsigned int height
void * img
bool ok
char fileNameIndexBuffer [16]
char fileNameBuffer [80]

Detailed Description

Definition at line 256 of file vetCodec_IMG.h.


Constructor & Destructor Documentation

vetCodec_IMG::vetCodec_IMG char *  filename  ) 
 

Creates a new frame from given dimensions, call superclass vetFrameRGB constructor.

Parameters:
[in] filename Input BMP filename.
[in] format BMP Encoding Format, default auto-selection.

Definition at line 151 of file vetCodec_IMG.cpp.

References DEBUGMSG, vetCodec_IMGParameters::fileNameBase, load(), myParams, reset(), and setParameters().


Member Function Documentation

bool vetCodec_IMG::EoF  )  [virtual]
 

Get the state of current data source.

Returns:
true is there are no more frames to load, false else.

Implements vetCodec.

Definition at line 210 of file vetCodec_IMG.cpp.

VETRESULT vetCodec_IMG::extractTo vetFrameT< unsigned char > &  img  )  [virtual]
 

Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.

Parameters:
[out] img Greyscale VETLib Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameT&)

AutoInput

Implements vetCodec.

Definition at line 260 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::extractTo vetFrameRGB24 img  )  [virtual]
 

Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.

Parameters:
[out] img VETLib Cache24 Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameRGB24&)

AutoInput

Implements vetCodec.

Definition at line 224 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::autoInput, vetCodec_IMGParameters::autoOuput, DEBUGMSG, vetCodec_IMGParameters::doBuffering, doFileNameCurrent(), fileNameBuffer, vetCodec_IMGParameters::fileNameIndex, vetCodec_IMGParameters::fileNameProgression, load(), myParams, and VETRET_OK.

VETRESULT vetCodec_IMG::extractTo vetFrameYUV420 img  )  [virtual]
 

Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameYUV420&)

AutoInput

Implements vetCodec.

Definition at line 216 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

long vetCodec_IMG::getAudioStreamLength int  stream = -1  )  [inline, virtual]
 

Get movie's video stream sample count.

Parameters:
[in] stream select stream, default is current stream.
Returns:
number of samples in selected video stream.

Implements vetCodec.

Definition at line 565 of file vetCodec_IMG.h.

void vetCodec_IMG::getFileName char *  filename  ) 
 

Read base filename, if progression is enabled it's the base fixed name.

Parameters:
[in] @return VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

void vetCodec_IMG::getFileNameCurrent char *  filename  ) 
 

Read current filename, if progression is enabled it's the base fixed name + current index + bmp extension.

Parameters:
[out] Char Array to store current filename [Max size 64 chars]
See also:
fileNameBase

Definition at line 344 of file vetCodec_IMG.cpp.

References doFileNameCurrent(), and fileNameBuffer.

int vetCodec_IMG::getFileNameIndex  ) 
 

Read current file name index, used in file name progression routines.

Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 626 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::fileNameIndex, and myParams.

vetCodec_IMGParameters& vetCodec_IMG::getParameters  )  [inline]
 

Get parameters for (de)coding.

Returns:
pointer to vetCodec_MOVParameters class.

Definition at line 361 of file vetCodec_IMG.h.

References myParams.

long vetCodec_IMG::getVideoStreamLength int  stream = -1  )  [inline, virtual]
 

Get movie's video stream frame count.

Parameters:
[in] stream select stream, default is current stream.
Returns:
number of frames in selected video stream.

Implements vetCodec.

Definition at line 564 of file vetCodec_IMG.h.

VETRESULT vetCodec_IMG::importFrom vetFrameT< unsigned char > &  img  )  [virtual]
 

Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.

Parameters:
[in] img Greyscale VETLib Frame to be processed (encoded for example)
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Input operator (<<) call directly this function.
See also:
operator << (vetFrameT&)

Implements vetCodec.

Definition at line 312 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::importFrom vetFrameRGB24 img  )  [virtual]
 

Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.

Parameters:
[in] img VETLib Cache24 Frame to be processed (encoded for example)
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Input operator (<<) call directly this function.
See also:
operator << (vetFrameRGB24&)

Implements vetCodec.

Definition at line 279 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::autoOuput, DEBUGMSG, vetCodec_IMGParameters::doBuffering, doFileNameCurrent(), fileNameBuffer, vetCodec_IMGParameters::fileNameIndex, vetCodec_IMGParameters::fileNameProgression, myParams, save(), and VETRET_OK.

VETRESULT vetCodec_IMG::importFrom vetFrameYUV420 img  )  [virtual]
 

Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.

Parameters:
[in] img VETLib Cache Frame to be processed (encoded for example)
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Input operator (<<) call directly this function.
See also:
operator << (vetFrameYUV420&)

Implements vetCodec.

Definition at line 270 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

bool vetCodec_IMG::isAutoInputEnabled  ) 
 

Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 647 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::autoInput, and myParams.

bool vetCodec_IMG::isAutoOutputEnabled  ) 
 

Parameters:
[in] @return VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 661 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::autoOuput, and myParams.

bool vetCodec_IMG::isBufferingEnabled  ) 
 

Parameters:
[in] @return VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 676 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::doBuffering, and myParams.

bool vetCodec_IMG::isDecodingAvailable  )  [inline, virtual]
 

Check ability to decode data.

Returns:
true is class is able to decode video data, flase else.

Implements vetCodec.

Definition at line 742 of file vetCodec_IMG.h.

bool vetCodec_IMG::isEncodingAvailable  )  [inline, virtual]
 

Check ability to encode data.

Returns:
true is class is able to encode video data, flase else.

Implements vetCodec.

Definition at line 741 of file vetCodec_IMG.h.

bool vetCodec_IMG::isFileNameProgressionEnabled  ) 
 

Returns:
true if filename progression is enabled.
See also:
fileNameProgression

Definition at line 635 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::fileNameProgression, and myParams.

VETRESULT vetCodec_IMG::load vetFrameT< unsigned char > &  source,
const char *  filename
[static]
 

Load a BMP format image into given image.

Parameters:
[out] source GreyScale VETLib Frame to store data.
[in] filename Input BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 456 of file vetCodec_IMG.cpp.

References DEBUGMSG, vetFrameT< T >::getHeight(), vetFrameT< T >::getWidth(), VETRET_NOT_IMPLEMENTED, VETRET_OK, and VETRET_PARAM_ERR.

VETRESULT vetCodec_IMG::load vetFrameRGB24 source,
const char *  filename
[static]
 

Load a BMP format image into given image.

Parameters:
[out] source VETLib Cache24 Frame to store data.
[in] filename Input BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 420 of file vetCodec_IMG.cpp.

References vetFrameRGB24::data, DEBUGMSG, vetFrame::height, im_get_data(), im_load(), img, ok, VETRET_OK, VETRET_PARAM_ERR, and vetFrame::width.

VETRESULT vetCodec_IMG::load vetFrameYUV420 source,
const char *  filename
[static]
 

Load a BMP format image into given image.

Parameters:
[out] source VETLib Cache Frame to store data.
[in] filename Input BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 412 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::load char *  filename  ) 
 

Load a BMP format image into current buffer (vetFrameRGB).

Parameters:
[in] filename Input BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 393 of file vetCodec_IMG.cpp.

References vetFrameYUV420::autoFreeData, DEBUGMSG, load(), and VETRET_OK.

VETRESULT vetCodec_IMG::load  ) 
 

Load a BMP format image into current buffer (vetFrameRGB), first setup current filename and format then call this function.

Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 375 of file vetCodec_IMG.cpp.

References vetFrameYUV420::autoFreeData, doFileNameCurrent(), fileNameBuffer, INFO, and VETRET_OK.

Referenced by extractTo(), load(), and vetCodec_IMG().

VETRESULT vetCodec_IMG::reset  )  [virtual]
 

Reset filename related setup.

Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Implements vetCodec.

Definition at line 181 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::fileNameBase, fileNameBuffer, INFO, myParams, vetCodec_IMGParameters::reset(), vetObject::setDescription(), vetObject::setName(), vetObject::setVersion(), and VETRET_OK.

Referenced by vetCodec_IMG().

VETRESULT vetCodec_IMG::save vetFrameT< unsigned char > &  source,
const char *  filename
[static]
 

Save given image to a BMP file.

Parameters:
[in] source Greyscale VETLib Frame to store data.
[in] filename Output BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 553 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::save vetFrameRGB24 source,
const char *  filename
[static]
 

Save given image to a BMP file.

Parameters:
[in] source VETLib Cache24 Frame to store data.
[in] filename Output BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 513 of file vetCodec_IMG.cpp.

References vetFrameRGB24::data, DEBUGMSG, vetFrame::getHeight(), vetFrame::getWidth(), vetFrame::height, VETRET_OK, VETRET_PARAM_ERR, and vetFrame::width.

VETRESULT vetCodec_IMG::save vetFrameYUV420 source,
const char *  filename
[static]
 

Save given image to a BMP file.

Parameters:
[in] source VETLib Cache Frame to store data.
[in] filename Output BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 470 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::save char *  filename  ) 
 

Save current buffered image to given filename and format.

Parameters:
[in] filename Output BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 366 of file vetCodec_IMG.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::save  ) 
 

Save current buffered image to current filename, first setup current filename and format then call this function.

Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 352 of file vetCodec_IMG.cpp.

References doFileNameCurrent(), INFO, VETRET_NOT_IMPLEMENTED, and VETRET_OK.

Referenced by importFrom().

void vetCodec_IMG::setAutoInputEnabled bool  value = true  ) 
 

Parameters:
[in] @return VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 599 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::autoInput, and myParams.

void vetCodec_IMG::setAutoOutputEnabled bool  value = true  ) 
 

Enable or disable auto input feature,.

Parameters:
[in] @return VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 585 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::autoOuput, and myParams.

void vetCodec_IMG::setDoBuffering bool  value = true  ) 
 

Parameters:
[in] @return VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
See also:

Definition at line 613 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::doBuffering, and myParams.

void vetCodec_IMG::setFileName const char *  filename  ) 
 

Parameters:
[in] @note 
See also:

Definition at line 320 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::fileNameBase, fileNameBuffer, and myParams.

void vetCodec_IMG::setFileNameProgression bool  value  ) 
 

Enable or disable filename progression, for example: basefile name is "output", index is 13 so filename is output13.bmp, if filename progression is enabled, when an operation is done onto file, idex is incremented (output14.bmp).

Parameters:
[in] value true to enable file name progression.

Definition at line 571 of file vetCodec_IMG.cpp.

References vetCodec_IMGParameters::fileNameProgression, and myParams.

VETRESULT vetCodec_IMG::setHeight unsigned int  value  )  [inline, virtual]
 

read current image's width.read current image's height.Set current canvas' height.

Returns:
height in pixel.

Implements vetOutput.

Definition at line 554 of file vetCodec_IMG.h.

References VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_IMG::setParameters vetCodec_IMGParameters initParams  ) 
 

Set parameters for (de)coding.

Parameters:
[in] initParams Instance of vetCodec_IMGParameters or NULL, NULL argument make function to create a new instance with default parameters.
Returns:
VETRET_OK

Definition at line 199 of file vetCodec_IMG.cpp.

References myParams, and VETRET_OK.

Referenced by setFilterParameters(), and vetCodec_IMG().

VETRESULT vetCodec_IMG::setWidth unsigned int  value  )  [inline, virtual]
 

Set current canvas' width.

Returns:
width in pixel.

Implements vetOutput.

Definition at line 561 of file vetCodec_IMG.h.

References VETRET_NOT_IMPLEMENTED.


The documentation for this class was generated from the following files:
Generated on Tue Jan 24 11:59:24 2006 for VETLib by  doxygen 1.4.4