18 #ifndef PIC_FILTERING_FILTER_CHANNEL_HPP 19 #define PIC_FILTERING_FILTER_CHANNEL_HPP 21 #include "../filtering/filter.hpp" 33 ret.push_back(
MAX(v0, 0));
47 ret.push_back(
MAX(v0, 0));
48 ret.push_back(
MAX(v1, 0));
49 ret.push_back(
MAX(v2, 0));
70 for(
int p = box->
z0; p < box->z1; p++) {
71 for(
int j = box->
y0; j < box->y1; j++) {
72 for(
int i = box->
x0; i < box->x1; i++) {
74 float *dataOut = (*dst)(i, j, p);
75 float *dataIn = (*src[0])(i, j, p);
77 for(
int k = 0; k < totChannels; k++) {
79 dataOut[k] = dataIn[index];
118 width = imgIn[0]->width;
119 height = imgIn[0]->height;
120 channels =
MAX(1,
int(this->channels_vec.size()));
121 frames = imgIn[0]->frames;
167 Image imgIn(1, 512, 512, 3);
174 outR->
Write(
"channel_R.pfm");
175 outG->
Write(
"channel_G.pfm");
176 outB->
Write(
"channel_B.pfm");
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
static void test()
test
Definition: filter_channel.hpp:165
static Image * execute(Image *imgIn, Image *imgOut, int channel=0)
execute
Definition: filter_channel.hpp:131
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
PIC_INLINE std::vector< int > TripleInt(int v0, int v1, int v2)
TripleInt.
Definition: filter_channel.hpp:44
The Filter class.
Definition: filter.hpp:50
FilterChannel(std::vector< int > channels_vec)
FilterChannel.
Definition: filter_channel.hpp:94
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
int y0
Definition: bbox.hpp:32
static Image * removeAlpha(Image *imgIn, Image *imgOut)
removeAlpha
Definition: filter_channel.hpp:156
void update(std::vector< int > channels_vec)
update
Definition: filter_channel.hpp:103
The FilterChannel class.
Definition: filter_channel.hpp:56
#define PIC_INLINE
Definition: base.hpp:33
The Image class stores an image as buffer of float.
Definition: image.hpp:60
#define CLAMPi(x, a, b)
Definition: math.hpp:81
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
Definition: bilateral_separation.hpp:25
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_channel.hpp:66
#define MAX(a, b)
Definition: math.hpp:73
std::vector< int > channels_vec
Definition: filter_channel.hpp:86
PIC_INLINE std::vector< int > SingleInt(int v0)
SingleInt.
Definition: filter_channel.hpp:30
void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_channel.hpp:116
int z0
Definition: bbox.hpp:32
bool Write(std::string nameFile, LDR_type typeWrite, int writerCounter)
Write saves an Image into a file on the disk.
static Image * execute(Image *imgIn, Image *imgOut, std::vector< int > channels_vec)
execute
Definition: filter_channel.hpp:144