Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
Inkscape::Drawing Class Reference

#include <drawing.h>

Public Member Functions

 Drawing (CanvasItemDrawing *drawing=nullptr)
 
 Drawing (Drawing const &)=delete
 
Drawingoperator= (Drawing const &)=delete
 
 ~Drawing ()
 
void setRoot (DrawingItem *root)
 
DrawingItemroot ()
 
CanvasItemDrawinggetCanvasItemDrawing ()
 
void setRenderMode (RenderMode)
 
void setColorMode (ColorMode)
 
void setOutlineOverlay (bool)
 
void setGrayscaleMatrix (double[20])
 
void setClipOutlineColor (uint32_t)
 
void setMaskOutlineColor (uint32_t)
 
void setImageOutlineColor (uint32_t)
 
void setImageOutlineMode (bool)
 
void setFilterQuality (int)
 
void setBlurQuality (int)
 
void setDithering (bool)
 
void setCursorTolerance (double tol)
 
void setSelectZeroOpacity (bool select_zero_opacity)
 
void setCacheBudget (size_t bytes)
 
void setCacheLimit (Geom::OptIntRect const &rect)
 
void setClip (std::optional< Geom::PathVector > &&clip)
 
void setAntialiasingOverride (std::optional< Antialiasing > antialiasing_override)
 
RenderMode renderMode () const
 
ColorMode colorMode () const
 
bool outlineOverlay () const
 
auto & grayscaleMatrix () const
 
uint32_t clipOutlineColor () const
 
uint32_t maskOutlineColor () const
 
uint32_t imageOutlineColor () const
 
bool imageOutlineMode () const
 
int filterQuality () const
 
int blurQuality () const
 
bool useDithering () const
 
double cursorTolerance () const
 
bool selectZeroOpacity () const
 
Geom::OptIntRect const & cacheLimit () const
 
void update (Geom::IntRect const &area=Geom::IntRect::infinite(), Geom::Affine const &affine=Geom::identity(), unsigned flags=DrawingItem::STATE_ALL, unsigned reset=0)
 
void render (DrawingContext &dc, Geom::IntRect const &area, unsigned flags=0) const
 
DrawingItempick (Geom::Point const &p, double delta, unsigned flags)
 
void snapshot ()
 
void unsnapshot ()
 
bool snapshotted () const
 
Colors::Color averageColor (Geom::IntRect const &area) const
 
Colors::Color averageColor (Geom::PathVector const &path, bool evenodd) const
 
void setExact ()
 
void setOpacity (double opacity=1.0)
 

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
 

Detailed Description

Definition at line 37 of file drawing.h.

Constructor & Destructor Documentation

◆ Drawing() [1/2]

Inkscape::Drawing::Drawing ( Inkscape::CanvasItemDrawing canvas_item_drawing = nullptr)

Definition at line 52 of file drawing.cpp.

References _loadPrefs().

◆ Drawing() [2/2]

Inkscape::Drawing::Drawing ( Drawing const &  )
delete

◆ ~Drawing()

Inkscape::Drawing::~Drawing ( )

Definition at line 59 of file drawing.cpp.

References _root.

Member Function Documentation

◆ _clearCache()

void Inkscape::Drawing::_clearCache ( )
private

◆ _loadPrefs()

◆ _pickItemsForCaching()

void Inkscape::Drawing::_pickItemsForCaching ( )
private

Definition at line 279 of file drawing.cpp.

References _cache_budget, _cached_items, _candidate_items, item, and used.

Referenced by setCacheBudget(), and update().

◆ averageColor() [1/2]

◆ averageColor() [2/2]

Colors::Color Inkscape::Drawing::averageColor ( Geom::PathVector const &  path,
bool  evenodd 
) const

◆ blurQuality()

int Inkscape::Drawing::blurQuality ( ) const
inline

Definition at line 76 of file drawing.h.

References _blur_quality.

◆ cacheLimit()

Geom::OptIntRect const & Inkscape::Drawing::cacheLimit ( ) const
inline

Definition at line 80 of file drawing.h.

References _cache_limit.

Referenced by Inkscape::DrawingItem::_cacheRect().

◆ clipOutlineColor()

uint32_t Inkscape::Drawing::clipOutlineColor ( ) const
inline

Definition at line 71 of file drawing.h.

References _clip_outline_color.

Referenced by Inkscape::DrawingItem::_renderOutline().

◆ colorMode()

ColorMode Inkscape::Drawing::colorMode ( ) const
inline

Definition at line 68 of file drawing.h.

References _colormode.

Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingItem::render().

◆ cursorTolerance()

double Inkscape::Drawing::cursorTolerance ( ) const
inline

