23 #include <fvclassifiers/qualifiers.h> 24 #include <core/exceptions/software.h> 25 #include <fvutils/color/yuv.h> 60 unsigned int height, colorspace_t colorspace)
64 if (!width || !height)
149 LumaQualifier::LumaQualifier(
unsigned char* buffer,
unsigned int width,
150 unsigned int height, colorspace_t colorspace)
151 :
Qualifier(buffer, width, height, colorspace)
189 SkyblueQualifier::SkyblueQualifier(
unsigned char* buffer,
unsigned int width,
190 unsigned int height, colorspace_t colorspace)
191 :
Qualifier(buffer, width, height, colorspace)
208 unsigned int u_addr =
size_ + (pixel.
y *
width_ + pixel.
x) / 2;
209 unsigned char u =
buffer_[u_addr];
212 if ((u < threshold_) || (v < threshold_))
236 YellowQualifier::YellowQualifier(
unsigned char* buffer,
unsigned int width,
237 unsigned int height, colorspace_t colorspace)
238 :
Qualifier(buffer, width, height, colorspace)
255 unsigned int y_addr = (pixel.
y *
width_ + pixel.
x);
256 unsigned int u_addr =
size_ + y_addr / 2;
257 unsigned char y =
buffer_[y_addr];
258 unsigned int u = (255 -
buffer_[u_addr]) * y;
259 unsigned int v = (255 - abs(127 -
buffer_[u_addr +
size_ / 2]) * 2) * y;
261 if ((u <= threshold_) || (v <= threshold_))
virtual int get(fawkes::upoint_t pixel)
Getter.
virtual void set_colorspace(colorspace_t colorspace)
colorspace setter
unsigned int y
y coordinate
unsigned int x
x coordinate
A NULL pointer was supplied where not allowed.
virtual void set_buffer(unsigned char *buffer, unsigned int width=0, unsigned int height=0)
buffer setter
virtual unsigned char * get_buffer()
Get buffer.
virtual int get(fawkes::upoint_t pixel)
Getter.
virtual colorspace_t get_colorspace()
Get colorspace.
unsigned int size_
Size of the buffer.
virtual int get(fawkes::upoint_t pixel)
Getter.
unsigned int width_
Width of the buffer.
colorspace_t colorspace_
Colorspace of the buffer.
unsigned char * buffer_
Image buffer.
Point with cartesian coordinates as unsigned integers.
Qualifier()
Default constructor.
Expected parameter is missing.
virtual ~Qualifier()
Destructor.
unsigned int height_
Height of the buffer.
Abstract Qualifier for a single pixel.