24 #include <fvfilters/filter.h> 26 #include <core/exceptions/software.h> 54 Filter::Filter(
const char *name,
unsigned int max_num_buffers)
56 if ( max_num_buffers == 0 ) {
61 _max_num_buffers = max_num_buffers;
63 src = (
unsigned char **)malloc(_max_num_buffers *
sizeof(
unsigned char *));
64 memset(src, 0, _max_num_buffers *
sizeof(
unsigned char *));
66 src_roi = (
ROI **)malloc(_max_num_buffers *
sizeof(
ROI *));
67 memset(src_roi, 0, _max_num_buffers *
sizeof(
ROI *));
69 ori = (orientation_t *)malloc(_max_num_buffers *
sizeof(orientation_t));
70 memset(ori, 0, _max_num_buffers *
sizeof(orientation_t));
93 Filter::set_src_buffer(
unsigned char *buf,
96 unsigned int buffer_num)
98 if ( buffer_num >= _max_num_buffers ) {
102 src[buffer_num] = buf;
103 src_roi[buffer_num] = roi;
104 this->ori[buffer_num] = ori;
115 Filter::set_src_buffer(
unsigned char *buf,
117 unsigned int buffer_num)
119 if ( buffer_num >= _max_num_buffers ) {
123 src[buffer_num] = buf;
124 src_roi[buffer_num] = roi;
125 ori[buffer_num] = ORI_HORIZONTAL;
134 Filter::set_dst_buffer(
unsigned char *buf,
ROI *roi)
147 Filter::set_orientation(orientation_t ori,
unsigned int buffer_num)
149 if ( buffer_num >= _max_num_buffers ) {
153 this->ori[buffer_num] = ORI_HORIZONTAL;
172 Filter::shrink_region(
ROI *r,
unsigned int n)
Fawkes library namespace.
fawkes::upoint_t start
ROI start.
unsigned int y
y coordinate
unsigned int x
x coordinate
unsigned int width
ROI width.
unsigned int image_width
width of image that contains this ROI
unsigned int image_height
height of image that contains this ROI
unsigned int height
ROI height.