PiXCam Class Reference

PiXCam is the class that describes the camera(s). More...

#include <pix_trace.hh>

List of all members.

Public Types

enum  edge_num

Public Member Functions

 PiXCam (uchar num)
 camera class
bool copy_VidBuf_to_white (uint frame_num)
 set up white calibrations.
bool copy_VidBuf_to_black (uint frame_num)
 set up black calibrations.
void ClearCalibrations ()
PiXFramePf (uint fn)
 Allocate new frame, or get old one.
uint F ()
 returns the number of frames allocated.
void F (uint new_size)
 Makes number of frames equal to new_size.
uchar C ()
 Returns number of colors per pixel.
void C (uchar newdata)
 sets number of colors per pixel.
ushort H ()
 Returns number of lines per frame.
void H (ushort newdata)
 sets number of lines per frame.
ushort W ()
 Returns number of pixels per line.
void W (ushort newdata)
 sets number of pixels per line.
void clear ()
 sets all params to zero except XPelsPerMeter=YPelsPerMeter.

Public Attributes

bool linescan
 true if web scan with linescan camera
bool enable_clip
 enable the clip
ushort clip [4]
 clip values, see enum edge_num
uchar * white
 white calibrations - RGB if color
uchar * black
 black calibrations - RGB if color
int XPelsPerMeter
 useful if x and y axes have different resolutions
int YPelsPerMeter
 useful if x and y axes have different resolutions


Detailed Description

PiXCam is the class that describes the camera(s).

PiXCam defines the width in pixels, height in pixels, and number of colors. It slso stores the calibrations that apply to all frames such as dark current and sensitivity for each pixel.

PiXCam is the only class in pixtrace for which memory is allocated by the application. The camera frames PiXFrame are allocated by PiXCam. Regions, Blobs, Spots, CentLines, and Lines are allocated by their frame, PiXFrame.

The reason for letting the allocations be done by PiXCam or PiXFrame is that it is generally easier to refer to say frame 1 or frame 2, and spot #1 or spot #2, then by using pointers to their addresses. Also, if there are 20,000 CentLines in a picture, somewhere there has to be maintained a list of them. One will inevitably refer to them as the 'first in the list' or 'second in the list'.

For PiXCam, the application will have to keep its own list if there are more than one camera.


Member Enumeration Documentation

Used by clip

PIX_CLIP_LEFT=0, PIX_CLIP_RIGHT, PIX_CLIP_BOTTOM, PIX_CLIP_TOP


Constructor & Destructor Documentation

PiXCam::PiXCam ( uchar  num  )  [inline]

camera class

Starting point for classes in pixtrace.

Parameters:
num  application supplied identifier for camera


Member Function Documentation

bool PiXCam::copy_VidBuf_to_white ( uint  frame_num  )  [inline]

set up white calibrations.

Use the camera to take a picture of the white calibration fixture, and then save it for use by PiXFrame::apply_cal_values() with this function.

Parameters:
frame_num  frame number that holds the white reference data

bool PiXCam::copy_VidBuf_to_black ( uint  frame_num  )  [inline]

set up black calibrations.

Use the camera to take a picture of the black calibration fixture (might be a lens cover), and then save it for use by PiXFrame::apply_cal_values() with this function.

Parameters:
frame_num  frame number that holds the black reference data

void PiXCam::ClearCalibrations (  )  [inline]

de-allocates white and black.

PiXFrame* PiXCam::Pf ( uint  fn  )  [inline]

Allocate new frame, or get old one.

Returns:
pointer to frame.
Will automaticaly increase the number of frames if necessary. Assigns frame number and camera address in PiXFrame for new frames
Parameters:
fn  frame number desired

void PiXCam::F ( uint  new_size  )  [inline]

Makes number of frames equal to new_size.

If the number of frames is reduced, frames may be discarded.

void PiXCam::C ( uchar  newdata  )  [inline]

sets number of colors per pixel.

Parameters:
newdata desired number of colors.
If number of colors is changed, all frames are cleared.

void PiXCam::H ( ushort  newdata  )  [inline]

sets number of lines per frame.

Parameters:
newdata desired number of lines.
If number of lines is changed, all frames are cleared.

void PiXCam::W ( ushort  newdata  )  [inline]

sets number of pixels per line.

Parameters:
newdata desired number of pixels.
If number of pixels is changed, all frames are cleared.

void PiXCam::clear (  )  [inline]

sets all params to zero except XPelsPerMeter=YPelsPerMeter.

Frees white and black calibrations, deletes all frames.

Sets XPelsPerMeter and YPelsPerMeter to 1.


The documentation for this class was generated from the following file:

Generated on Fri Aug 1 22:02:12 2008 for pixtrace by  doxygen 1.5.5