Definition at line 78 of file drawing.h.

References _cursor_tolerance.

◆ defer()

◆ filterQuality()

int Inkscape::Drawing::filterQuality ( ) const
inline

Definition at line 75 of file drawing.h.

References _filter_quality.

◆ getCanvasItemDrawing()

◆ grayscaleMatrix()

auto & Inkscape::Drawing::grayscaleMatrix ( ) const
inline

Definition at line 70 of file drawing.h.

References _grayscale_matrix.

Referenced by Inkscape::DrawingImage::_renderItem(), and Inkscape::DrawingItem::render().

◆ imageOutlineColor()

uint32_t Inkscape::Drawing::imageOutlineColor ( ) const
inline

Definition at line 73 of file drawing.h.

References _image_outline_color.

Referenced by Inkscape::DrawingImage::_renderItem().

◆ imageOutlineMode()

bool Inkscape::Drawing::imageOutlineMode ( ) const
inline

◆ maskOutlineColor()

uint32_t Inkscape::Drawing::maskOutlineColor ( ) const
inline

Definition at line 72 of file drawing.h.

References _mask_outline_color.

Referenced by Inkscape::DrawingItem::_renderOutline().

◆ operator=()

Drawing & Inkscape::Drawing::operator= ( Drawing const &  )
delete

◆ outlineOverlay()

bool Inkscape::Drawing::outlineOverlay ( ) const
inline

◆ pick()

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().

◆ render()

◆ renderMode()

◆ root()

◆ selectZeroOpacity()

bool Inkscape::Drawing::selectZeroOpacity ( ) const
inline

Definition at line 79 of file drawing.h.

References _select_zero_opacity.

Referenced by Inkscape::DrawingShape::_pickItem().

◆ setAntialiasingOverride()

◆ setBlurQuality()

void Inkscape::Drawing::setBlurQuality ( int  quality)

◆ setCacheBudget()

void Inkscape::Drawing::setCacheBudget ( size_t  bytes)

Definition at line 192 of file drawing.cpp.

References _cache_budget, _pickItemsForCaching(), and defer().

Referenced by _loadPrefs().

◆ setCacheLimit()

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.

◆ setClip()

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().

◆ setClipOutlineColor()

void Inkscape::Drawing::setClipOutlineColor ( uint32_t  col)

◆ setColorMode()

◆ setCursorTolerance()

void Inkscape::Drawing::setCursorTolerance ( double  tol)
inline

Definition at line 60 of file drawing.h.

References _cursor_tolerance.

Referenced by _loadPrefs(), and Inkscape::UI::View::SVGViewWidget::SVGViewWidget().

◆ setDithering()

void Inkscape::Drawing::setDithering ( bool  use_dithering)

◆ setExact()

◆ setFilterQuality()

void Inkscape::Drawing::setFilterQuality ( int  quality)

◆ setGrayscaleMatrix()

void Inkscape::Drawing::setGrayscaleMatrix ( double  value_matrix[20])

◆ setImageOutlineColor()

void Inkscape::Drawing::setImageOutlineColor ( uint32_t  col)

◆ setImageOutlineMode()

void Inkscape::Drawing::setImageOutlineMode ( bool  enabled)

◆ setMaskOutlineColor()

void Inkscape::Drawing::setMaskOutlineColor ( uint32_t  col)

◆ setOpacity()

void Inkscape::Drawing::setOpacity ( double  opacity = 1.0)

Definition at line 432 of file drawing.cpp.

References _root, and Inkscape::DrawingItem::setOpacity().

◆ setOutlineOverlay()

void Inkscape::Drawing::setOutlineOverlay ( bool  outlineoverlay)

◆ setRenderMode()

◆ setRoot()

◆ setSelectZeroOpacity()

void Inkscape::Drawing::setSelectZeroOpacity ( bool  select_zero_opacity)
inline

Definition at line 61 of file drawing.h.

References _select_zero_opacity.

Referenced by _loadPrefs().

◆ snapshot()

void Inkscape::Drawing::snapshot ( )

Definition at line 266 of file drawing.cpp.

References _snapshotted.

◆ snapshotted()

bool Inkscape::Drawing::snapshotted ( ) const
inline

Definition at line 89 of file drawing.h.

References _snapshotted.

Referenced by Inkscape::DrawingText::addComponent(), and Inkscape::DrawingGlyphs::setGlyph().

◆ unsnapshot()

void Inkscape::Drawing::unsnapshot ( )

Definition at line 272 of file drawing.cpp.

References _funclog, and _snapshotted.

◆ update()

◆ useDithering()

bool Inkscape::Drawing::useDithering ( ) const
inline

