This class defines a video device.
![]() | Open ( const PString & deviceName, BOOL startImmediate = TRUE ) Open the device given the device name. |
![]() | IsOpen () Determine if the device is currently open |
![]() | Close () Close the device |
![]() | Start () Start the video device I/O capture |
![]() | Stop () Stop the video device I/O capture |
![]() | GetDeviceName () const Get the device name of the open device |
![]() | GetDeviceNames () const Get a list of all of the drivers available |
![]() | SetVideoFormat ( VideoFormat videoFormat ) Set the video format to be used. |
![]() | GetVideoFormat () const Get the video format being used. |
![]() | GetNumChannels () Get the number of video channels available on the device. |
![]() | SetChannel ( int channelNumber ) Set the video channel to be used on the device. |
![]() | GetChannel () const Get the video channel to be used on the device. |
![]() | SetColourFormatConverter ( const PString & colourFormat ) Set the colour format to be used, trying converters if available. |
![]() | SetColourFormat ( const PString & colourFormat ) Set the colour format to be used. |
![]() | GetColourFormat () const Get the colour format to be used. |
![]() | SetFrameRate ( unsigned rate ) Set the video frame rate to be used on the device. |
![]() | GetFrameRate () const Get the video frame rate used on the device. |
![]() | GetFrameSizeLimits ( unsigned & minWidth, unsigned & minHeight, unsigned & maxWidth, unsigned & maxHeight ) Get the minimum & maximum size of a frame on the device. |
![]() | SetFrameSizeConverter ( unsigned width, unsigned height, BOOL bScaleNotCrop ) Set the frame size to be used, trying converters if available. |
![]() | SetFrameSize ( unsigned width, unsigned height ) Set the frame size to be used. |
![]() | GetFrameSize ( unsigned & width, unsigned & height ) Get the frame size being used. |
![]() | GetFrameWidth () const Get the width of the frame being used. |
![]() | GetFrameHeight () const Get the height of the frame being used. |
![]() | GetMaxFrameBytes () Get the maximum frame size in bytes. |
![]() | CalculateFrameBytes ( unsigned width, unsigned height, const PString & colourFormat ) Get the number of bytes of an image, given a particular width, height and colour format |
![]() | GetLastError () const Get the last error code. |
![]() | GetBrightness () Get the brightness of the image. |
![]() | SetBrightness (unsigned newBrightness) Set brightness of the image. |
![]() | GetWhiteness () Get the whiteness of the image. |
![]() | SetWhiteness (unsigned newWhiteness) Set whiteness of the image. |
![]() | GetColour () Get the colour of the image. |
![]() | SetColour (unsigned newColour) Set colour of the image. |
![]() | GetContrast () Get the contrast of the image. |
![]() | SetContrast (unsigned newContrast) Set contrast of the image. |
![]() | GetHue () Get the hue of the image. |
![]() | SetHue (unsigned newHue) Set hue of the image. |
![]() | CanCaptureVideo (void) Is the device a camera, and obtain video |
![]() | device can grab video from a port. (camera) |
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
This class defines a video device. This class is used to abstract the few parameters that are common to both\ input and output devices.Example colour formats are:
"Grey" Simple 8 bit linear grey scale "Gray" Synonym for Grey "RGB32" 32 bit RGB "RGB24" 24 bit RGB "RGB565" 16 bit RGB (6 bit green) "RGB555" 15 bit RGB "YUV422" YUV 4:2:2 packed "YUV422P" YUV 4:2:2 planar "YUV411" YUV 4:1:1 packed "YUV411P" YUV 4:1:1 planar "YUV420" YUV 4:2:0 packed "YUV420P" YUV 4:2:0 planar "YUV410" YUV 4:1:0 packed "YUV410P" YUV 4:1:0 planar "MJPEG" Motion JPEG
Default behaviour sets the value of the videoFormat variable and then
returns TRUE.
Default behaviour returns the value of the videoFormat variable.
Default behaviour returns 1.
Default behaviour sets the value of the channelNumber variable and then
returns TRUE.
Default behaviour returns the value of the channelNumber variable.
This function will set the colour format on the device to one that
is compatible with a registered converter, and install that converter
so that the correct format is used.
To utilise an internal converter use the SetColourFormatConverter()
function. Default behaviour sets the value of the colourFormat variable and then
returns TRUE.
Default behaviour returns the value of the colourFormat variable.
Default behaviour sets the value of the frameRate variable and then
returns TRUE.
Default behaviour returns the value of the frameRate variable.
Default behaviour returns the value 1 to UINT_MAX for both and returns
FALSE.
If the device does not support the size, a set of alternate resolutions
are attempted. A converter is setup if possible.
Note that devices may not be able to produce the requested size, and
this function will fail. See SetFrameSizeConverter(). Default behaviour sets the frameWidth and frameHeight variables and
returns TRUE.
Default behaviour returns the value of the frameWidth and frameHeight
variable and returns TRUE.
Default behaviour returns the value of the frameWidth variable
Default behaviour returns the value of the frameHeight variable
Note a particular device may be able to provide variable length
frames (eg motion JPEG) so will be the maximum size of all frames.
~PVideoDevice()
virtual BOOL Open( const PString & deviceName, BOOL startImmediate = TRUE )
startImmediate - Immediately start devicevirtual BOOL IsOpen()
virtual BOOL Close()
virtual BOOL Start()
virtual BOOL Stop()
const PString& GetDeviceName() const
virtual PStringList GetDeviceNames() const
virtual BOOL SetVideoFormat( VideoFormat videoFormat )
virtual VideoFormat GetVideoFormat() const
virtual int GetNumChannels()
virtual BOOL SetChannel( int channelNumber )
virtual int GetChannel() const
virtual BOOL SetColourFormatConverter( const PString & colourFormat )
virtual BOOL SetColourFormat( const PString & colourFormat )
const PString& GetColourFormat() const
virtual BOOL SetFrameRate( unsigned rate )
virtual unsigned GetFrameRate() const
virtual BOOL GetFrameSizeLimits( unsigned & minWidth, unsigned & minHeight, unsigned & maxWidth, unsigned & maxHeight )
minHeight - Variable to receive minimum height
maxWidth - Variable to receive maximum width
maxHeight - Variable to receive maximum heightvirtual BOOL SetFrameSizeConverter( unsigned width, unsigned height, BOOL bScaleNotCrop )
height - New height of frame
bScaleNotCrop - Scale or crop/pad preferencevirtual BOOL SetFrameSize( unsigned width, unsigned height )
height - New height of framevirtual BOOL GetFrameSize( unsigned & width, unsigned & height )
virtual unsigned GetFrameWidth() const
virtual unsigned GetFrameHeight() const
virtual PINDEX GetMaxFrameBytes()
static unsigned CalculateFrameBytes( unsigned width, unsigned height, const PString & colourFormat )
int GetLastError() const
virtual int GetBrightness()
virtual BOOL SetBrightness(unsigned newBrightness)
virtual int GetWhiteness()
virtual BOOL SetWhiteness(unsigned newWhiteness)
virtual int GetColour()
virtual BOOL SetColour(unsigned newColour)
virtual int GetContrast()
virtual BOOL SetContrast(unsigned newContrast)
virtual int GetHue()
virtual BOOL SetHue(unsigned newHue)
virtual BOOL CanCaptureVideo(void)
virtual void SetCanCaptureVideo(BOOL newState)
Alphabetic index HTML hierarchy of classes or Java