Inkscape
Vector Graphics Editor
|
#include <drawing.h>
Private Member Functions | |
void | _pickItemsForCaching () |
void | _clearCache () |
void | _loadPrefs () |
template<typename F > | |
void | defer (F &&f) |
Private Attributes | |
DrawingItem * | _root = nullptr |
CanvasItemDrawing * | _canvas_item_drawing = nullptr |
std::unique_ptr< Preferences::PreferencesObserver > | _pref_tracker |
RenderMode | _rendermode = RenderMode::NORMAL |
ColorMode | _colormode = ColorMode::NORMAL |
bool | _outlineoverlay = false |
Filters::FilterColorMatrix::ColorMatrixMatrix | _grayscale_matrix |
uint32_t | _clip_outline_color |
uint32_t | _mask_outline_color |
uint32_t | _image_outline_color |
bool | _image_outline_mode |
Always draw images as images, even in outline mode. | |
int | _filter_quality |
int | _blur_quality |
bool | _use_dithering |
double | _cursor_tolerance |
size_t | _cache_budget |
Maximum allowed size of cache. | |
Geom::OptIntRect | _cache_limit |
std::optional< Geom::PathVector > | _clip |
bool | _select_zero_opacity |
std::optional< Antialiasing > | _antialiasing_override |
std::set< DrawingItem * > | _cached_items |
CacheList | _candidate_items |
char | cacheline_separator [127] |
bool | _snapshotted = false |
Util::FuncLog | _funclog |
Friends | |
class | DrawingItem |
Inkscape::Drawing::Drawing | ( | Inkscape::CanvasItemDrawing * | canvas_item_drawing = nullptr | ) |
Definition at line 52 of file drawing.cpp.
References _loadPrefs().
|
delete |
Inkscape::Drawing::~Drawing | ( | ) |
Definition at line 59 of file drawing.cpp.
References _root.
|
private |
Definition at line 307 of file drawing.cpp.
References _cached_items, and item.
Referenced by setAntialiasingOverride(), setBlurQuality(), setDithering(), setFilterQuality(), and setRenderMode().
|
private |
Definition at line 317 of file drawing.cpp.
References _blur_quality, _cache_budget, _canvas_item_drawing, _clip_outline_color, _cursor_tolerance, _filter_quality, _image_outline_color, _image_outline_mode, _mask_outline_color, _pref_tracker, _select_zero_opacity, _use_dithering, Inkscape::Preferences::PreferencesObserver::create(), Inkscape::default_numthreads(), Inkscape::Filters::FILTER_QUALITY_BEST, Inkscape::Filters::FILTER_QUALITY_WORST, Inkscape::Preferences::get(), Inkscape::set_num_dispatch_threads(), setBlurQuality(), setCacheBudget(), setClipOutlineColor(), setCursorTolerance(), setDithering(), setFilterQuality(), setImageOutlineColor(), setImageOutlineMode(), setMaskOutlineColor(), and setSelectZeroOpacity().
Referenced by Drawing().
|
private |
Definition at line 279 of file drawing.cpp.
References _cache_budget, _cached_items, _candidate_items, item, and used.
Referenced by setCacheBudget(), and update().
Colors::Color Inkscape::Drawing::averageColor | ( | Geom::IntRect const & | area | ) | const |
Definition at line 374 of file drawing.cpp.
References Geom::GenericRect< C >::height(), ink_cairo_surface_average_color(), Geom::GenericRect< C >::min(), render(), surface, and Geom::GenericRect< C >::width().
Referenced by Inkscape::UI::Tools::CalligraphicTool::brush(), Inkscape::ObjectSet::chameleonFill(), Inkscape::UI::Tools::getPickerData(), and Inkscape::UI::Tools::DropperTool::root_handler().
Colors::Color Inkscape::Drawing::averageColor | ( | Geom::PathVector const & | path, |
bool | evenodd | ||
) | const |
Definition at line 385 of file drawing.cpp.
References Geom::PathVector::boundsExact(), height, image, ink_cairo_surface_average_color(), offset, render(), and width.
|
inline |
Definition at line 76 of file drawing.h.
References _blur_quality.
|
inline |
Definition at line 80 of file drawing.h.
References _cache_limit.
Referenced by Inkscape::DrawingItem::_cacheRect().
|
inline |
Definition at line 71 of file drawing.h.
References _clip_outline_color.
Referenced by Inkscape::DrawingItem::_renderOutline().
|
inline |
Definition at line 68 of file drawing.h.
References _colormode.
Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 78 of file drawing.h.
References _cursor_tolerance.
|
inlineprivate |
Definition at line 138 of file drawing.h.
References _funclog, _snapshotted, and Inkscape::Util::FuncLog::emplace().
Referenced by Inkscape::DrawingItem::defer(), setAntialiasingOverride(), setBlurQuality(), setCacheBudget(), setCacheLimit(), setClip(), setClipOutlineColor(), setColorMode(), setDithering(), setFilterQuality(), setGrayscaleMatrix(), setImageOutlineColor(), setImageOutlineMode(), setMaskOutlineColor(), setOutlineOverlay(), and setRenderMode().
|
inline |
Definition at line 75 of file drawing.h.
References _filter_quality.
|
inline |
Definition at line 47 of file drawing.h.
References _canvas_item_drawing.
Referenced by Inkscape::DrawingItem::_markForUpdate(), Inkscape::DrawingShape::_pickItem(), Inkscape::UI::Widget::Canvas::on_button_pressed(), and Inkscape::DrawingItem::~DrawingItem().
|
inline |
Definition at line 70 of file drawing.h.
References _grayscale_matrix.
Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingItem::render().
|
inline |
Definition at line 73 of file drawing.h.
References _image_outline_color.
Referenced by Inkscape::DrawingImage::_renderItem().
|
inline |
Definition at line 74 of file drawing.h.
References _image_outline_mode.
Referenced by Inkscape::DrawingImage::_pickItem(), and Inkscape::DrawingImage::_renderItem().
|
inline |
Definition at line 72 of file drawing.h.
References _mask_outline_color.
Referenced by Inkscape::DrawingItem::_renderOutline().
|
inline |
Definition at line 69 of file drawing.h.
References _outlineoverlay.
Referenced by Inkscape::DrawingItem::_markForRendering(), Inkscape::DrawingGroup::_updateItem(), Inkscape::DrawingShape::_updateItem(), and Inkscape::DrawingItem::update().
DrawingItem * Inkscape::Drawing::pick | ( | Geom::Point const & | p, |
double | delta, | ||
unsigned | flags | ||
) |
Definition at line 261 of file drawing.cpp.
References _root, delta, and Inkscape::DrawingItem::pick().
void Inkscape::Drawing::render | ( | DrawingContext & | dc, |
Geom::IntRect const & | area, | ||
unsigned | flags = 0 |
||
) | const |
Definition at line 239 of file drawing.cpp.
References Inkscape::DrawingItem::_antialias, _antialiasing_override, _clip, Inkscape::DrawingItem::_ctm, _rendermode, _root, _use_dithering, Inkscape::apply_antialias(), Inkscape::DrawingContext::clip(), Inkscape::RenderContext::outline_color, Inkscape::DrawingContext::path(), rc, Inkscape::DrawingItem::render(), Inkscape::rendermode_to_renderflags(), Inkscape::DrawingContext::restore(), and Inkscape::DrawingContext::save().
Referenced by averageColor(), averageColor(), SPMeshNodeArray::color_pick(), render_surface(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_generate_internal_bitmap(), and Inkscape::UI::Dialog::sp_icon_doc_icon().
|
inline |
Definition at line 67 of file drawing.h.
References _rendermode.
Referenced by Inkscape::DrawingItem::_cacheScore(), Inkscape::DrawingItem::_markForRendering(), Inkscape::DrawingGroup::_updateItem(), Inkscape::DrawingShape::_updateItem(), and Inkscape::DrawingItem::update().
|
inline |
Definition at line 46 of file drawing.h.
References _root.
Referenced by SPDesktop::_attachDocument(), render_surface(), Inkscape::UI::View::SVGViewWidget::setDocument(), setRoot(), sp_export_png_file(), sp_generate_internal_bitmap(), and Inkscape::UI::Dialog::sp_icon_doc_icon().
|
inline |
Definition at line 79 of file drawing.h.
References _select_zero_opacity.
Referenced by Inkscape::DrawingShape::_pickItem().
void Inkscape::Drawing::setAntialiasingOverride | ( | std::optional< Antialiasing > | antialiasing_override | ) |
Definition at line 219 of file drawing.cpp.
References _antialiasing_override, _clearCache(), Inkscape::DrawingItem::_markForUpdate(), _root, defer(), and Inkscape::DrawingItem::STATE_ALL.
Referenced by Inkscape::UI::Widget::Canvas::set_antialiasing_enabled(), Inkscape::UI::Widget::Canvas::set_drawing(), sp_export_png_file(), and sp_generate_internal_bitmap().
void Inkscape::Drawing::setBlurQuality | ( | int | quality | ) |
Definition at line 168 of file drawing.cpp.
References _blur_quality, _clearCache(), Inkscape::DrawingItem::_markForUpdate(), _rendermode, _root, defer(), Inkscape::NO_FILTERS, Inkscape::OUTLINE, and Inkscape::DrawingItem::STATE_ALL.
Referenced by _loadPrefs(), and setExact().
void Inkscape::Drawing::setCacheBudget | ( | size_t | bytes | ) |
Definition at line 192 of file drawing.cpp.
References _cache_budget, _pickItemsForCaching(), and defer().
Referenced by _loadPrefs().
void Inkscape::Drawing::setCacheLimit | ( | Geom::OptIntRect const & | rect | ) |
Definition at line 200 of file drawing.cpp.
References _cache_limit, _cached_items, defer(), item, and Inkscape::DrawingItem::STATE_CACHE.
void Inkscape::Drawing::setClip | ( | std::optional< Geom::PathVector > && | clip | ) |
Definition at line 210 of file drawing.cpp.
References _clip, Inkscape::DrawingItem::_markForRendering(), _root, clip(), and defer().
void Inkscape::Drawing::setClipOutlineColor | ( | uint32_t | col | ) |
Definition at line 117 of file drawing.cpp.
References _clip_outline_color, Inkscape::DrawingItem::_markForRendering(), _outlineoverlay, _rendermode, _root, defer(), and Inkscape::OUTLINE.
Referenced by _loadPrefs().
void Inkscape::Drawing::setColorMode | ( | ColorMode | mode | ) |
Definition at line 87 of file drawing.cpp.
References _colormode, _image_outline_mode, Inkscape::DrawingItem::_markForRendering(), _rendermode, _root, defer(), mode, and Inkscape::OUTLINE.
Referenced by Inkscape::UI::Widget::Canvas::set_color_mode(), and Inkscape::UI::Widget::Canvas::set_drawing().
|
inline |
Definition at line 60 of file drawing.h.
References _cursor_tolerance.
Referenced by _loadPrefs(), and Inkscape::UI::View::SVGViewWidget::SVGViewWidget().
void Inkscape::Drawing::setDithering | ( | bool | use_dithering | ) |
Definition at line 179 of file drawing.cpp.
References _clearCache(), Inkscape::DrawingItem::_markForUpdate(), _rendermode, _root, _use_dithering, defer(), Inkscape::OUTLINE, and Inkscape::DrawingItem::STATE_ALL.
Referenced by _loadPrefs().
void Inkscape::Drawing::setExact | ( | ) |
Definition at line 423 of file drawing.cpp.
References BLUR_QUALITY_BEST, Inkscape::Filters::FILTER_QUALITY_BEST, setBlurQuality(), and setFilterQuality().
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file(), sp_export_png_file(), and sp_generate_internal_bitmap().
void Inkscape::Drawing::setFilterQuality | ( | int | quality | ) |
Definition at line 157 of file drawing.cpp.
References _clearCache(), _filter_quality, Inkscape::DrawingItem::_markForUpdate(), _rendermode, _root, defer(), Inkscape::NO_FILTERS, Inkscape::OUTLINE, and Inkscape::DrawingItem::STATE_ALL.
Referenced by _loadPrefs(), and setExact().
void Inkscape::Drawing::setGrayscaleMatrix | ( | double | value_matrix[20] | ) |
Definition at line 107 of file drawing.cpp.
References _grayscale_matrix, Inkscape::DrawingItem::_markForRendering(), _rendermode, _root, defer(), and Inkscape::OUTLINE.
Referenced by canvas_color_mode_gray().
void Inkscape::Drawing::setImageOutlineColor | ( | uint32_t | col | ) |
Definition at line 137 of file drawing.cpp.
References _image_outline_color, _image_outline_mode, Inkscape::DrawingItem::_markForRendering(), _outlineoverlay, _rendermode, _root, defer(), and Inkscape::OUTLINE.
Referenced by _loadPrefs().
void Inkscape::Drawing::setImageOutlineMode | ( | bool | enabled | ) |
Definition at line 147 of file drawing.cpp.
References _image_outline_mode, Inkscape::DrawingItem::_markForRendering(), _outlineoverlay, _rendermode, _root, defer(), and Inkscape::OUTLINE.
Referenced by _loadPrefs().
void Inkscape::Drawing::setMaskOutlineColor | ( | uint32_t | col | ) |
Definition at line 127 of file drawing.cpp.
References Inkscape::DrawingItem::_markForRendering(), _mask_outline_color, _outlineoverlay, _rendermode, _root, defer(), and Inkscape::OUTLINE.
Referenced by _loadPrefs().
void Inkscape::Drawing::setOpacity | ( | double | opacity = 1.0 | ) |
Definition at line 432 of file drawing.cpp.
References _root, and Inkscape::DrawingItem::setOpacity().
void Inkscape::Drawing::setOutlineOverlay | ( | bool | outlineoverlay | ) |
Definition at line 98 of file drawing.cpp.
References Inkscape::DrawingItem::_markForUpdate(), _outlineoverlay, _root, defer(), and Inkscape::DrawingItem::STATE_ALL.
Referenced by Inkscape::UI::Widget::Canvas::set_drawing().
void Inkscape::Drawing::setRenderMode | ( | RenderMode | mode | ) |
Definition at line 74 of file drawing.cpp.
References _clearCache(), Inkscape::DrawingItem::_markForRendering(), Inkscape::DrawingItem::_markForUpdate(), _rendermode, _root, defer(), mode, Inkscape::OUTLINE_OVERLAY, and Inkscape::DrawingItem::STATE_ALL.
Referenced by Inkscape::UI::Widget::Canvas::set_drawing().
void Inkscape::Drawing::setRoot | ( | DrawingItem * | root | ) |
Definition at line 64 of file drawing.cpp.
References Inkscape::DrawingItem::_child_type, _root, Inkscape::DrawingItem::ORPHAN, Inkscape::DrawingItem::ROOT, and root().
Referenced by Inkscape::UI::Widget::MarkerComboBox::add_markers(), Inkscape::ObjectSet::chameleonFill(), SPMeshNodeArray::color_pick(), Inkscape::Extension::Internal::pdf_render_document_to_file(), Inkscape::Extension::Internal::Emf::print_document_to_file(), Inkscape::Extension::Internal::Wmf::print_document_to_file(), Inkscape::Extension::Internal::LatexOutput::save(), sp_export_png_file(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_generate_internal_bitmap(), sp_print_document_to_file(), and Inkscape::UI::Widget::MarkerComboBox::update_preview().
|
inline |
Definition at line 61 of file drawing.h.
References _select_zero_opacity.
Referenced by _loadPrefs().
void Inkscape::Drawing::snapshot | ( | ) |
Definition at line 266 of file drawing.cpp.
References _snapshotted.
|
inline |
Definition at line 89 of file drawing.h.
References _snapshotted.
Referenced by Inkscape::DrawingText::addComponent(), and Inkscape::DrawingGlyphs::setGlyph().
void Inkscape::Drawing::unsnapshot | ( | ) |
Definition at line 272 of file drawing.cpp.
References _funclog, and _snapshotted.
void Inkscape::Drawing::update | ( | Geom::IntRect const & | area = Geom::IntRect::infinite() , |
Geom::Affine const & | affine = Geom::identity() , |
||
unsigned | flags = DrawingItem::STATE_ALL , |
||
unsigned | reset = 0 |
||
) |
Definition at line 228 of file drawing.cpp.
References _pickItemsForCaching(), _root, Inkscape::DrawingItem::STATE_CACHE, and Inkscape::DrawingItem::update().
Referenced by Inkscape::ObjectSet::chameleonFill(), SPMeshNodeArray::color_pick(), render_surface(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_generate_internal_bitmap(), and Inkscape::UI::Dialog::sp_icon_doc_icon().
|
inline |
Definition at line 77 of file drawing.h.
References _use_dithering.
|
friend |
|
private |
Definition at line 122 of file drawing.h.
Referenced by Inkscape::DrawingItem::render(), render(), and setAntialiasingOverride().
|
private |
Definition at line 115 of file drawing.h.
Referenced by _loadPrefs(), blurQuality(), and setBlurQuality().
|
private |
Maximum allowed size of cache.
Definition at line 118 of file drawing.h.
Referenced by _loadPrefs(), _pickItemsForCaching(), and setCacheBudget().
|
private |
Definition at line 119 of file drawing.h.
Referenced by cacheLimit(), and setCacheLimit().
|
private |
Definition at line 124 of file drawing.h.
Referenced by _clearCache(), _pickItemsForCaching(), Inkscape::DrawingItem::_setCached(), and setCacheLimit().
|
private |
Definition at line 125 of file drawing.h.
Referenced by _pickItemsForCaching(), Inkscape::DrawingItem::update(), and Inkscape::DrawingItem::~DrawingItem().
|
private |
Definition at line 103 of file drawing.h.
Referenced by _loadPrefs(), and getCanvasItemDrawing().
|
private |
|
private |
Definition at line 110 of file drawing.h.
Referenced by _loadPrefs(), clipOutlineColor(), and setClipOutlineColor().
|
private |
Definition at line 107 of file drawing.h.
Referenced by colorMode(), and setColorMode().
|
private |
Definition at line 117 of file drawing.h.
Referenced by _loadPrefs(), cursorTolerance(), and setCursorTolerance().
|
private |
Definition at line 114 of file drawing.h.
Referenced by _loadPrefs(), filterQuality(), and setFilterQuality().
|
private |
Definition at line 135 of file drawing.h.
Referenced by defer(), and unsnapshot().
|
private |
Definition at line 109 of file drawing.h.
Referenced by grayscaleMatrix(), and setGrayscaleMatrix().
|
private |
Definition at line 112 of file drawing.h.
Referenced by _loadPrefs(), imageOutlineColor(), and setImageOutlineColor().
|
private |
Always draw images as images, even in outline mode.
Definition at line 113 of file drawing.h.
Referenced by _loadPrefs(), imageOutlineMode(), setColorMode(), setImageOutlineColor(), and setImageOutlineMode().
|
private |
Definition at line 111 of file drawing.h.
Referenced by _loadPrefs(), maskOutlineColor(), and setMaskOutlineColor().
|
private |
Definition at line 108 of file drawing.h.
Referenced by outlineOverlay(), setClipOutlineColor(), setImageOutlineColor(), setImageOutlineMode(), setMaskOutlineColor(), and setOutlineOverlay().
|
private |
Definition at line 104 of file drawing.h.
Referenced by _loadPrefs().
|
private |
Definition at line 106 of file drawing.h.
Referenced by render(), renderMode(), setBlurQuality(), setClipOutlineColor(), setColorMode(), setDithering(), setFilterQuality(), setGrayscaleMatrix(), setImageOutlineColor(), setImageOutlineMode(), setMaskOutlineColor(), and setRenderMode().
|
private |
Definition at line 102 of file drawing.h.
Referenced by pick(), render(), root(), setAntialiasingOverride(), setBlurQuality(), setClip(), setClipOutlineColor(), setColorMode(), setDithering(), setFilterQuality(), setGrayscaleMatrix(), setImageOutlineColor(), setImageOutlineMode(), setMaskOutlineColor(), setOpacity(), setOutlineOverlay(), setRenderMode(), setRoot(), Inkscape::DrawingItem::unlink(), update(), and ~Drawing().
|
private |
Definition at line 121 of file drawing.h.
Referenced by _loadPrefs(), selectZeroOpacity(), and setSelectZeroOpacity().
|
private |
Definition at line 134 of file drawing.h.
Referenced by defer(), snapshot(), snapshotted(), and unsnapshot().
|
private |
Definition at line 116 of file drawing.h.
Referenced by _loadPrefs(), Inkscape::DrawingItem::render(), render(), setDithering(), and useDithering().