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

vetInput Class Reference

Included for clock() method, used to syncronize frame rate. More...

#include <vetInput.h>

Inheritance diagram for vetInput:

vetCodec vetDirectXInput vetDirectXInput2 vetFilter vetInput1394L vetNoiseGenerator vetPlainFrameGenerator vetVideo4Linux

Public Types

enum  
 Ignore this, it's a class-type definition, mostly used by VETLib WorkShop, sintax is a bit more complex than usual because of a VC6 BUG, it's the same as: const int vetClassType = VETCLASS_TYPE_INPUT;.

Public Member Functions

 vetInput (float fps=0)
 Default constructor is protected because this is an abstract class and instance cannot be created directly.
virtual ~vetInput ()
virtual unsigned int getHeight () const =0
 Get current canvas' height.
virtual unsigned int getWidth () const =0
 Get current canvas' width.
virtual VETRESULT reset ()=0
 Reset the module.
virtual bool EoF ()=0
 Get the state of current data source.
float getFrameRate () const
 Read current frame rate (frame per second).
VETRESULT setFrameRate (float fps)
 Set frame rate to given value, acquisition process may be slower than theoretical frame rate.
virtual VETRESULT extractTo (vetFrameYUV420 &img)=0
 Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.
virtual VETRESULT extractTo (vetFrameRGB24 &img)=0
 Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.
virtual VETRESULT extractTo (vetFrameT< unsigned char > &img)=0
 Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.
vetInputoperator>> (vetFrameYUV420 &img)
 Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.
vetInputoperator>> (vetFrameRGB24 &img)
 Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.
vetInputoperator>> (vetFrameT< unsigned char > &img)
 Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.

Protected Member Functions

void setElaborationStart ()
 Reset clock tick counter to current value, used as offset for getElaborationTime() method. Must be always called before get..().
long getElaborationTime ()
 Return time elapsed from setElaborationStart() call, uses clock() method of <time.h>, CLK_TCK macro converts clock cycle count to seconds. The use of this method without a previous call of setElaborationStart() return a foolish value.

Protected Attributes

float v_framerate
long v_sleeptime
clock_t v_elab_start

Detailed Description

Included for clock() method, used to syncronize frame rate.

See also:
getElaborationTime()

setElaborationTime()

Definition at line 52 of file vetInput.h.


Constructor & Destructor Documentation

vetInput::vetInput float  fps = 0  ) 
 

Default constructor is protected because this is an abstract class and instance cannot be created directly.

Parameters:
fps Frame per second value, default is 0, the max (hardware) rate.

Definition at line 40 of file vetInput.cpp.

References DEBUGMSG, setFrameRate(), and v_elab_start.


Member Function Documentation

virtual bool vetInput::EoF  )  [pure virtual]
 

Get the state of current data source.

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

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetDirectXInput, vetDirectXInput2, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, vetCodec, and vetFilter.

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

Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.

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&)

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetMultiplexer, vetDirectXInput, vetDirectXInput2, vetInput1394L, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, vetCodec, and vetFilter.

virtual VETRESULT vetInput::extractTo vetFrameRGB24 img  )  [pure virtual]
 

Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.

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&)

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetMultiplexer, vetDirectXInput, vetDirectXInput2, vetInput1394L, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, vetCodec, and vetFilter.

virtual VETRESULT vetInput::extractTo vetFrameYUV420 img  )  [pure virtual]
 

Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.

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&)

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetMultiplexer, vetDirectXInput, vetDirectXInput2, vetInput1394L, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, vetCodec, and vetFilter.

Referenced by operator>>().

long vetInput::getElaborationTime  )  [inline, protected]
 

Return time elapsed from setElaborationStart() call, uses clock() method of <time.h>, CLK_TCK macro converts clock cycle count to seconds. The use of this method without a previous call of setElaborationStart() return a foolish value.

Returns:
Time elapsed in milliseconds.
See also:
setElaborationTime()

operator >> ()