Definition at line 77 of file drawing.h.

References _use_dithering.

Friends And Related Symbol Documentation

◆ DrawingItem

friend class DrawingItem
friend

Definition at line 140 of file drawing.h.

Member Data Documentation

◆ _antialiasing_override

std::optional<Antialiasing> Inkscape::Drawing::_antialiasing_override
private

Definition at line 122 of file drawing.h.

Referenced by Inkscape::DrawingItem::render(), render(), and setAntialiasingOverride().

◆ _blur_quality

int Inkscape::Drawing::_blur_quality
private

Definition at line 115 of file drawing.h.

Referenced by _loadPrefs(), blurQuality(), and setBlurQuality().

◆ _cache_budget

size_t Inkscape::Drawing::_cache_budget
private

Maximum allowed size of cache.

Definition at line 118 of file drawing.h.

Referenced by _loadPrefs(), _pickItemsForCaching(), and setCacheBudget().

◆ _cache_limit

Geom::OptIntRect Inkscape::Drawing::_cache_limit
private

Definition at line 119 of file drawing.h.

Referenced by cacheLimit(), and setCacheLimit().

◆ _cached_items

std::set<DrawingItem*> Inkscape::Drawing::_cached_items
private

◆ _candidate_items

CacheList Inkscape::Drawing::_candidate_items
private

◆ _canvas_item_drawing

CanvasItemDrawing* Inkscape::Drawing::_canvas_item_drawing = nullptr
private

Definition at line 103 of file drawing.h.

Referenced by _loadPrefs(), and getCanvasItemDrawing().

◆ _clip

std::optional<Geom::PathVector> Inkscape::Drawing::_clip
private

Definition at line 120 of file drawing.h.

Referenced by render(), and setClip().

◆ _clip_outline_color

uint32_t Inkscape::Drawing::_clip_outline_color
private

Definition at line 110 of file drawing.h.

Referenced by _loadPrefs(), clipOutlineColor(), and setClipOutlineColor().

◆ _colormode

ColorMode Inkscape::Drawing::_colormode = ColorMode::NORMAL
private

Definition at line 107 of file drawing.h.

Referenced by colorMode(), and setColorMode().

◆ _cursor_tolerance

double Inkscape::Drawing::_cursor_tolerance
private

Definition at line 117 of file drawing.h.

Referenced by _loadPrefs(), cursorTolerance(), and setCursorTolerance().

◆ _filter_quality

int Inkscape::Drawing::_filter_quality
private

Definition at line 114 of file drawing.h.

Referenced by _loadPrefs(), filterQuality(), and setFilterQuality().

◆ _funclog

Util::FuncLog Inkscape::Drawing::_funclog
private

Definition at line 135 of file drawing.h.

Referenced by defer(), and unsnapshot().

◆ _grayscale_matrix

Filters::FilterColorMatrix::ColorMatrixMatrix Inkscape::Drawing::_grayscale_matrix
private

Definition at line 109 of file drawing.h.

Referenced by grayscaleMatrix(), and setGrayscaleMatrix().

◆ _image_outline_color

uint32_t Inkscape::Drawing::_image_outline_color
private

Definition at line 112 of file drawing.h.

Referenced by _loadPrefs(), imageOutlineColor(), and setImageOutlineColor().

◆ _image_outline_mode

bool Inkscape::Drawing::_image_outline_mode
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().

◆ _mask_outline_color

uint32_t Inkscape::Drawing::_mask_outline_color
private

Definition at line 111 of file drawing.h.

Referenced by _loadPrefs(), maskOutlineColor(), and setMaskOutlineColor().

◆ _outlineoverlay

bool Inkscape::Drawing::_outlineoverlay = false
private

◆ _pref_tracker

std::unique_ptr<Preferences::PreferencesObserver> Inkscape::Drawing::_pref_tracker
private

Definition at line 104 of file drawing.h.

Referenced by _loadPrefs().

◆ _rendermode

◆ _root

◆ _select_zero_opacity

bool Inkscape::Drawing::_select_zero_opacity
private

Definition at line 121 of file drawing.h.

Referenced by _loadPrefs(), selectZeroOpacity(), and setSelectZeroOpacity().

◆ _snapshotted

bool Inkscape::Drawing::_snapshotted = false
private

Definition at line 134 of file drawing.h.

Referenced by defer(), snapshot(), snapshotted(), and unsnapshot().

◆ _use_dithering

bool Inkscape::Drawing::_use_dithering
private

◆ cacheline_separator

char Inkscape::Drawing::cacheline_separator[127]
private

Definition at line 132 of file drawing.h.


The documentation for this class was generated from the following files: