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

vetVideo4Linux Class Reference

Inheritance diagram for vetVideo4Linux:

vetInput

Public Member Functions

 vetVideo4Linux (char *inputFile="/dev/video0")
 Default constructor initializes variables and connect. to device if asked.
 ~vetVideo4Linux ()
 Default destructor, disconnect device and delete buffer.
VETRESULT connect (char *inputFile="/dev/video0")
 Connect to device.
VETRESULT disconnect ()
 Disconnect from current device.
bool EoF ()
 Get the state of current data source.
VETRESULT reset ()
 Disconnect and reset the module.
int getColorDepth ()
 Read color depth for selected stream.
int getSize ()
 Read pixel count.
unsigned int getWidth () const
 Read current image's width.
unsigned int getHeight () const
 Read current image's height.
int getPalette ()
 Read color palette for current stream.
int getVideoChannelCount ()
 Get movie's video streams count.
int getAudioChannelCount ()
 Get movie's audio streams count.
int getBrightness ()
 Get current video brightness.
void setBrightness (int value)
 Set current video brightness.
int getContrast ()
 Get current video contrast.
void setContrast (int value)
 Set current video contrast.
int getHue ()
 Get current video hue.
void setHue (int value)
 Set current video hue.
int getColour ()
 Get current video color.
void setColour (int value)
 Set current video colour.
int getWhiteness ()
 Get current video whiteness.
void setWhiteness (int value)
 Set current video whiteness.
unsigned char * dump_buffer ()
 Get video buffer address, deprecated.
VETRESULT extractTo (vetFrameYUV420 &img)
 Grab a frame and copy to VETLib standard format.
VETRESULT extractTo (vetFrameRGB24 &img)
 Grab a frame and copy to VETLib standard format.
VETRESULT extractTo (vetFrameT< unsigned char > &img)
 Grab a frame and copy to VETLib standard format.

Protected Attributes

unsigned char * videoBuffer
 single frame BGR buffer (24bpp)
int bpp
 Bits per pixel value.
int fd
 device state (disconnected = -1)
unsigned int src_depth
 video depth
video_capability cap
 Capture stream informations.
video_window win
 Frame informations (width, height, ..).
video_picture vpic
 Capture settings (contrast, brightness, ..).

Detailed Description

Definition at line 44 of file vetVideo4Linux.h.


Constructor & Destructor Documentation

vetVideo4Linux::vetVideo4Linux char *  inputFile = "/dev/video0"  ) 
 

Default constructor initializes variables and connect. to device if asked.

Parameters:
[in] device capture device's path (default: /dev/video0)

Definition at line 35 of file vetVideo4Linux.cpp.

References connect(), fd, reset(), and videoBuffer.


Member Function Documentation

VETRESULT vetVideo4Linux::connect char *  inputFile = "/dev/video0"  ) 
 

Connect to device.

Returns:
VETRET_PARAMS_ERR if inputfile is NULL, VET_ILLEGAL_USE if a device is already connected, VETRET_INTERNAL_ERR if any error occured, VETRET_OK else.

Definition at line 59 of file vetVideo4Linux.cpp.

References bpp, cap, fd, VETRET_ILLEGAL_USE, VETRET_INTERNAL_ERR, VETRET_OK, VETRET_PARAM_ERR, videoBuffer, vpic, and win.

Referenced by vetVideo4Linux().

VETRESULT vetVideo4Linux::disconnect  ) 
 

Disconnect from current device.

Returns:
VETRET_ILLEGAL_USE if no device is connected, VETRET_OK else.

Definition at line 152 of file vetVideo4Linux.cpp.

References fd, VETRET_ILLEGAL_USE, VETRET_OK, vpic, and win.

Referenced by reset(), and ~vetVideo4Linux().

unsigned char* vetVideo4Linux::dump_buffer  )  [inline]
 

Get video buffer address, deprecated.

Deprecated:

Returns:
pointer to buffer (unsigned char * 3 channels, BGR)

Definition at line 258 of file vetVideo4Linux.h.

References videoBuffer.

bool vetVideo4Linux::EoF  )  [virtual]
 

Get the state of current data source.

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

Implements vetInput.

Definition at line 195 of file vetVideo4Linux.cpp.

References fd.

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

Grab a frame and copy to VETLib standard format.

Parameters:
[out] img Greyscale VETLib Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR if any device reading error occurs, VETRET_NOT_IMPLEMENTED if color format is not support.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameT&)

Implements vetInput.

Definition at line 296 of file vetVideo4Linux.cpp.

References vetUtility::conv_bgr_rgb(), vetFrameT< T >::data, fd, vetFrameT< T >::height, vetFrameT< T >::profile, vetFrameT< T >::reAllocCanvas(), VETRET_ILLEGAL_USE, VETRET_INTERNAL_ERR, VETRET_NOT_IMPLEMENTED, VETRET_OK, videoBuffer, vpic, vetFrameT< T >::width, and win.

VETRESULT vetVideo4Linux::extractTo vetFrameRGB24 img  )  [virtual]
 

Grab a frame and copy to VETLib standard format.

