PVideoFrameInfo Class Reference

#include <videoio.h>

Inheritance diagram for PVideoFrameInfo:

PObject PVideoDevice PVideoInputDevice PVideoOutputDevice PVideoInput1394DcDevice PVideoOutputDeviceRGB List of all members.

Public Types

 eScale
 eCropCentre
 eCropTopLeft
 eMaxResizeMode
 SQCIFWidth = 128
 SQCIFHeight = 96
 QCIFWidth = 176
 QCIFHeight = 144
 CIFWidth = 352
 CIFHeight = 288
 CIF4Width = 704
 CIF4Height = 576
 CIF16Width = 1408
 CIF16Height = 1152
 i480Width = 640
 i480Height = 480
 p720Width = 960
 p720Height = 720
 i1080Width = 1920
 i1080Height = 1080
 HDTVWidth = 1920
 HDTVHeight = 1080
 MaxWidth = 1920
 MaxHeight = 1152
enum  ResizeMode { eScale, eCropCentre, eCropTopLeft, eMaxResizeMode }
enum  StandardSizes {
  SQCIFWidth = 128, SQCIFHeight = 96, QCIFWidth = 176, QCIFHeight = 144,
  CIFWidth = 352, CIFHeight = 288, CIF4Width = 704, CIF4Height = 576,
  CIF16Width = 1408, CIF16Height = 1152, i480Width = 640, i480Height = 480,
  p720Width = 960, p720Height = 720, i1080Width = 1920, i1080Height = 1080,
  HDTVWidth = 1920, HDTVHeight = 1080, MaxWidth = 1920, MaxHeight = 1152
}

Public Member Functions

 PVideoFrameInfo ()
 Construct video frame information.
 PVideoFrameInfo (unsigned frameWidth, unsigned frameHeight, const PString &colourFormat="YUV420P", unsigned frameRate=15, ResizeMode resizeMode=eScale)
virtual void PrintOn (ostream &strm) const
 Output the contents of the object to the stream.
virtual PBoolean SetFrameSize (unsigned width, unsigned height)
 Set the frame size to be used.
virtual PBoolean GetFrameSize (unsigned &width, unsigned &height) const
 Get the frame size being used.
virtual unsigned GetFrameWidth () const
 Get the width of the frame being used.
virtual unsigned GetFrameHeight () const
 Get the height of the frame being used.
virtual PBoolean SetFrameSar (unsigned width, unsigned height)
 Set the sar size to be used.
virtual PBoolean GetSarSize (unsigned &width, unsigned &height) const
 Get the sar size being used.
virtual unsigned GetSarWidth () const
 Get the width of the sar being used.
virtual unsigned GetSarHeight () const
 Get the height of the sar being used.
virtual PBoolean SetFrameRate (unsigned rate)
 Set the video frame rate to be used on the device.
virtual unsigned GetFrameRate () const
 Get the video frame rate used on the device.
virtual PBoolean SetColourFormat (const PString &colourFormat)
 Set the colour format to be used.
virtual const PStringGetColourFormat () const
 Get the colour format to be used.
void SetResizeMode (ResizeMode mode)
 Set the resize mode to be used.
ResizeMode GetResizeMode () const
 Get the resize mode to be used.
PINDEX CalculateFrameBytes () const
 Get the number of bytes of an image, given a particular width, height and colour format.
bool Parse (const PString &str)
 Parse a descriptor string for the video format.

Static Public Member Functions

static PINDEX CalculateFrameBytes (unsigned width, unsigned height, const PString &colourFormat)
static bool ParseSize (const PString &str, unsigned &width, unsigned &height)
 Parse the standard size string names.
static PString AsString (unsigned width, unsigned height)
 Get a width/height as a standard size string name.

Protected Attributes

unsigned frameWidth
unsigned frameHeight
unsigned sarWidth
unsigned sarHeight
unsigned frameRate
PString colourFormat
ResizeMode resizeMode

Friends

ostream & operator<< (ostream &strm, ResizeMode mode)

Member Enumeration Documentation

enum PVideoFrameInfo::ResizeMode

Enumerator:
eScale 
eCropCentre 
eCropTopLeft 
eMaxResizeMode 

enum PVideoFrameInfo::StandardSizes

Enumerator:
SQCIFWidth 
SQCIFHeight 
QCIFWidth 
QCIFHeight 
CIFWidth 
CIFHeight 
CIF4Width 
CIF4Height 
CIF16Width 
CIF16Height 
i480Width 
i480Height 
p720Width 
p720Height 
i1080Width 
i1080Height 
HDTVWidth 
HDTVHeight 
MaxWidth 
MaxHeight 


Constructor & Destructor Documentation

PVideoFrameInfo::PVideoFrameInfo (  ) 

Construct video frame information.

PVideoFrameInfo::PVideoFrameInfo ( unsigned  frameWidth,
unsigned  frameHeight,
const PString colourFormat = "YUV420P",
unsigned  frameRate = 15,
ResizeMode  resizeMode = eScale 
)


Member Function Documentation

static PString PVideoFrameInfo::AsString ( unsigned  width,
unsigned  height 
) [static]

Get a width/height as a standard size string name.

Parameters:
width  Width to convert
height  Height to convert

