[Pixman] [PATCH 3/7] utils.[ch]: Add pixel_checker_get_masks()

Søren Sandmann sandmann at cs.au.dk
Thu Jan 24 07:52:55 PST 2013


From: Søren Sandmann Pedersen <ssp at redhat.com>

This function returns the a, r, g, and b masks corresponding to the
pixel checker's format.
---
 test/utils.c |   17 +++++++++++++++++
 test/utils.h |    7 +++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/test/utils.c b/test/utils.c
index eed2476..9a8decf 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -1422,6 +1422,23 @@ pixel_checker_split_pixel (const pixel_checker_t *checker, uint32_t pixel,
 }
 
 void
+pixel_checker_get_masks (const pixel_checker_t *checker,
+                         uint32_t              *am,
+                         uint32_t              *rm,
+                         uint32_t              *gm,
+                         uint32_t              *bm)
+{
+    if (am)
+        *am = checker->am;
+    if (rm)
+        *rm = checker->rm;
+    if (gm)
+        *gm = checker->gm;
+    if (bm)
+        *bm = checker->bm;
+}
+
+void
 pixel_checker_convert_pixel_to_color (const pixel_checker_t *checker,
                                       uint32_t pixel, color_t *color)
 {
diff --git a/test/utils.h b/test/utils.h
index f6dc193..c278151 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -229,3 +229,10 @@ pixel_checker_check (const pixel_checker_t *checker,
 void
 pixel_checker_convert_pixel_to_color (const pixel_checker_t *checker,
                                       uint32_t pixel, color_t *color);
+
+void
+pixel_checker_get_masks (const pixel_checker_t *checker,
+                         uint32_t              *am,
+                         uint32_t              *rm,
+                         uint32_t              *gm,
+                         uint32_t              *bm);
-- 
1.7.4



More information about the Pixman mailing list