nr-filter-displacement-map.cpp revision 6d67ee2082b98452e25ad085efc738cc660967eb
/*
* feDisplacementMap filter primitive renderer
*
* Authors:
* Felipe CorrĂȘa da Silva Sanches <felipe.sanches@gmail.com>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "display/nr-filter-displacement-map.h"
#include "display/nr-filter-types.h"
#include "display/nr-filter-units.h"
#include "libnr/nr-pixops.h"
namespace NR {
{}
return new FilterDisplacementMap();
}
{}
// Bail out if either one of source images is missing
return 1;
}
//TODO: check whether do we really need this check:
//are these checks really necessary?
}
}
nr_pixblock_setup_fast(out, texture->mode, out->area.x0, out->area.y0, out->area.x1, out->area.y1, true);
// this primitive is defined for non-premultiplied RGBA values,
// thus convert them to that format
map = new NRPixBlock;
false);
}
int x, y;
for (x=0; x < out_w; x++){
for (y=0; y < out_h; y++){
coordx = out_x0 - map->area.x0 + x + scalex * ( double(map_data[4*((x+out_x0-map->area.x0) + in_w*(y+out_y0-map->area.y0)) + Xchannel])/255 - 0.5);
coordy = out_y0 - map->area.y0 + y + scaley * ( double(map_data[4*((x+out_x0-map->area.x0) + in_w*(y+out_y0-map->area.y0)) + Ychannel])/255 - 0.5);
} else {
}
}
}
}
return 0;
}
}
void FilterDisplacementMap::set_scale(double s) {
scale = s;
}
}
void FilterDisplacementMap::set_channel_selector(int s, FilterDisplacementMapChannelSelector channel) {
return;
}
}
{
}
return TRAIT_PARALLER;
}
} /* namespace NR */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :