nr-filter-displacement-map.cpp revision 9f6f7e74a1ded383518676e0ecb2ccc5caa73d25
/*
* feDisplacementMap filter primitive renderer
*
* Authors:
* Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "display/cairo-templates.h"
#include "display/cairo-utils.h"
#include "display/nr-filter-displacement-map.h"
#include "display/nr-filter-types.h"
#include "display/nr-filter-units.h"
namespace Inkscape {
namespace Filters {
{}
return new FilterDisplacementMap();
}
{}
struct Displace {
{}
guint32 operator()(int x, int y) {
if (a) {
}
{
} else {
return 0;
}
}
private:
};
{
// color_interpolation_filters for out same as texture. See spec.
// We may need to transform map surface to correct color interpolation space. The map surface
// might be used as input to another primitive but it is likely that all the primitives in a given
// filter use the same color interpolation space so we don't copy the map before converting.
// The converting function tags surface with the proper ci value.
if( _style ) {
}
if( ci_map == SP_CSS_COLOR_INTERPOLATION_SRGB &&
//std::cout << "FilterDisplacementMap: srgb -> linear" << std::endl;
}
if( ci_map == SP_CSS_COLOR_INTERPOLATION_LINEARRGB &&
//std::cout << "FilterDisplacementMap: linear -> srgb" << std::endl;
}
// std::cout << "FilterDisplacementMap: ci data: "
// << " texture: " << get_cairo_surface_ci(texture)
// << " map: " << get_cairo_surface_ci(map)
// << " out: " << get_cairo_surface_ci(out)
// << std::endl;
}
}
void FilterDisplacementMap::set_scale(double s) {
scale = s;
}
}
void FilterDisplacementMap::set_channel_selector(int s, FilterDisplacementMapChannelSelector channel) {
return;
}
// channel numbering:
// a = 3, r = 2, g = 1, b = 0
// this way we can get the component value using:
// component = (color & (ch*8)) >> (ch*8)
unsigned ch = 4;
switch (channel) {
ch = 3; break;
ch = 2; break;
ch = 1; break;
ch = 0; break;
default: break;
}
if (ch == 4) return;
}
{
//I assume scale is in user coordinates (?!?)
//FIXME: trans should be multiplied by some primitiveunits2user, shouldn't it?
//FIXME: no +2 should be there!... (noticable only for big scales at big zoom factor)
}
{
return 3.0;
}
} /* namespace Filters */
} /* namespace Inkscape */
/*
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:fileencoding=utf-8:textwidth=99 :