18 #ifndef PIC_FILTERING_FILTER_COMBINE_HPP 19 #define PIC_FILTERING_FILTER_COMBINE_HPP 21 #include "../filtering/filter.hpp" 23 #include "../filtering/filter_channel.hpp" 42 for(
auto i = 0; i < data->
nSrc; i++) {
43 float *tmp_src = (*data->
src[i])(data->
x, data->
y);
45 for(
int k = 0; k < data->
src[i]->channels; k++) {
46 data->
out[k2] = tmp_src[k];
89 for(
unsigned int i = 1; i < imgIn.size(); i++) {
90 channels += imgIn[i]->channels;
92 if(!imgIn[0]->isSimilarType(imgIn[i])) {
98 imgOut =
new Image(imgIn[0]->frames, imgIn[0]->width, imgIn[0]->height,
101 bool bAllocate =
false;
105 bAllocate = imgOut->
channels != channels;
109 imgOut =
new Image(imgIn[0]->frames, imgIn[0]->width, imgIn[0]->height,
142 src.push_back(imgIn);
143 src.push_back(alpha);
146 imgOut = filterC.
Process(src, imgOut);
161 return filterC.
Process(imgIn, imgOut);
175 for(
int i = 0; i < 3; i++) {
FilterCombine()
FilterCombine.
Definition: filter_combine.hpp:122
int y
Definition: filter.hpp:39
int channels
Definition: image.hpp:80
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
The Filter class.
Definition: filter.hpp:50
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
Definition: filter.hpp:37
int frames
Definition: image.hpp:80
float * out
Definition: filter.hpp:40
The FilterCombine class.
Definition: filter_combine.hpp:30
void update(std::vector< int > channels_vec)
update
Definition: filter_channel.hpp:103
The FilterChannel class.
Definition: filter_channel.hpp:56
int x
Definition: filter.hpp:39
static Image * addAlpha(Image *imgIn, Image *imgOut, float value)
addAlpha
Definition: filter_combine.hpp:134
The Image class stores an image as buffer of float.
Definition: image.hpp:60
static Image * getOnlyRGB(Image *imgIn, Image *imgOut)
getOnlyRGB
Definition: filter_combine.hpp:170
static Image * execute(ImageVec imgIn, Image *imgOut)
execute
Definition: filter_combine.hpp:158
ImageVec src
Definition: filter.hpp:43
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
int nSrc
Definition: filter.hpp:44
Definition: bilateral_separation.hpp:25
bool isValid()
isValid checks if the current image is valid, which means if they have an allocated buffer or not...
PIC_INLINE std::vector< int > SingleInt(int v0)
SingleInt.
Definition: filter_channel.hpp:30
virtual void f(FilterFData *data)
f
Definition: filter_combine.hpp:38
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
Image * setupAux(ImageVec imgIn, Image *imgOut)
ProcessBBox.
Definition: filter_combine.hpp:86