25#include <fvfilters/hv_search.h>
26#include <fvutils/color/yuv.h>
61 unsigned int top[width];
62 unsigned int bottom[width];
84 unsigned char *lyp = yp;
85 unsigned char *lup = up;
86 unsigned char *lvp = vp;
87 unsigned char *ldyp = dyp;
95 const unsigned int MIN_INTERIA = 9;
96 unsigned int num_what;
101 const unsigned int MAX_SHRINK = 16;
102 unsigned int max_width = 0;
103 bool not_reflect =
true;
105 memset(top, 0, width *
sizeof(
unsigned int));
106 memset(bottom, 0, width *
sizeof(
unsigned int));
107 memset(vflag, 0, width *
sizeof(
bool));
109 for (h = 0; (h <
src_roi[0]->
height) && (h < dst_roi->height); ++h) {
113 for (w = 0; (w <
src_roi[0]->
width) && (w < dst_roi->width); ++w) {
114 if ((cm->
determine(*yp++, *up, *vp) == what)) {
122 left = flag ? left : w;
126 if ((cm->
determine(*yp++, *up++, *vp++) == what)) {
135 left = flag ? left : w;
144 if (num_what * MIN_INTERIA > right - left) {
145 if (right - left > max_width)
146 max_width = right - left;
148 if (right - left < max_width / MAX_SHRINK) {
158 if (left != 0 && left < dst_roi->width - 1) {
162 if (right != 0 && right < dst_roi->width - 1) {
virtual color_t determine(unsigned int y, unsigned int u, unsigned int v) const =0
Determine classification of YUV pixel.
virtual void apply()
Apply the filter.
FilterHVSearch(ColorModel *cm, color_t what)
Constructor.
ROI ** src_roi
Source ROIs, dynamically allocated by Filter ctor.
unsigned char ** src
Source buffers, dynamically allocated by Filter ctor.
unsigned char * dst
Destination buffer.
ROI * dst_roi
Destination ROI.
unsigned int height
ROI height.
fawkes::upoint_t start
ROI start.
unsigned int line_step
line step
unsigned int width
ROI width.
unsigned int pixel_step
pixel step
unsigned int x
x coordinate
unsigned int y
y coordinate