24 #include <fvfilters/shape_remover.h> 27 #include <fvmodels/shape/shapemodel.h> 40 :
Filter(
"FilterShapeRemover")
55 if (shape == NULL)
return;
60 unsigned char *linestart = buffer;
67 if ((*buffer > 240) && (shape->
isClose(w, h))) {
78 unsigned char *dst_linestart = dst_buffer;
83 if ((*buffer > 240) && (shape->
isClose(w, h))) {
86 *dst_buffer = *buffer;
95 dst_buffer = dst_linestart;
107 this->margin = margin;
virtual bool isClose(unsigned int in_roi_x, unsigned int in_roi_y)=0
Check if the given point is close to the shape.
unsigned int width
ROI width.
virtual void setMargin(unsigned int margin)=0
Set margin around shape.
virtual void set_shape(Shape *shape)
Set shape that is to be removed.
virtual void apply()
Apply the filter.
FilterShapeRemover()
Constructor.
unsigned char ** src
Source buffers, dynamically allocated by Filter ctor.
ROI ** src_roi
Source ROIs, dynamically allocated by Filter ctor.
unsigned char * get_roi_buffer_start(unsigned char *buffer) const
Get ROI buffer start.
unsigned int height
ROI height.
unsigned int line_step
line step
virtual void set_margin(unsigned int margin)
Set margin.
unsigned char * dst
Destination buffer.
ROI * dst_roi
Destination ROI.