static PINDEX PVideoFrameInfo::CalculateFrameBytes ( unsigned  width,
unsigned  height,
const PString colourFormat 
) [static]

Parameters:
width  WIdth of frame
height  Height of frame
colourFormat  Colour format of frame

PINDEX PVideoFrameInfo::CalculateFrameBytes (  )  const [inline]

Get the number of bytes of an image, given a particular width, height and colour format.

virtual const PString& PVideoFrameInfo::GetColourFormat (  )  const [virtual]

Get the colour format to be used.

Default behaviour returns the value of the colourFormat variable.

virtual unsigned PVideoFrameInfo::GetFrameHeight (  )  const [virtual]

Get the height of the frame being used.

Default behaviour returns the value of the frameHeight variable

virtual unsigned PVideoFrameInfo::GetFrameRate (  )  const [virtual]

Get the video frame rate used on the device.

Default behaviour returns the value of the frameRate variable.

virtual PBoolean PVideoFrameInfo::GetFrameSize ( unsigned &  width,
unsigned &  height 
) const [virtual]

Get the frame size being used.

Default behaviour returns the value of the frameWidth and frameHeight variable and returns true.

Reimplemented in PVideoDevice.

virtual unsigned PVideoFrameInfo::GetFrameWidth (  )  const [virtual]

Get the width of the frame being used.

Default behaviour returns the value of the frameWidth variable

ResizeMode PVideoFrameInfo::GetResizeMode (  )  const [inline]

Get the resize mode to be used.

virtual unsigned PVideoFrameInfo::GetSarHeight (  )  const [virtual]

Get the height of the sar being used.

Default behaviour returns the value of the sarHeight variable

virtual PBoolean PVideoFrameInfo::GetSarSize ( unsigned &  width,
unsigned &  height 
) const [virtual]

Get the sar size being used.

Default behaviour returns the value of the sarWidth and sarHeight variable and returns PTrue.

virtual unsigned PVideoFrameInfo::GetSarWidth (  )  const [virtual]

Get the width of the sar being used.

Default behaviour returns the value of the sarWidth variable

bool PVideoFrameInfo::Parse ( const PString str  ) 

Parse a descriptor string for the video format.

This is of the form [fmt ':' ] size [ '@' rate][ '/' crop ]. The size component is as for the ParseSize() function.

The fmt string is the colour format such as "RGB32", "YUV420P" etc.

The rate field is a simple integer from 1 to 100.

The crop field is one of "scale", "resize" (synonym for "scale"), "centre", "center", "topleft" or "crop" (synonym for "topleft").

Note no spaces are allowed in the descriptor.

Parameters:
str  String to parse

static bool PVideoFrameInfo::ParseSize ( const PString str,
unsigned &  width,
unsigned &  height 
) [static]

Parse the standard size string names.

This will parse a size desciption using either standard names: "qcif", "cif", "vga", "hd1080" etc or WxY form e.g. "640x480".

Parameters:
str  String to parse
width  Resultant width
height  Resulatant height

virtual void PVideoFrameInfo::PrintOn ( ostream &  strm  )  const [virtual]

Output the contents of the object to the stream.

The exact output is dependent on the exact semantics of the descendent class. This is primarily used by the standard operator<< function.

The default behaviour is to print the class name.

Reimplemented from PObject.

virtual PBoolean PVideoFrameInfo::SetColourFormat ( const PString colourFormat  )  [virtual]

Set the colour format to be used.

Default behaviour sets the value of the colourFormat variable and then returns true if not an empty string.

Reimplemented in PVideoOutputDeviceRGB, and PVideoInput1394DcDevice.

virtual PBoolean PVideoFrameInfo::SetFrameRate ( unsigned  rate  )  [virtual]

Set the video frame rate to be used on the device.

Default behaviour sets the value of the frameRate variable and then returns true.

Parameters:
rate  Frames per second

Reimplemented in PVideoInput1394DcDevice.

virtual PBoolean PVideoFrameInfo::SetFrameSar ( unsigned  width,
unsigned  height 
) [virtual]

Set the sar size to be used.

Default behaviour sets the sarWidth and sarHeight variables and returns PTrue.

virtual PBoolean PVideoFrameInfo::SetFrameSize ( unsigned  width,
unsigned  height 
) [virtual]

Set the frame size to be used.

Default behaviour sets the frameWidth and frameHeight variables and returns true.

Parameters:
width  New width of frame
height  New height of frame

Reimplemented in PVideoDevice, PVideoOutputDeviceRGB, and PVideoInput1394DcDevice.

void PVideoFrameInfo::SetResizeMode ( ResizeMode  mode  )  [inline]

Set the resize mode to be used.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  strm,
ResizeMode  mode 
) [friend]


Member Data Documentation

PString PVideoFrameInfo::colourFormat [protected]

unsigned PVideoFrameInfo::frameHeight [protected]

unsigned PVideoFrameInfo::frameRate [protected]

unsigned PVideoFrameInfo::frameWidth [protected]

ResizeMode PVideoFrameInfo::resizeMode [protected]

unsigned PVideoFrameInfo::sarHeight [protected]

unsigned PVideoFrameInfo::sarWidth [protected]


The documentation for this class was generated from the following file:
Generated on Fri Oct 14 01:44:14 2011 for PTLib by  doxygen 1.4.7