Parameters:
[out] img VETLib Cache24 Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR if any device reading error occurs, VETRET_NOT_IMPLEMENTED if color format is not support.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameRGB24&)

Implements vetInput.

Definition at line 254 of file vetVideo4Linux.cpp.

References vetUtility::conv_bgr_rgb(), vetFrameRGB24::data, fd, vetFrame::height, vetFrameRGB24::reAllocCanvas(), VETRET_ILLEGAL_USE, VETRET_INTERNAL_ERR, VETRET_NOT_IMPLEMENTED, VETRET_OK, videoBuffer, vpic, vetFrame::width, and win.

VETRESULT vetVideo4Linux::extractTo vetFrameYUV420 img  )  [virtual]
 

Grab a frame and copy to VETLib standard format.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR if any device reading error occurs, VETRET_NOT_IMPLEMENTED if color format is not support.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameYUV420&)

Implements vetInput.

Definition at line 216 of file vetVideo4Linux.cpp.

References fd, vetFrame::height, vetFrameYUV420::reAllocCanvas(), VETRET_ILLEGAL_USE, VETRET_NOT_IMPLEMENTED, VETRET_OK, vpic, vetFrame::width, and win.

int vetVideo4Linux::getAudioChannelCount  )  [inline]
 

Get movie's audio streams count.

Returns:
number of audio streams.

Definition at line 178 of file vetVideo4Linux.h.

int vetVideo4Linux::getBrightness  )  [inline]
 

Get current video brightness.

Returns:
brightness value ]MIN_INT, MAX_INT[

Definition at line 185 of file vetVideo4Linux.h.

int vetVideo4Linux::getColorDepth  )  [inline]
 

Read color depth for selected stream.

Returns:
Color Depth.

Definition at line 137 of file vetVideo4Linux.h.

References bpp.

int vetVideo4Linux::getColour  )  [inline]
 

Get current video color.

Returns:
color value ]MIN_INT, MAX_INT[

Definition at line 227 of file vetVideo4Linux.h.

int vetVideo4Linux::getContrast  )  [inline]
 

Get current video contrast.

Returns:
contrast value ]MIN_INT, MAX_INT[

Definition at line 199 of file vetVideo4Linux.h.

unsigned int vetVideo4Linux::getHeight  )  const [inline, virtual]
 

Read current image's height.

Returns:
Height in pixel.

Implements vetInput.

Definition at line 157 of file vetVideo4Linux.h.

int vetVideo4Linux::getHue  )  [inline]
 

Get current video hue.

Returns:
hue value ]MIN_INT, MAX_INT[

Definition at line 213 of file vetVideo4Linux.h.

int vetVideo4Linux::getPalette  )  [inline]
 

Read color palette for current stream.

Returns:
Color Palette.

Definition at line 164 of file vetVideo4Linux.h.

int vetVideo4Linux::getSize  )  [inline]
 

Read pixel count.

Returns:
Width * Height.

Definition at line 144 of file vetVideo4Linux.h.

int vetVideo4Linux::getVideoChannelCount  )  [inline]
 

Get movie's video streams count.

Returns:
number of video streams.

Definition at line 171 of file vetVideo4Linux.h.

int vetVideo4Linux::getWhiteness  )  [inline]
 

Get current video whiteness.

Returns:
whiteness value ]MIN_INT, MAX_INT[

Definition at line 241 of file vetVideo4Linux.h.

unsigned int vetVideo4Linux::getWidth  )  const [inline, virtual]
 

Read current image's width.

Returns:
Width in pixel.

Implements vetInput.

Definition at line 151 of file vetVideo4Linux.h.

VETRESULT vetVideo4Linux::reset  )  [virtual]
 

Disconnect and reset the module.

Returns:
VETRET_INTERNAL_ERR if any error occur, VETRET_OK else.

Implements vetInput.

Definition at line 172 of file vetVideo4Linux.cpp.

References disconnect(), fd, VETRET_OK, videoBuffer, vpic, and win.

Referenced by vetVideo4Linux().

void vetVideo4Linux::setBrightness int  value  )  [inline]
 

Set current video brightness.

Parameters:
[in] value brightness value ]MIN_INT, MAX_INT[

Definition at line 192 of file vetVideo4Linux.h.

void vetVideo4Linux::setColour int  value  )  [inline]
 

Set current video colour.

Parameters:
[in] value colour value ]MIN_INT, MAX_INT[

Definition at line 234 of file vetVideo4Linux.h.

void vetVideo4Linux::setContrast int  value  )  [inline]
 

Set current video contrast.

Parameters:
[in] value contrast value ]MIN_INT, MAX_INT[

Definition at line 206 of file vetVideo4Linux.h.

void vetVideo4Linux::setHue int  value  )  [inline]
 

Set current video hue.

Parameters:
[in] value hue value ]MIN_INT, MAX_INT[

Definition at line 220 of file vetVideo4Linux.h.

void vetVideo4Linux::setWhiteness int  value  )  [inline]
 

Set current video whiteness.

Parameters:
[in] value whiteness value ]MIN_INT, MAX_INT[

Definition at line 248 of file vetVideo4Linux.h.


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