clock()

Definition at line 106 of file vetInput.cpp.

References v_elab_start.

Referenced by operator>>().

float vetInput::getFrameRate  )  const [inline]
 

Read current frame rate (frame per second).

Returns:
Frame per second as a floating point value. (delay=1/fps)
See also:
v_sleeptime

Reimplemented in vetFilterColor, vetFilterGeometric, and vetMultiplexer.

Definition at line 165 of file vetInput.h.

References v_framerate.

virtual unsigned int vetInput::getHeight  )  const [pure virtual]
 

Get current canvas' height.

Returns:
height in pixel.

Implemented in vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetDirectXInput, vetDirectXInput2, vetInput1394L, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, and vetFilter.

virtual unsigned int vetInput::getWidth  )  const [pure virtual]
 

Get current canvas' width.

Returns:
width in pixel.

Implemented in vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetDirectXInput, vetDirectXInput2, vetInput1394L, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, and vetFilter.

vetInput & vetInput::operator>> vetFrameT< unsigned char > &  img  ) 
 

Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
Address of current instance.
See also:
importFrom(vetFrameYUV420&)

vetsleep()

setElaborationStart()

getElaborationTime()

Reimplemented in vetCodec_BMP, and vetCodec_BMP.

Definition at line 190 of file vetInput.cpp.

References DEBUG, extractTo(), getElaborationTime(), INFO, setElaborationStart(), and v_sleeptime.

vetInput & vetInput::operator>> vetFrameRGB24 img  ) 
 

Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.

Parameters:
[out] img VETLib Cache24 Frame to store data.
Returns:
Address of current instance.
See also:
importFrom(vetFrameRGB24&)

vetsleep()

setElaborationStart()

getElaborationTime()

Reimplemented in vetCodec_BMP, and vetCodec_BMP.

Definition at line 128 of file vetInput.cpp.

References DEBUG, extractTo(), getElaborationTime(), INFO, setElaborationStart(), and v_sleeptime.

vetInput & vetInput::operator>> vetFrameYUV420 img  ) 
 

Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
Address of current instance.
See also:
importFrom(vetFrameYUV420&)

vetsleep()

setElaborationStart()

getElaborationTime()

Reimplemented in vetCodec_BMP, and vetCodec_BMP.

Definition at line 159 of file vetInput.cpp.

References DEBUG, extractTo(), getElaborationTime(), INFO, setElaborationStart(), and v_sleeptime.

Referenced by vetCodec_BMP::operator>>().

virtual VETRESULT vetInput::reset  )  [pure virtual]
 

Reset the module.

Returns:
VETRET_INTERNAL_ERR if any error occur, VETRET_OK else.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, vetCodec_XVID, vetDigitalFilter, vetFilterColor, vetFilterGeometric, vetFilterNoiseChannel, vetMultiplexer, vetDirectXInput, vetDirectXInput2, vetNoiseGenerator, vetPlainFrameGenerator, vetVideo4Linux, vetCodec, and vetFilter.

void vetInput::setElaborationStart  )  [inline, protected]
 

Reset clock tick counter to current value, used as offset for getElaborationTime() method. Must be always called before get..().

See also:
getElaborationTime()

operator >> ()

clock()

Definition at line 90 of file vetInput.cpp.

References v_elab_start.

Referenced by operator>>().

VETRESULT vetInput::setFrameRate float  fps  ) 
 

Set frame rate to given value, acquisition process may be slower than theoretical frame rate.

Parameters:
[in] fps Frame per second as a floating point value, 0 means max frame rate.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if fps is negative, VETRET_ILLEGAL_USE if frame rate setup is not available for this source.
Note:
Currently frame rate managment is implemented in output operators.
See also:
v_sleeptime

v_framerate

Definition at line 64 of file vetInput.cpp.

References DEBUGMSG, v_framerate, v_sleeptime, VETRET_OK, and VETRET_PARAM_ERR.

Referenced by vetInput().


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