Inkscape
Vector Graphics Editor
|
Go to the source code of this file.
Namespaces | |
namespace | Inkscape |
Helper class to stream background task notifications as a series of messages. | |
Functions | |
static bool | Inkscape::_workaround_issue_70__gdk_pixbuf_loader_write (GdkPixbufLoader *loader, guchar *decoded, gsize decoded_len, GError **error) |
Incremental file read introduced to workaround https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/70. | |
static void | feed_curve_to_cairo (cairo_t *cr, Geom::Curve const &c, Geom::Affine const &trans, Geom::Rect const &view, bool optimize_stroke) |
static void | feed_path_to_cairo (cairo_t *ct, Geom::Path const &path) |
Feeds path-creating calls to the cairo context translating them from the Path. | |
static void | feed_path_to_cairo (cairo_t *ct, Geom::Path const &path, Geom::Affine trans, Geom::OptRect area, bool optimize_stroke, double stroke_width) |
Feeds path-creating calls to the cairo context translating them from the Path, with the given transform and shift. | |
void | feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv, Geom::Affine trans, Geom::OptRect area, bool optimize_stroke, double stroke_width) |
Feeds path-creating calls to the cairo context translating them from the PathVector, with the given transform and shift One must have done cairo_new_path(ct); before calling this function. | |
void | feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv) |
Feeds path-creating calls to the cairo context translating them from the PathVector One must have done cairo_new_path(ct); before calling this function. | |
std::optional< Geom::PathVector > | extract_pathvector_from_cairo (cairo_t *ct) |
SPColorInterpolation | get_cairo_surface_ci (cairo_surface_t *surface) |
void | set_cairo_surface_ci (cairo_surface_t *surface, SPColorInterpolation ci) |
Set the color_interpolation_value for a Cairo surface. | |
void | copy_cairo_surface_ci (cairo_surface_t *in, cairo_surface_t *out) |
void | ink_cairo_set_source_rgba32 (cairo_t *ct, guint32 rgba) |
void | ink_cairo_set_source_rgba32 (Cairo::RefPtr< Cairo::Context > ctx, guint32 rgba) |
void | ink_cairo_set_source_rgba32 (Cairo::Context &ctx, guint32 rgba) |
void | ink_cairo_set_source_color (Cairo::RefPtr< Cairo::Context > ctx, Inkscape::Colors::Color const &color, double opacity) |
The following functions interact between Inkscape color model, and cairo surface rendering. | |
void | ink_cairo_set_source_color (cairo_t *ctx, Inkscape::Colors::Color const &color, double opacity) |
void | ink_cairo_pattern_add_color_stop (cairo_pattern_t *ptn, double offset, Inkscape::Colors::Color const &color, double opacity) |
cairo_pattern_t * | ink_cairo_pattern_create (Inkscape::Colors::Color const &color, double opacity) |
void | ink_matrix_to_2geom (Geom::Affine &m, cairo_matrix_t const &cm) |
void | ink_matrix_to_cairo (cairo_matrix_t &cm, Geom::Affine const &m) |
Geom::Affine | ink_matrix_to_2geom (cairo_matrix_t const &cairo_matrix) |
void | ink_cairo_transform (cairo_t *ct, Geom::Affine const &m) |
void | ink_cairo_pattern_set_matrix (cairo_pattern_t *cp, Geom::Affine const &m) |
void | ink_cairo_set_hairline (cairo_t *ct) |
void | ink_cairo_pattern_set_dither (cairo_pattern_t *pattern, bool enabled) |
cairo_surface_t * | ink_cairo_surface_copy (cairo_surface_t *s) |
Create an exact copy of a surface. | |
Cairo::RefPtr< Cairo::ImageSurface > | ink_cairo_surface_copy (Cairo::RefPtr< Cairo::ImageSurface > surface) |
Create an exact copy of an image surface. | |
cairo_surface_t * | ink_cairo_surface_create_identical (cairo_surface_t *s) |
Create a surface that differs only in pixel content. | |
cairo_surface_t * | ink_cairo_surface_create_same_size (cairo_surface_t *s, cairo_content_t c) |
cairo_surface_t * | ink_cairo_extract_alpha (cairo_surface_t *s) |
Extract the alpha channel into a new surface. | |
cairo_surface_t * | ink_cairo_surface_create_output (cairo_surface_t *image, cairo_surface_t *bg) |
void | ink_cairo_surface_blit (cairo_surface_t *src, cairo_surface_t *dest) |
int | ink_cairo_surface_get_width (cairo_surface_t *surface) |
Return width in pixels. | |
int | ink_cairo_surface_get_height (cairo_surface_t *surface) |
Return height in pixels. | |
static double | ink_cairo_surface_average_color_internal (cairo_surface_t *surface, cairo_surface_t *mask, double &rf, double &gf, double &bf, double &af) |
guint32 | ink_cairo_pattern_get_argb32 (cairo_pattern_t *pattern) |
Colors::Color | ink_cairo_surface_average_color (cairo_surface_t *surface, cairo_surface_t *mask) |
Get the average color from the given surface. | |
static guint32 | srgb_to_linear (const guint32 c, const guint32 a) |
static guint32 | linear_to_srgb (const guint32 c, const guint32 a) |
static uint32_t | srgb_to_linear_argb32 (uint32_t in) |
int | ink_cairo_surface_srgb_to_linear (cairo_surface_t *surface) |
static uint32_t | linear_to_srgb_argb32 (uint32_t in) |
SPBlendMode | ink_cairo_operator_to_css_blend (cairo_operator_t cairo_operator) |
cairo_operator_t | ink_css_blend_to_cairo_operator (SPBlendMode css_blend) |
int | ink_cairo_surface_linear_to_srgb (cairo_surface_t *surface) |
Cairo::RefPtr< Cairo::Pattern > | ink_cairo_pattern_create_slanting_stripes (uint32_t color) |
cairo_pattern_t * | ink_cairo_pattern_create_checkerboard (guint32 rgba, bool use_alpha) |
void | ink_cairo_draw_drop_shadow (const Cairo::RefPtr< Cairo::Context > &ctx, const Geom::Rect &rect, double size, guint32 color, double color_alpha) |
Draw drop shadow around the 'rect' with given 'size' and 'color'; shadow extends to the right and bottom of rect. | |
GdkPixbuf * | ink_pixbuf_create_from_cairo_surface (cairo_surface_t *s) |
Converts the Cairo surface to a GdkPixbuf pixel format, without allocating extra memory. | |
void | ink_cairo_pixbuf_cleanup (guchar *, void *data) |
Cleanup function for GdkPixbuf. | |
guint32 | argb32_from_pixbuf (guint32 c) |
guint32 | pixbuf_from_argb32 (guint32 c, guint32 bgcolor) |
Convert one pixel from ARGB to GdkPixbuf format. | |
void | convert_pixels_pixbuf_to_argb32 (guchar *data, int w, int h, int stride) |
Convert pixel data from GdkPixbuf format to ARGB. | |
void | convert_pixels_argb32_to_pixbuf (guchar *data, int w, int h, int stride, guint32 bgcolor) |
Convert pixel data from ARGB to GdkPixbuf format. | |
guint32 | argb32_from_rgba (guint32 in) |
Convert a pixel in 0xRRGGBBAA format to Cairo ARGB32 format. | |
guint32 | rgba_from_argb32 (guint32 c) |
Convert one pixel from ARGB to GdkPixbuf format. | |
static constexpr uint16_t | get_luminance (uint32_t r, uint32_t g, uint32_t b) |
const guchar * | pixbuf_to_png (guchar const **rows, guchar *px, int num_rows, int num_cols, int stride, int color_type, int bit_depth) |
Converts a pixbuf to a PNG data structure. | |
Variables | |
static cairo_user_data_key_t | ink_color_interpolation_key |
Key for cairo_surface_t to keep track of current color interpolation value Only the address of the structure is used, it is never initialized. | |
Definition at line 1703 of file cairo-utils.cpp.
References c, and premul_alpha().
Referenced by convert_pixels_pixbuf_to_argb32().
Convert a pixel in 0xRRGGBBAA format to Cairo ARGB32 format.
Definition at line 1813 of file cairo-utils.cpp.
References premul_alpha().
void convert_pixels_argb32_to_pixbuf | ( | guchar * | data, |
int | w, | ||
int | h, | ||
int | stride, | ||
guint32 | bgcolor | ||
) |
Convert pixel data from ARGB to GdkPixbuf format.
This will convert pixel data from GdkPixbuf format to Cairo's native pixel format. This involves premultiplying alpha and shuffling around the channels.
Definition at line 1799 of file cairo-utils.cpp.
References data, pixbuf_from_argb32(), stride, and w.
Referenced by Inkscape::Pixbuf::ensure_pixbuf(), ink_pixbuf_create_from_cairo_surface(), and sp_export_get_rows().
void convert_pixels_pixbuf_to_argb32 | ( | guchar * | data, |
int | w, | ||
int | h, | ||
int | stride | ||
) |
Convert pixel data from GdkPixbuf format to ARGB.
This will convert pixel data from GdkPixbuf format to Cairo's native pixel format. This involves premultiplying alpha and shuffling around the channels. Pixbuf data must have an alpha channel, otherwise the results are undefined (usually a segfault).
Definition at line 1778 of file cairo-utils.cpp.
References argb32_from_pixbuf(), data, stride, and w.
Referenced by Inkscape::Pixbuf::ensure_argb32().
void copy_cairo_surface_ci | ( | cairo_surface_t * | in, |
cairo_surface_t * | out | ||
) |
Definition at line 1003 of file cairo-utils.cpp.
References ink_color_interpolation_key.
Referenced by Inkscape::Filters::FilterSlot::get_result(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), and Inkscape::Filters::FilterTile::render_cairo().
std::optional< Geom::PathVector > extract_pathvector_from_cairo | ( | cairo_t * | ct | ) |
Definition at line 925 of file cairo-utils.cpp.
References end, and Geom::Point::length().
Referenced by Inkscape::Extension::Internal::SvgBuilder::_renderText().
|
static |
Definition at line 703 of file cairo-utils.cpp.
References c, cairo_curve_to(), cairo_line_to(), cairo_move_to(), Geom::BezierCurve::controlPoint(), Geom::cubicbezierpath_from_sbasis(), Geom::GenericRect< C >::expandTo(), feed_curve_to_cairo(), geom_to_cairo(), Geom::GenericRect< C >::intersects(), order, Geom::X, and Geom::Y.
Referenced by feed_curve_to_cairo(), feed_path_to_cairo(), and feed_path_to_cairo().
|
static |
Feeds path-creating calls to the cairo context translating them from the Path.
Definition at line 826 of file cairo-utils.cpp.
References Geom::Path::begin(), cairo_move_to(), Geom::Path::closed(), Geom::Path::empty(), Geom::Path::end_open(), feed_curve_to_cairo(), Geom::identity(), and Geom::Path::initialPoint().
Referenced by feed_pathvector_to_cairo(), and feed_pathvector_to_cairo().
|
static |
Feeds path-creating calls to the cairo context translating them from the Path, with the given transform and shift.
Definition at line 844 of file cairo-utils.cpp.
References Geom::Path::begin(), cairo_line_to(), cairo_move_to(), Geom::Path::closed(), Geom::Path::empty(), Geom::Path::end_open(), Geom::GenericRect< C >::expandBy(), feed_curve_to_cairo(), Geom::Path::initialPoint(), and shift().
void feed_pathvector_to_cairo | ( | cairo_t * | ct, |
Geom::PathVector const & | pathv | ||
) |
Feeds path-creating calls to the cairo context translating them from the PathVector One must have done cairo_new_path(ct); before calling this function.
Definition at line 907 of file cairo-utils.cpp.
References Geom::PathVector::empty(), and feed_path_to_cairo().
void feed_pathvector_to_cairo | ( | cairo_t * | ct, |
Geom::PathVector const & | pathv, | ||
Geom::Affine | trans, | ||
Geom::OptRect | area, | ||
bool | optimize_stroke, | ||
double | stroke_width | ||
) |
Feeds path-creating calls to the cairo context translating them from the PathVector, with the given transform and shift One must have done cairo_new_path(ct); before calling this function.
Definition at line 892 of file cairo-utils.cpp.
References Geom::PathVector::empty(), and feed_path_to_cairo().
Referenced by Inkscape::CanvasItemBpath::_render(), Inkscape::Extension::Internal::CairoRenderContext::addPathVector(), Inkscape::DrawingContext::path(), and SvgFont::render_glyph_path().
SPColorInterpolation get_cairo_surface_ci | ( | cairo_surface_t * | surface | ) |
Definition at line 971 of file cairo-utils.cpp.
References data, ink_color_interpolation_key, SP_CSS_COLOR_INTERPOLATION_AUTO, and surface.
Referenced by set_cairo_surface_ci().
|
staticconstexpr |
Definition at line 1849 of file cairo-utils.cpp.
Referenced by Inkscape::UI::Widget::ColorPreview::draw_func(), Inkscape::Util::is_current_theme_dark(), Inkscape::UI::ThemeContext::isCurrentThemeDark(), and pixbuf_to_png().
void ink_cairo_draw_drop_shadow | ( | const Cairo::RefPtr< Cairo::Context > & | ctx, |
const Geom::Rect & | rect, | ||
double | size, | ||
guint32 | color, | ||
double | color_alpha | ||
) |
Draw drop shadow around the 'rect' with given 'size' and 'color'; shadow extends to the right and bottom of rect.
Definition at line 1578 of file cairo-utils.cpp.
References Geom::GenericRect< C >::corner(), corners, Geom::GenericRect< C >::height(), N, size, SP_RGBA32_B_F(), SP_RGBA32_G_F(), SP_RGBA32_R_F(), Geom::GenericRect< C >::width(), Geom::X, and Geom::Y.
Referenced by Inkscape::CanvasItemRect::_render(), Inkscape::UI::Dialog::add_shadow(), and Inkscape::UI::Widget::PageSizePreview::draw_func().
cairo_surface_t * ink_cairo_extract_alpha | ( | cairo_surface_t * | s | ) |
Extract the alpha channel into a new surface.
Creates a surface with a content type of CAIRO_CONTENT_ALPHA that contains the alpha values of pixels from s.
Definition at line 1197 of file cairo-utils.cpp.
References ink_cairo_surface_create_same_size().
Referenced by Inkscape::Filters::FilterSlot::getcairo().
SPBlendMode ink_cairo_operator_to_css_blend | ( | cairo_operator_t | cairo_operator | ) |
Definition at line 1424 of file cairo-utils.cpp.
References SP_CSS_BLEND_COLOR, SP_CSS_BLEND_COLORBURN, SP_CSS_BLEND_COLORDODGE, SP_CSS_BLEND_DARKEN, SP_CSS_BLEND_DIFFERENCE, SP_CSS_BLEND_EXCLUSION, SP_CSS_BLEND_HARDLIGHT, SP_CSS_BLEND_HUE, SP_CSS_BLEND_LIGHTEN, SP_CSS_BLEND_LUMINOSITY, SP_CSS_BLEND_MULTIPLY, SP_CSS_BLEND_NORMAL, SP_CSS_BLEND_OVERLAY, SP_CSS_BLEND_SATURATION, SP_CSS_BLEND_SCREEN, and SP_CSS_BLEND_SOFTLIGHT.
void ink_cairo_pattern_add_color_stop | ( | cairo_pattern_t * | ptn, |
double | offset, | ||
Inkscape::Colors::Color const & | color, | ||
double | opacity | ||
) |
Definition at line 1037 of file cairo-utils.cpp.
References c, offset, SP_RGBA32_A_F(), SP_RGBA32_B_F(), SP_RGBA32_G_F(), SP_RGBA32_R_F(), and Inkscape::Colors::Color::toRGBA().
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createPatternForPaintServer(), Inkscape::DrawingLinearGradient::create_pattern(), Inkscape::DrawingRadialGradient::create_pattern(), SPGradient::create_preview_pattern(), and sp_gradient_pattern_common_setup().
cairo_pattern_t * ink_cairo_pattern_create | ( | Inkscape::Colors::Color const & | color, |
double | opacity | ||
) |
Definition at line 1042 of file cairo-utils.cpp.
References c, SP_RGBA32_A_F(), SP_RGBA32_B_F(), SP_RGBA32_G_F(), SP_RGBA32_R_F(), and Inkscape::Colors::Color::toRGBA().
Referenced by Inkscape::DrawingSolidColor::create_pattern(), and Inkscape::NRStyle::preparePaint().
cairo_pattern_t * ink_cairo_pattern_create_checkerboard | ( | guint32 | rgba, |
bool | use_alpha | ||
) |
Definition at line 1544 of file cairo-utils.cpp.
References cairo_rectangle(), ink_cairo_set_source_color(), Inkscape::Colors::make_contrasted_color(), and w.
Referenced by Inkscape::UI::Widget::create_checkerboard_pattern(), Inkscape::UI::Widget::draw_circle(), Inkscape::UI::Dialog::ColorItem::draw_color(), Inkscape::UI::Widget::PageSizePreview::draw_func(), Inkscape::UI::Preview::render_preview(), render_surface(), sp_generate_internal_bitmap(), sp_gradient_draw(), and sp_gradstop_to_pixbuf_ref().
Cairo::RefPtr< Cairo::Pattern > ink_cairo_pattern_create_slanting_stripes | ( | uint32_t | color | ) |
Definition at line 1524 of file cairo-utils.cpp.
References ink_cairo_set_source_rgba32(), surface, and width.
Referenced by get_cached_pattern().
guint32 ink_cairo_pattern_get_argb32 | ( | cairo_pattern_t * | pattern | ) |
Definition at line 1316 of file cairo-utils.cpp.
References SP_RGBA32_F_COMPOSE(), and surface.
void ink_cairo_pattern_set_dither | ( | cairo_pattern_t * | pattern, |
bool | enabled | ||
) |
Definition at line 1105 of file cairo-utils.cpp.
void ink_cairo_pattern_set_matrix | ( | cairo_pattern_t * | cp, |
Geom::Affine const & | m | ||
) |
Definition at line 1085 of file cairo-utils.cpp.
References ink_matrix_to_cairo().
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createHatchPainter(), Inkscape::DrawingGradient::common_setup(), Inkscape::DrawingMeshGradient::create_pattern(), Inkscape::DrawingPattern::renderPattern(), and sp_gradient_pattern_common_setup().
void ink_cairo_pixbuf_cleanup | ( | guchar * | , |
void * | data | ||
) |
Cleanup function for GdkPixbuf.
This function should be passed as the GdkPixbufDestroyNotify parameter to gdk_pixbuf_new_from_data when creating a GdkPixbuf backed by a Cairo surface.
Definition at line 1693 of file cairo-utils.cpp.
Referenced by ink_pixbuf_create_from_cairo_surface().
void ink_cairo_set_hairline | ( | cairo_t * | ct | ) |
Definition at line 1093 of file cairo-utils.cpp.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_setStrokeStyle(), and Inkscape::DrawingContext::setHairline().
void ink_cairo_set_source_color | ( | Cairo::RefPtr< Cairo::Context > | ctx, |
Inkscape::Colors::Color const & | color, | ||
double | opacity | ||
) |
The following functions interact between Inkscape color model, and cairo surface rendering.
for compatability we only convert to RGB and use that directly.
Definition at line 1029 of file cairo-utils.cpp.
References ink_cairo_set_source_rgba32(), and Inkscape::Colors::Color::toRGBA().
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_setFillStyle(), Inkscape::Extension::Internal::CairoRenderContext::_setStrokeStyle(), Inkscape::UI::Widget::draw_circle(), Inkscape::UI::Dialog::ColorItem::draw_color(), ink_cairo_pattern_create_checkerboard(), Inkscape::UI::Widget::OKWheel::on_drawing_area_draw(), Inkscape::UI::Widget::ColorTagRenderer::snapshot_vfunc(), and sp_gradstop_to_pixbuf_ref().
void ink_cairo_set_source_color | ( | cairo_t * | ctx, |
Inkscape::Colors::Color const & | color, | ||
double | opacity | ||
) |
Definition at line 1033 of file cairo-utils.cpp.
References ink_cairo_set_source_rgba32(), and Inkscape::Colors::Color::toRGBA().
void ink_cairo_set_source_rgba32 | ( | Cairo::Context & | ctx, |
guint32 | rgba | ||
) |
Definition at line 1020 of file cairo-utils.cpp.
References SP_RGBA32_A_F(), SP_RGBA32_B_F(), SP_RGBA32_G_F(), and SP_RGBA32_R_F().
void ink_cairo_set_source_rgba32 | ( | Cairo::RefPtr< Cairo::Context > | ctx, |
guint32 | rgba | ||
) |
Definition at line 1014 of file cairo-utils.cpp.
References SP_RGBA32_A_F(), SP_RGBA32_B_F(), SP_RGBA32_G_F(), and SP_RGBA32_R_F().
Definition at line 1008 of file cairo-utils.cpp.
References cairo_set_source_rgba(), SP_RGBA32_A_F(), SP_RGBA32_B_F(), SP_RGBA32_G_F(), and SP_RGBA32_R_F().
Referenced by Inkscape::CanvasItemBpath::_render(), Inkscape::CanvasItemCurve::_render(), Inkscape::CanvasItemQuad::_render(), Inkscape::CanvasItemRect::_render(), Inkscape::CanvasItemText::_render(), Inkscape::UI::Widget::ColorPreview::draw_func(), ink_cairo_pattern_create_slanting_stripes(), ink_cairo_set_source_color(), ink_cairo_set_source_color(), and Inkscape::DrawingContext::setSource().
Colors::Color ink_cairo_surface_average_color | ( | cairo_surface_t * | surface, |
cairo_surface_t * | mask | ||
) |
Get the average color from the given surface.
Definition at line 1344 of file cairo-utils.cpp.
References ink_cairo_surface_average_color_internal(), and surface.
Referenced by Inkscape::Drawing::averageColor(), Inkscape::Drawing::averageColor(), SPMeshNodeArray::color_pick(), Inkscape::UI::Dialog::ColorItem::getColor(), and Inkscape::UI::Dialog::CloneTiler::trace_pick().
|
static |
Definition at line 1274 of file cairo-utils.cpp.
References data, height, surface, and width.
Referenced by ink_cairo_surface_average_color().
void ink_cairo_surface_blit | ( | cairo_surface_t * | src, |
cairo_surface_t * | dest | ||
) |
Definition at line 1227 of file cairo-utils.cpp.
References stride.
Referenced by Inkscape::Filters::FilterComposite::render_cairo(), Inkscape::Filters::FilterBlend::render_cairo(), and Inkscape::Filters::FilterComponentTransfer::render_cairo().
Cairo::RefPtr< Cairo::ImageSurface > ink_cairo_surface_copy | ( | Cairo::RefPtr< Cairo::ImageSurface > | surface | ) |
cairo_surface_t * ink_cairo_surface_copy | ( | cairo_surface_t * | s | ) |
Create an exact copy of a surface.
Creates a surface that has the same type, content type, dimensions and contents as the specified surface.
Definition at line 1118 of file cairo-utils.cpp.
References ink_cairo_surface_create_identical(), and stride.
Referenced by Inkscape::DrawingCache::_dumpCache(), and Inkscape::Filters::FilterGaussian::render_cairo().
cairo_surface_t * ink_cairo_surface_create_identical | ( | cairo_surface_t * | s | ) |
Create a surface that differs only in pixel content.
Creates a surface that has the same type, content type and dimensions as the specified surface. Pixel contents are not copied.
Definition at line 1165 of file cairo-utils.cpp.
References ink_cairo_surface_create_same_size(), and ink_color_interpolation_key.
Referenced by ink_cairo_surface_copy(), ink_cairo_surface_create_output(), Inkscape::Filters::FilterMerge::render_cairo(), Inkscape::Filters::FilterConvolveMatrix::render_cairo(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), Inkscape::Filters::FilterSkeleton::render_cairo(), and Inkscape::Filters::FilterTile::render_cairo().
cairo_surface_t * ink_cairo_surface_create_output | ( | cairo_surface_t * | image, |
cairo_surface_t * | bg | ||
) |
Definition at line 1211 of file cairo-utils.cpp.
References image, ink_cairo_surface_create_identical(), and ink_cairo_surface_create_same_size().
Referenced by Inkscape::Filters::FilterComposite::render_cairo(), and Inkscape::Filters::FilterBlend::render_cairo().
cairo_surface_t * ink_cairo_surface_create_same_size | ( | cairo_surface_t * | s, |
cairo_content_t | c | ||
) |
Definition at line 1173 of file cairo-utils.cpp.
References c, ink_cairo_surface_get_height(), and ink_cairo_surface_get_width().
Referenced by ink_cairo_extract_alpha(), ink_cairo_surface_create_identical(), ink_cairo_surface_create_output(), Inkscape::Filters::FilterColorMatrix::render_cairo(), Inkscape::Filters::FilterComponentTransfer::render_cairo(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().
int ink_cairo_surface_get_height | ( | cairo_surface_t * | surface | ) |
Return height in pixels.
Definition at line 1268 of file cairo-utils.cpp.
References surface.
Referenced by ink_cairo_surface_create_same_size(), and Inkscape::Filters::FilterGaussian::render_cairo().
int ink_cairo_surface_get_width | ( | cairo_surface_t * | surface | ) |
Return width in pixels.
Definition at line 1256 of file cairo-utils.cpp.
References surface.
Referenced by ink_cairo_surface_create_same_size(), and Inkscape::Filters::FilterGaussian::render_cairo().
int ink_cairo_surface_linear_to_srgb | ( | cairo_surface_t * | surface | ) |
Definition at line 1513 of file cairo-utils.cpp.
References height, ink_cairo_surface_filter(), linear_to_srgb_argb32(), surface, and width.
Referenced by set_cairo_surface_ci().
int ink_cairo_surface_srgb_to_linear | ( | cairo_surface_t * | surface | ) |
Definition at line 1401 of file cairo-utils.cpp.
References height, ink_cairo_surface_filter(), srgb_to_linear_argb32(), surface, and width.
Referenced by set_cairo_surface_ci().
void ink_cairo_transform | ( | cairo_t * | ct, |
Geom::Affine const & | m | ||
) |
Definition at line 1077 of file cairo-utils.cpp.
References ink_matrix_to_cairo().
Referenced by Inkscape::Filters::FilterSlot::_get_transformed_background(), Inkscape::Filters::FilterSlot::_get_transformed_source_graphic(), Inkscape::Extension::Internal::SvgBuilder::_renderText(), Inkscape::Filters::FilterSlot::get_result(), Inkscape::DrawingCache::prepare(), Inkscape::DrawingContext::transform(), and Inkscape::Extension::Internal::CairoRenderContext::transform().
cairo_operator_t ink_css_blend_to_cairo_operator | ( | SPBlendMode | css_blend | ) |
Definition at line 1468 of file cairo-utils.cpp.
References SP_CSS_BLEND_COLOR, SP_CSS_BLEND_COLORBURN, SP_CSS_BLEND_COLORDODGE, SP_CSS_BLEND_DARKEN, SP_CSS_BLEND_DIFFERENCE, SP_CSS_BLEND_EXCLUSION, SP_CSS_BLEND_HARDLIGHT, SP_CSS_BLEND_HUE, SP_CSS_BLEND_LIGHTEN, SP_CSS_BLEND_LUMINOSITY, SP_CSS_BLEND_MULTIPLY, SP_CSS_BLEND_NORMAL, SP_CSS_BLEND_OVERLAY, SP_CSS_BLEND_SATURATION, SP_CSS_BLEND_SCREEN, and SP_CSS_BLEND_SOFTLIGHT.
Referenced by Inkscape::DrawingItem::render(), Inkscape::Extension::Internal::CairoRenderContext::renderGlyphtext(), Inkscape::Extension::Internal::CairoRenderContext::renderImage(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), and Inkscape::Extension::Internal::CairoRenderContext::renderPathVector().
Geom::Affine ink_matrix_to_2geom | ( | cairo_matrix_t const & | cairo_matrix | ) |
Definition at line 1069 of file cairo-utils.cpp.
References ink_matrix_to_2geom(), and result.
void ink_matrix_to_2geom | ( | Geom::Affine & | m, |
cairo_matrix_t const & | cm | ||
) |
Definition at line 1049 of file cairo-utils.cpp.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::getTransform(), and ink_matrix_to_2geom().
void ink_matrix_to_cairo | ( | cairo_matrix_t & | cm, |
Geom::Affine const & | m | ||
) |
Definition at line 1059 of file cairo-utils.cpp.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), ink_cairo_pattern_set_matrix(), ink_cairo_transform(), Inkscape::Extension::Internal::CairoRenderContext::renderGlyphtext(), and Inkscape::Extension::Internal::CairoRenderContext::setTransform().
GdkPixbuf * ink_pixbuf_create_from_cairo_surface | ( | cairo_surface_t * | s | ) |
Converts the Cairo surface to a GdkPixbuf pixel format, without allocating extra memory.
This function is intended mainly for creating previews displayed by GTK. For loading images for display on the canvas, use the Inkscape::Pixbuf object.
The returned GdkPixbuf takes ownership of the passed surface reference, so it should NOT be freed after calling this function.
Definition at line 1671 of file cairo-utils.cpp.
References convert_pixels_argb32_to_pixbuf(), ink_cairo_pixbuf_cleanup(), rs, and w.
Referenced by Inkscape::UI::Widget::draw_circle(), render_pixbuf(), and sp_gradient_to_pixbuf().
Definition at line 1371 of file cairo-utils.cpp.
References c, premul_alpha(), and unpremul_alpha().
Referenced by linear_to_srgb_argb32().
|
static |
Definition at line 1412 of file cairo-utils.cpp.
References linear_to_srgb().
Referenced by ink_cairo_surface_linear_to_srgb().
Convert one pixel from ARGB to GdkPixbuf format.
c | ARGB color |
bgcolor | Color to use if c.alpha is zero (bgcolor.alpha is ignored) |
Definition at line 1743 of file cairo-utils.cpp.
References c, and unpremul_alpha().
Referenced by convert_pixels_argb32_to_pixbuf().
const guchar * pixbuf_to_png | ( | guchar const ** | rows, |
guchar * | px, | ||
int | num_rows, | ||
int | num_cols, | ||
int | stride, | ||
int | color_type, | ||
int | bit_depth | ||
) |
Converts a pixbuf to a PNG data structure.
For 8-but RGBA png, this is like copying.
Definition at line 1869 of file cairo-utils.cpp.
References get_luminance(), and stride.
Referenced by sp_export_get_rows().
Convert one pixel from ARGB to GdkPixbuf format.
Convert a pixel in 0xAARRGGBB format to 0xRRGGBBAA format.
c | RGBA color |
Definition at line 1830 of file cairo-utils.cpp.
References c, and unpremul_alpha().
void set_cairo_surface_ci | ( | cairo_surface_t * | surface, |
SPColorInterpolation | ci | ||
) |
Set the color_interpolation_value for a Cairo surface.
Transform the surface between sRGB and linearRGB if necessary.
Definition at line 983 of file cairo-utils.cpp.
References get_cairo_surface_ci(), ink_cairo_surface_linear_to_srgb(), ink_cairo_surface_srgb_to_linear(), ink_color_interpolation_key, SP_CSS_COLOR_INTERPOLATION_LINEARRGB, SP_CSS_COLOR_INTERPOLATION_SRGB, and surface.
Referenced by Inkscape::Filters::FilterSlot::getcairo(), Inkscape::Filters::Filter::render(), Inkscape::Filters::FilterComposite::render_cairo(), Inkscape::Filters::FilterMerge::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::FilterSpecularLighting::render_cairo(), and Inkscape::Filters::FilterTurbulence::render_cairo().
Definition at line 1353 of file cairo-utils.cpp.
References c, premul_alpha(), and unpremul_alpha().
Referenced by Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), and srgb_to_linear_argb32().
|
static |
Definition at line 1389 of file cairo-utils.cpp.
References srgb_to_linear().
Referenced by ink_cairo_surface_srgb_to_linear().
|
static |
Key for cairo_surface_t to keep track of current color interpolation value Only the address of the structure is used, it is never initialized.
See: http://www.cairographics.org/manual/cairo-Types.html#cairo-user-data-key-t
Definition at line 55 of file cairo-utils.cpp.
Referenced by copy_cairo_surface_ci(), get_cairo_surface_ci(), ink_cairo_surface_create_identical(), and set_cairo_surface_ci().