#include <pix_trace.hh>
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 () |
PiXFrame * | Pf (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 |
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.
enum PiXCam::edge_num |
Used by clip
PIX_CLIP_LEFT=0, PIX_CLIP_RIGHT, PIX_CLIP_BOTTOM, PIX_CLIP_TOP
PiXCam::PiXCam | ( | uchar | num | ) | [inline] |
camera class
Starting point for classes in pixtrace.
num | application supplied identifier for camera |
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.
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.
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.
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.
newdata | desired number of colors. |
void PiXCam::H | ( | ushort | newdata | ) | [inline] |
sets number of lines per frame.
newdata | desired number of lines. |
void PiXCam::W | ( | ushort | newdata | ) | [inline] |
sets number of pixels per line.
newdata | desired number of pixels. |
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.