[cairo-commit] 2 commits - src/cairo.c src/cairo-pattern.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Dec 24 13:00:34 UTC 2022
src/cairo-pattern.c | 8 ++++++++
src/cairo.c | 2 ++
2 files changed, 10 insertions(+)
New commits:
commit 7fc6df6dd25a7361b1aedddb69b3dae2618eef96
Merge: 12cd2bcbb 1df5969ef
Author: Uli Schlachter <psychon at znc.in>
Date: Sat Dec 24 13:00:32 2022 +0000
Merge branch 'document-premul' into 'master'
Document whether colors are premultiplied
See merge request cairo/cairo!373
commit 1df5969ef67fe305f6764446e39dd7d62891c8fc
Author: Matthias Clasen <mclasen at redhat.com>
Date: Sat Dec 24 07:22:39 2022 -0500
Document whether colors are premultiplied
For the various APIs that take or return
RGBA colors, make it explicit that they are
unpremultiplied.
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 6bd3edfd8..e969f0a17 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -681,6 +681,8 @@ slim_hidden_def (cairo_pattern_create_rgb);
* 1. If the values passed in are outside that range, they will be
* clamped.
*
+ * The color is specified in the same way as in cairo_set_source_rgb().
+ *
* Return value: the newly created #cairo_pattern_t if successful, or
* an error pattern in case of no memory. The caller owns the
* returned object and should call cairo_pattern_destroy() when
@@ -4160,6 +4162,8 @@ _cairo_pattern_equal (const cairo_pattern_t *a, const cairo_pattern_t *b)
*
* Gets the solid color for a solid color pattern.
*
+ * Note that the color and alpha values are not premultiplied.
+ *
* Return value: %CAIRO_STATUS_SUCCESS, or
* %CAIRO_STATUS_PATTERN_TYPE_MISMATCH if the pattern is not a solid
* color pattern.
@@ -4242,6 +4246,8 @@ cairo_pattern_get_surface (cairo_pattern_t *pattern,
* where n is the number returned
* by cairo_pattern_get_color_stop_count().
*
+ * Note that the color and alpha values are not premultiplied.
+ *
* Return value: %CAIRO_STATUS_SUCCESS, or %CAIRO_STATUS_INVALID_INDEX
* if @index is not valid for the given pattern. If the pattern is
* not a gradient pattern, %CAIRO_STATUS_PATTERN_TYPE_MISMATCH is
@@ -4549,6 +4555,8 @@ slim_hidden_def (cairo_mesh_pattern_get_path);
* Valid values for @corner_num are from 0 to 3 and identify the
* corners as explained in cairo_pattern_create_mesh().
*
+ * Note that the color and alpha values are not premultiplied.
+ *
* Return value: %CAIRO_STATUS_SUCCESS, or %CAIRO_STATUS_INVALID_INDEX
* if @patch_num or @corner_num is not valid for @pattern. If
* @pattern is not a mesh pattern, %CAIRO_STATUS_PATTERN_TYPE_MISMATCH
diff --git a/src/cairo.c b/src/cairo.c
index f55429405..e9c4bb9a8 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -918,6 +918,8 @@ slim_hidden_def (cairo_set_source_rgb);
* range 0 to 1. If the values passed in are outside that range, they
* will be clamped.
*
+ * Note that the color and alpha values are not premultiplied.
+ *
* The default source pattern is opaque black, (that is, it is
* equivalent to cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0)).
*
More information about the cairo-commit
mailing list