Simple image acquisition should be performed through tlDigitizer objects. Details about the tlDigitizer object structure can be found in tlDigitgizer.h. Under Windows, TLIB currently supports the DirectShow generic interface grabber that can be used with most firewire and USB webcams. Dedicated implementations of tlDigitizer are also available for the ImageNation PXC200 and the Data Translation DT3130 framegrabbers. Under Linux, TLIB supports Video4Linux2 compatible devices.
input = TL_SOURCE_NTSC | TL_SOURCE_SVIDEO;
Public Member Functions | |
tlDigitizer () | |
tlDigitizer (int width, int height) | |
virtual | ~tlDigitizer () |
virtual int | open (int index=0)=0 |
virtual int | open (int width, int height, int index=0) |
virtual int | close ()=0 |
unsigned short | getInput () |
int | getChannel () |
virtual int | setChannel (int channel, unsigned short input) |
virtual int | setInput (unsigned short input) |
virtual int | setFrameRate (int fps) |
virtual int | setSize (int width, int height) |
virtual int | grab (tlImage *image)=0 |
virtual int | grab (tlImage *image, tlRect *rect)=0 |
virtual int | grabQueued (tlImage *image)=0 |
virtual int | grabQueued (tlImage *image, tlRect *rect)=0 |
int | getWidth () |
int | getHeight () |
int | getID () |
tl_format | getFormat () |
Protected Attributes | |
bool | isOpen |
tlDigitizer::tlDigitizer | ( | ) |
tlDigitizer::tlDigitizer | ( | int | width, | |
int | height | |||
) |
Default constructor.
width | acquisition width | |
height | acquisition height |
tlDigitizer::~tlDigitizer | ( | ) | [virtual] |
int tlDigitizer::open | ( | int | index = 0 |
) | [pure virtual] |
Open a digitizer for image acquisition using default settings.
index | [default=0] the index of the digitizer in the system (for use of multiple digitizers at the same time) |
Implemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, tlDigitizerV4L2, and tlDigitizerVRm.
int tlDigitizer::open | ( | int | width, | |
int | height, | |||
int | index = 0 | |||
) | [virtual] |
Open a digitizer for image acquisition using a given acquisition size.
width | new acquisition width | |
height | new acquisition height | |
index | [default=0] the index of the digitizer in the system (for use of multiple digitizers at the same time) |
Reimplemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, and tlDigitizerV4L2.
tlDigitizer::close | ( | ) | [pure virtual] |
Clean up digitizer buffers and close hardware connection. Configuration is retained, so that a call to open() will restore the digitizer state to the last used mode.
Implemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, tlDigitizerV4L2, and tlDigitizerVRm.
tlDigitizer::getInput | ( | ) | [inline] |
tlDigitizer::getChannel | ( | ) | [inline] |
Get currently selected input channel.
int tlDigitizer::setChannel | ( | int | channel, | |
unsigned short | input | |||
) | [virtual] |
Set the acquisition channel.
channel | channel index on the digitizer | |
input | input format |
Reimplemented in tlDigitizerDT3130, tlDigitizerPXC200, tlDigitizerV4L, and tlDigitizerV4L2.
int tlDigitizer::setInput | ( | unsigned short | input | ) | [virtual] |
Set the acquisition channel input format.
input | input format |
Reimplemented in tlDigitizerDT3130, tlDigitizerPXC200, tlDigitizerV4L, and tlDigitizerV4L2.
int tlDigitizer::setFrameRate | ( | int | fps | ) | [virtual] |
Set the acquisition frame rate.
fps | desired frames per second |
Reimplemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, and tlDigitizerV4L.
int tlDigitizer::setSize | ( | int | width, | |
int | height | |||
) | [virtual] |
Set the digitizer acquisition size. All other parameters are left untouched. Depending on the hardware, this call might close and reopen the device, possibly leading to some latency.
width | new acquisition width | |
height | new acquisition height |
Reimplemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, and tlDigitizerV4L2.
virtual int tlDigitizer::grab | ( | tlImage * | image | ) | [pure virtual] |
This call acquires a full image from an image source. The image will have the size and format the source is currently configured for.
image | [out] a valid image pointer that will receive the image. |
Implements tlSource.
Implemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, tlDigitizerV4L2, and tlDigitizerVRm.
This call acquires a portion of an image from an image source. The image will have the size and format the source is currently configured for, but only the portion defined by the rect argument will contain valid pixel values.
image | [out] a valid image pointer that will receive the image. | |
rect | a pointer to the portion of the image to acquire. |
Implements tlSource.
Implemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, tlDigitizerV4L2, and tlDigitizerVRm.
virtual int tlDigitizer::grabQueued | ( | tlImage * | image | ) | [pure virtual] |
This call acquires a full image from an image source. The image will have the size and format the source is currently configured for.
image | [out] a valid image pointer that will receive the image. |
Implements tlSource.
Implemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, tlDigitizerV4L2, and tlDigitizerVRm.
This call acquires a portion of an image from an image source. The image will have the size and format the source is currently configured for, but only the portion defined by the rect argument will contain valid pixel values.
image | [out] a valid image pointer that will receive the image. | |
rect | a pointer to the portion of the image to acquire. |
Implements tlSource.
Implemented in tlDigitizerDT3130, tlDigitizerDX, tlDigitizerPXC200, tlDigitizerV4L, tlDigitizerV4L2, and tlDigitizerVRm.
tlSource::getWidth | ( | ) | [inline, inherited] |
Returns the width of the image source. Any image acquired through this tlSource object will have the current width.
tlSource::getHeight | ( | ) | [inline, inherited] |
Returns the height of the image source. Any image acquired through this tlSource object will have the current height.
tlSource::getID | ( | ) | [inline, inherited] |
Return a unique identifier for this source. Identifiers are allocated dynamically and are only valid during application run-time.
tlSource::getFormat | ( | ) | [inline, inherited] |
tlDigitizer::isOpen [protected] |
Return the current state of the digitizer.