25 unsigned xch,
unsigned ych,
double scalex,
double scaley)
30 , _scalex(scalex / 255.0)
31 , _scaley(scaley / 255.0)
35 guint32 operator()(
int x,
int y)
37 guint32 mappx = _map.pixelAt(x, y);
38 guint32 a = (mappx & 0xff000000) >> 24;
40 double xtex = x, ytex = y;
42 guint32 xshift = _xch * 8, yshift = _ych * 8;
43 xpx = (mappx & (0xff << xshift)) >> xshift;
44 ypx = (mappx & (0xff << yshift)) >> yshift;
49 xtex += _scalex * (xpx - 127.5);
50 ytex += _scaley * (ypx - 127.5);
52 if (xtex >= 0 && xtex < _texture._w - 1 &&
53 ytex >= 0 && ytex < _texture._h - 1)
55 return _texture.pixelAt(xtex, ytex);
65 double _scalex, _scaley;
90 cairo_surface_destroy(out);
105 if (input == 0)
_input = slot;
106 if (input == 1)
_input2 = slot;
112 g_warning(
"Selected an invalid channel value. (%d)", channel);
147 double scalex =
scale / 2. * (std::fabs(trans[0]) + std::fabs(trans[1]));
148 double scaley =
scale / 2. * (std::fabs(trans[2]) + std::fabs(trans[3]));
151 area.
expandBy(scalex + 2, scaley + 2);
Cairo software blending templates.
void ink_cairo_surface_synthesize(cairo_surface_t *out, cairo_rectangle_t const &out_area, Synth &&synth)
Synthesize surface pixels based on their position.
void copy_cairo_surface_ci(cairo_surface_t *in, cairo_surface_t *out)
cairo_surface_t * ink_cairo_surface_create_identical(cairo_surface_t *s)
Create a surface that differs only in pixel content.
void set_cairo_surface_ci(cairo_surface_t *surface, SPColorInterpolation ci)
Set the color_interpolation_value for a Cairo surface.
Cairo integration helpers.
G_GNUC_CONST guint32 unpremul_alpha(const guint32 color, const guint32 alpha)
3x3 matrix representing an affine transformation.
Coord expansionX() const
Calculates the amount of x-scaling imparted by the Affine.
Coord expansionY() const
Calculates the amount of y-scaling imparted by the Affine.
Axis aligned, non-empty, generic rectangle.
void expandBy(C amount)
Expand the rectangle in both directions by the specified amount.
void area_enlarge(Geom::IntRect &area, Geom::Affine const &trans) const override
void render_cairo(FilterSlot &slot) const override
void set_channel_selector(int s, FilterDisplacementMapChannelSelector channel)
double complexity(Geom::Affine const &ctm) const override
void set_input(int slot) override
Sets the input slot number 'slot' to be used as input in rendering filter primitive 'primitive' For f...
SPColorInterpolation color_interpolation
cairo_surface_t * getcairo(int slot)
Returns the pixblock in specified slot.
void set(int slot, cairo_surface_t *s)
Sets or re-sets the pixblock associated with given slot.
int get_device_scale() const
Gets the device scale; for high DPI monitors.
FilterUnits const & get_units() const
Geom::Affine get_matrix_primitiveunits2pb() const
Gets the primitiveUnits to pixblock coordinates transformation matrix.
FilterDisplacementMapChannelSelector
@ DISPLACEMENTMAP_CHANNEL_RED
@ DISPLACEMENTMAP_CHANNEL_BLUE
@ DISPLACEMENTMAP_CHANNEL_GREEN
@ DISPLACEMENTMAP_CHANNEL_ALPHA
struct _cairo_surface cairo_surface_t
Helper class to stream background task notifications as a series of messages.
TODO: insert short description here.