1
0
Fork 0
Bilal Elmoussaoui 2024-06-11 02:46:54 +02:00 committed by Marge Bot
parent 9d11cc679e
commit 04842393aa
3 changed files with 0 additions and 41 deletions

View file

@ -204,26 +204,6 @@ clutter_color_to_pixel (const ClutterColor *color)
color->red << 24); color->red << 24);
} }
/**
* clutter_color_from_pixel:
* @color: (out caller-allocates): return location for a #ClutterColor
* @pixel: a 32 bit packed integer containing a color
*
* Converts @pixel from the packed representation of a four 8 bit channel
* color to a #ClutterColor.
*/
void
clutter_color_from_pixel (ClutterColor *color,
guint32 pixel)
{
g_return_if_fail (color != NULL);
color->red = pixel >> 24;
color->green = (pixel >> 16) & 0xff;
color->blue = (pixel >> 8) & 0xff;
color->alpha = pixel & 0xff;
}
static inline void static inline void
skip_whitespace (gchar **str) skip_whitespace (gchar **str)
{ {

View file

@ -116,9 +116,6 @@ void clutter_color_from_hls (ClutterColor *color,
CLUTTER_EXPORT CLUTTER_EXPORT
guint32 clutter_color_to_pixel (const ClutterColor *color); guint32 clutter_color_to_pixel (const ClutterColor *color);
CLUTTER_EXPORT
void clutter_color_from_pixel (ClutterColor *color,
guint32 pixel);
CLUTTER_EXPORT CLUTTER_EXPORT
guint clutter_color_hash (gconstpointer v); guint clutter_color_hash (gconstpointer v);

View file

@ -256,28 +256,10 @@ color_to_string (void)
g_free (str); g_free (str);
} }
static void
color_operators (void)
{
ClutterColor op1, op2;
clutter_color_from_pixel (&op1, 0xff0000ff);
g_assert_cmpuint (op1.red, ==, 0xff);
g_assert_cmpuint (op1.green, ==, 0);
g_assert_cmpuint (op1.blue, ==, 0);
g_assert_cmpuint (op1.alpha, ==, 0xff);
clutter_color_from_pixel (&op2, 0x00ff00ff);
g_assert_cmpuint (op2.red, ==, 0);
g_assert_cmpuint (op2.green, ==, 0xff);
g_assert_cmpuint (op2.blue, ==, 0);
g_assert_cmpuint (op2.alpha, ==, 0xff);
}
CLUTTER_TEST_SUITE ( CLUTTER_TEST_SUITE (
CLUTTER_TEST_UNIT ("/color/hls-roundtrip", color_hls_roundtrip) CLUTTER_TEST_UNIT ("/color/hls-roundtrip", color_hls_roundtrip)
CLUTTER_TEST_UNIT ("/color/from-string/invalid", color_from_string_invalid) CLUTTER_TEST_UNIT ("/color/from-string/invalid", color_from_string_invalid)
CLUTTER_TEST_UNIT ("/color/from-string/valid", color_from_string_valid) CLUTTER_TEST_UNIT ("/color/from-string/valid", color_from_string_valid)
CLUTTER_TEST_UNIT ("/color/to-string", color_to_string) CLUTTER_TEST_UNIT ("/color/to-string", color_to_string)
CLUTTER_TEST_UNIT ("/color/operators", color_operators)
) )