From 1820131fe6674d46b9876965b30b331d593124a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Tue, 22 Jan 2013 07:36:19 -0500 Subject: [PATCH] utils.[ch]: Add pixel_checker_get_masks() 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(+) 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); -- 2.7.4