Document whether colors are premultiplied

For the various APIs that take or return
RGBA colors, make it explicit that they are
unpremultiplied.
This commit is contained in:
Matthias Clasen 2022-12-24 07:22:39 -05:00
parent 12cd2bcbb2
commit 1df5969ef6
2 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -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)).
*