25 #include "ImageValueBar.hh"
26 #include <Base/Math/Vector3.hh>
27 #include <Base/Image/ImageConvert.hh>
28 #include <Base/ImageUtils/ImageDraw.hh>
34 template <
class StorageType>
46 template<
class StorageType>
52 template<
class StorageType>
55 unsigned width = this->GetWidth();
56 unsigned height = this->GetHeight();
58 this->ReInit(100,height);
61 unsigned barArea = width-80;
62 unsigned channels = this->GetChannelCount();
63 this->FillImageWithConstValue(this->MaxSTValue());
66 double step = (maxValue_-minValue_)/(
double)height;
70 StorageType **ida = this->GetImageDataArray();
77 for(
unsigned y =0;y<height;y++){
78 for(
unsigned x = 0;x<barArea;x++){
79 for(
unsigned c=0;c<channels;c++){
80 ida[y][x*channels+c] = (StorageType)(maxValue_- step*(
double)y);
88 for(
unsigned y =0;y<height;y++){
89 for(
unsigned x = 0;x<barArea;x++){
90 for(
unsigned c=0;c<channels;c++){
91 ida[y][x*channels+c] = (StorageType)(maxValue_- step*(
double)y);
98 BIASWARN(
"This doesn't make sense right now, but maybe in the future?");
102 for(
unsigned y =0;y<height;y++){
103 for(
unsigned x = 0;x<barArea;x++){
104 hsv[0] = (float)((height-y))/2;
106 for(
unsigned c=0;c<channels;c++){
107 ida[y][x*channels+c] = StorageType(rgbF[c]);
114 BIASERR(
"Unimplemented!");
118 int spacing = ((int)height)/ticks_;
119 double stepDisplay = (maxDisplay_-minDisplay_)/(
double)height;
121 for(
int i=0;i<ticks_;i++){
122 int startX = barArea;
123 int startY = height-1-spacing*i;
124 int stopX = barArea+5;
125 int stopY = height-1-spacing*i;
128 int value = (int)rint(minDisplay_+stepDisplay*spacing*i);
135 this->GetChannelCount() == 1)
138 (int)(height)-3-spacing*i,
143 (int)(height)-2-spacing*i,
150 #define INSTANCE_Image(type)\
151 template class BIASUtils_EXPORT ImageValueBar<type>;
155 INSTANCE_Image(
unsigned char)
156 INSTANCE_Image(
float)
157 #ifdef BUILD_IMAGE_INT
160 #ifdef BUILD_IMAGE_CHAR
163 #ifdef BUILD_IMAGE_SHORT
164 INSTANCE_Image(
short)
166 #if defined(BUILD_IMAGE_USHORT)
167 INSTANCE_Image(
unsigned short)
169 #ifdef BUILD_IMAGE_DOUBLE
170 INSTANCE_Image(
double)
172 #ifdef BUILD_IMAGE_UINT
173 INSTANCE_Image(
unsigned int)
ImageBase::EColorModel model_
interface class used to ease handover in function calls
static int Line(Image< StorageType > &im, const unsigned int start[2], const unsigned int end[2], const StorageType value[])
lines
color values, 3 channels, order: red,green,blue
static BIASImageBase_EXPORT int HSVToRGB(const StorageType h, const StorageType s, const StorageType v, StorageType &r, StorageType &g, StorageType &b)
conversion of one pixel in HSV to RGB colorspace
The image template class for specific storage types.
HSV, 3 channels, order: hue, sat , value.
static void TextIM(BIAS::Image< StorageType > &dstImg, const std::string &message, const int &posX=0, const int &posY=20, const ColourRGB< StorageType > &colorRGB=ColourRGB< StorageType >(255, 255, 255), const double hscale=1.0, const double vscale=1.0, const double shear=0, const int thickness=1, const int linetype=8)
ImageMagick: Draw Text into image.
static void Text(BIAS::Image< StorageType > &dstImg, const std::string &message, const int &posX=0, const int &posY=20, const ColourRGB< StorageType > &colorRGB=ColourRGB< StorageType >(255, 255, 255), const int fontface=1, const double hscale=1.0, const double vscale=1.0, const double shear=0, const int thickness=1, const int linetype=8)
OpenCV: Draw Text into image.