Inkscape
Vector Graphics Editor
|
#include <nr-filter-slot.h>
Public Member Functions | |
FilterSlot (DrawingContext *bgdc, DrawingContext &graphic, FilterUnits const &units, RenderContext &rc, int blurquality) | |
Creates a new FilterSlot object. | |
~FilterSlot () | |
Destroys the FilterSlot object and all its contents. | |
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. | |
cairo_surface_t * | get_result (int slot_nr) |
void | set_primitive_area (int slot, Geom::Rect &area) |
Geom::Rect | get_primitive_area (int slot) const |
int | get_slot_count () const |
Returns the number of slots in use. | |
int | get_blurquality () const |
Gets the gaussian filtering quality. | |
int | get_device_scale () const |
Gets the device scale; for high DPI monitors. | |
FilterUnits const & | get_units () const |
Geom::Rect | get_slot_area () const |
RenderContext & | get_rendercontext () const |
Private Types | |
using | SlotMap = std::map< int, cairo_surface_t * > |
using | PrimitiveAreaMap = std::map< int, Geom::Rect > |
Private Member Functions | |
cairo_surface_t * | _get_transformed_source_graphic () const |
cairo_surface_t * | _get_transformed_background () const |
cairo_surface_t * | _get_fill_paint () const |
cairo_surface_t * | _get_stroke_paint () const |
void | _set_internal (int slot, cairo_surface_t *s) |
Private Attributes | |
SlotMap | _slots |
PrimitiveAreaMap | _primitiveAreas |
int | _slot_w |
int | _slot_h |
double | _slot_x |
double | _slot_y |
cairo_surface_t * | _source_graphic |
cairo_t * | _background_ct |
Geom::IntRect | _source_graphic_area |
Geom::IntRect | _background_area |
needed to extract background | |
FilterUnits const & | _units |
int | _last_out |
int | _blurquality |
int | device_scale |
RenderContext & | rc |
Definition at line 34 of file nr-filter-slot.h.
|
private |
Definition at line 82 of file nr-filter-slot.h.
|
private |
Definition at line 78 of file nr-filter-slot.h.
Inkscape::Filters::FilterSlot::FilterSlot | ( | DrawingContext * | bgdc, |
DrawingContext & | graphic, | ||
FilterUnits const & | units, | ||
RenderContext & | rc, | ||
int | blurquality | ||
) |
Creates a new FilterSlot object.
Definition at line 30 of file nr-filter-slot.cpp.
References _slot_h, _slot_w, _slot_x, _slot_y, _source_graphic_area, _units, Inkscape::Filters::FilterUnits::get_matrix_display2pb(), Geom::GenericRect< C >::height(), Geom::Affine::isTranslation(), Geom::GenericRect< C >::min(), Inkscape::DrawingContext::targetLogicalBounds(), Geom::GenericRect< C >::width(), Geom::X, and Geom::Y.
Inkscape::Filters::FilterSlot::~FilterSlot | ( | ) |
Destroys the FilterSlot object and all its contents.
Definition at line 60 of file nr-filter-slot.cpp.
References _slots.
|
private |
|
private |
|
private |
Definition at line 162 of file nr-filter-slot.cpp.
References _background_area, _background_ct, _slot_h, _slot_w, _slot_x, _slot_y, _units, device_scale, Inkscape::Filters::FilterUnits::get_matrix_display2pb(), ink_cairo_transform(), Geom::GenericRect< C >::left(), and Geom::GenericRect< C >::top().
Referenced by getcairo().
|
private |
Definition at line 137 of file nr-filter-slot.cpp.
References _slot_h, _slot_w, _slot_x, _slot_y, _source_graphic, _source_graphic_area, _units, Inkscape::Filters::FilterUnits::get_matrix_display2pb(), ink_cairo_transform(), Geom::Affine::isTranslation(), Geom::GenericRect< C >::left(), and Geom::GenericRect< C >::top().
Referenced by getcairo().
|
private |
Definition at line 217 of file nr-filter-slot.cpp.
References _slots, and surface.
Referenced by getcairo(), and set().
|
inline |
Gets the gaussian filtering quality.
Affects used interpolation methods
Definition at line 67 of file nr-filter-slot.h.
References _blurquality.
Referenced by Inkscape::Filters::FilterGaussian::render_cairo().
|
inline |
Gets the device scale; for high DPI monitors.
Definition at line 70 of file nr-filter-slot.h.
References device_scale.
Referenced by Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterGaussian::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), and Inkscape::Filters::FilterSpecularLighting::render_cairo().
Geom::Rect Inkscape::Filters::FilterSlot::get_primitive_area | ( | int | slot | ) | const |
Definition at line 250 of file nr-filter-slot.cpp.
References _last_out, _primitiveAreas, _units, Inkscape::Filters::FilterUnits::get_filter_area(), and Inkscape::Filters::NR_FILTER_SLOT_NOT_SET.
Referenced by Inkscape::Filters::FilterTile::render_cairo().
|
inline |
Definition at line 75 of file nr-filter-slot.h.
References rc.
Referenced by Inkscape::Filters::FilterImage::render_cairo().
cairo_surface_t * Inkscape::Filters::FilterSlot::get_result | ( | int | slot_nr | ) |
Definition at line 189 of file nr-filter-slot.cpp.
References _slot_x, _slot_y, _source_graphic, _source_graphic_area, _units, copy_cairo_surface_ci(), Inkscape::Filters::FilterUnits::get_matrix_pb2display(), getcairo(), Geom::GenericRect< C >::height(), ink_cairo_transform(), Geom::Affine::isIdentity(), Geom::GenericRect< C >::left(), result, Geom::GenericRect< C >::top(), and Geom::GenericRect< C >::width().
Geom::Rect Inkscape::Filters::FilterSlot::get_slot_area | ( | ) | const |
Definition at line 263 of file nr-filter-slot.cpp.
References _slot_h, _slot_w, _slot_x, _slot_y, and Geom::GenericRect< Coord >::from_xywh().
Referenced by Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().
|
inline |
Returns the number of slots in use.
Definition at line 64 of file nr-filter-slot.h.
References _slots.
|
inline |
Definition at line 72 of file nr-filter-slot.h.
References _units.
Referenced by Inkscape::Filters::FilterComposite::render_cairo(), Inkscape::Filters::FilterMerge::render_cairo(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterGaussian::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().
cairo_surface_t * Inkscape::Filters::FilterSlot::getcairo | ( | int | slot | ) |
Returns the pixblock in specified slot.
Parameter 'slot' may be either an positive integer or one of pre-defined filter slot types: NR_FILTER_SLOT_NOT_SET, NR_FILTER_SOURCEGRAPHIC, NR_FILTER_SOURCEALPHA, NR_FILTER_BACKGROUNDIMAGE, NR_FILTER_BACKGROUNDALPHA, NR_FILTER_FILLPAINT, NR_FILTER_SOURCEPAINT.
Definition at line 67 of file nr-filter-slot.cpp.
References _get_transformed_background(), _get_transformed_source_graphic(), _last_out, _set_internal(), _slot_h, _slot_w, _slots, _source_graphic, getcairo(), ink_cairo_extract_alpha(), Inkscape::Filters::NR_FILTER_BACKGROUNDALPHA, Inkscape::Filters::NR_FILTER_BACKGROUNDIMAGE, Inkscape::Filters::NR_FILTER_FILLPAINT, Inkscape::Filters::NR_FILTER_SLOT_NOT_SET, Inkscape::Filters::NR_FILTER_SOURCEALPHA, Inkscape::Filters::NR_FILTER_SOURCEGRAPHIC, Inkscape::Filters::NR_FILTER_STROKEPAINT, set_cairo_surface_ci(), and SP_CSS_COLOR_INTERPOLATION_SRGB.
Referenced by get_result(), getcairo(), Inkscape::Filters::FilterComposite::render_cairo(), Inkscape::Filters::FilterMerge::render_cairo(), Inkscape::Filters::FilterPrimitive::render_cairo(), Inkscape::Filters::FilterBlend::render_cairo(), Inkscape::Filters::FilterColorMatrix::render_cairo(), Inkscape::Filters::FilterComponentTransfer::render_cairo(), Inkscape::Filters::FilterConvolveMatrix::render_cairo(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterGaussian::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), Inkscape::Filters::FilterSkeleton::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().
void Inkscape::Filters::FilterSlot::set | ( | int | slot, |
cairo_surface_t * | s | ||
) |
Sets or re-sets the pixblock associated with given slot.
If there was a pixblock already assigned with this slot, that pixblock is destroyed.
Definition at line 231 of file nr-filter-slot.cpp.
References _last_out, _set_internal(), Inkscape::Filters::NR_FILTER_SLOT_NOT_SET, Inkscape::Filters::NR_FILTER_UNNAMED_SLOT, and surface.
Referenced by Inkscape::Filters::FilterComposite::render_cairo(), Inkscape::Filters::FilterMerge::render_cairo(), Inkscape::Filters::FilterPrimitive::render_cairo(), Inkscape::Filters::FilterBlend::render_cairo(), Inkscape::Filters::FilterColorMatrix::render_cairo(), Inkscape::Filters::FilterComponentTransfer::render_cairo(), Inkscape::Filters::FilterConvolveMatrix::render_cairo(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterGaussian::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), Inkscape::Filters::FilterSkeleton::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().
void Inkscape::Filters::FilterSlot::set_primitive_area | ( | int | slot, |
Geom::Rect & | area | ||
) |
Definition at line 242 of file nr-filter-slot.cpp.
References _primitiveAreas, Inkscape::Filters::NR_FILTER_SLOT_NOT_SET, and Inkscape::Filters::NR_FILTER_UNNAMED_SLOT.
Referenced by Inkscape::Filters::FilterComposite::render_cairo(), Inkscape::Filters::FilterMerge::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), and Inkscape::Filters::FilterOffset::render_cairo().
|
private |
needed to extract background
Definition at line 90 of file nr-filter-slot.h.
Referenced by _get_transformed_background().
|
private |
Definition at line 88 of file nr-filter-slot.h.
Referenced by _get_transformed_background().
|
private |
Definition at line 93 of file nr-filter-slot.h.
Referenced by get_blurquality().
|
private |
Definition at line 92 of file nr-filter-slot.h.
Referenced by get_primitive_area(), getcairo(), and set().
|
private |
Definition at line 83 of file nr-filter-slot.h.
Referenced by get_primitive_area(), and set_primitive_area().
|
private |
Definition at line 85 of file nr-filter-slot.h.
Referenced by _get_transformed_background(), _get_transformed_source_graphic(), FilterSlot(), get_slot_area(), and getcairo().
|
private |
Definition at line 85 of file nr-filter-slot.h.
Referenced by _get_transformed_background(), _get_transformed_source_graphic(), FilterSlot(), get_slot_area(), and getcairo().
|
private |
Definition at line 86 of file nr-filter-slot.h.
Referenced by _get_transformed_background(), _get_transformed_source_graphic(), FilterSlot(), get_result(), and get_slot_area().
|
private |
Definition at line 86 of file nr-filter-slot.h.
Referenced by _get_transformed_background(), _get_transformed_source_graphic(), FilterSlot(), get_result(), and get_slot_area().
|
private |
Definition at line 79 of file nr-filter-slot.h.
Referenced by _set_internal(), get_slot_count(), getcairo(), and ~FilterSlot().
|
private |
Definition at line 87 of file nr-filter-slot.h.
Referenced by _get_transformed_source_graphic(), get_result(), and getcairo().
|
private |
Definition at line 89 of file nr-filter-slot.h.
Referenced by _get_transformed_source_graphic(), FilterSlot(), and get_result().
|
private |
Definition at line 91 of file nr-filter-slot.h.
Referenced by _get_transformed_background(), _get_transformed_source_graphic(), FilterSlot(), get_primitive_area(), get_result(), and get_units().
|
private |
Definition at line 94 of file nr-filter-slot.h.
Referenced by _get_transformed_background(), and get_device_scale().
|
private |
Definition at line 95 of file nr-filter-slot.h.
Referenced by get_rendercontext().