18 #ifndef PIC_UTIL_BBOX_HPP 19 #define PIC_UTIL_BBOX_HPP 21 #include "../base.hpp" 22 #include "../util/string.hpp" 158 int halfSize = size >> 1;
160 this->x0 =
x0 - halfSize;
161 this->x1 =
x0 + halfSize;
163 this->y0 =
y0 - halfSize;
164 this->y1 =
y0 + halfSize;
179 int halfWidth =
width >> 1;
180 int halfHeight =
height >> 1;
182 int dataX[] = {0, 0, halfWidth, halfWidth};
183 int dataY[] = {0, halfHeight, 0, halfHeight};
185 if((
width % 2) == 1) {
193 setBox(dataX[i], dataX[i] + halfWidth,
194 dataY[i], dataY[i] + halfHeight,
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
std::string fromNumberToString(T num)
fromNumberToString converts a number into a string.
Definition: string.hpp:102
int x0
Definition: bbox.hpp:32
void setBox(int x0, int x1, int y0, int y1, int z0, int z1, int width, int height, int frames)
setBox sets a BBox up.
Definition: bbox.hpp:129
BBox(int x0, int x1, int y0, int y1, int width, int height)
BBox is a constructor setting the BBox up.
Definition: bbox.hpp:90
void setCentered(int x0, int y0, int size, int width, int height)
SetCentered.
Definition: bbox.hpp:153
int Size()
Size computes the number of pixels in a bounding box.
Definition: bbox.hpp:112
int y0
Definition: bbox.hpp:32
BBox(int x0, int x1, int y0, int y1)
BBox is a constructor setting the BBox up.
Definition: bbox.hpp:76
void getFourBlocks(int width, int height, int i)
getFourBlocks sets the BBox as a quadrant of a given size.
Definition: bbox.hpp:177
BBox(int x0, int y0, int size, int width, int height)
BBox.
Definition: bbox.hpp:103
BBox(int width, int height, int frames)
BBox is a constructor setting the BBox up.
Definition: bbox.hpp:64
int x1
Definition: bbox.hpp:32
BBox(int width, int height)
BBox is a constructor setting the BBox up.
Definition: bbox.hpp:50
int y1
Definition: bbox.hpp:32
std::string toString()
toString returns a string representation of BBox
Definition: bbox.hpp:204
Definition: bilateral_separation.hpp:25
BBox()
BBox is a basic constructor. It does nothing.
Definition: bbox.hpp:38
int width
Definition: bbox.hpp:33
int z1
Definition: bbox.hpp:32
int height
Definition: bbox.hpp:33
int frames
Definition: bbox.hpp:33
int z0
Definition: bbox.hpp:32