Lines Matching defs:checker
2021 pixel_checker_init (pixel_checker_t *checker, pixman_format_code_t format)
2025 checker->format = format;
2034 checker->bs = 0;
2035 checker->gs = 0;
2036 checker->rs = 0;
2037 checker->as = 0;
2042 checker->bs = 0;
2043 checker->gs = checker->bs + PIXMAN_FORMAT_B (format);
2044 checker->rs = checker->gs + PIXMAN_FORMAT_G (format);
2045 checker->as = checker->rs + PIXMAN_FORMAT_R (format);
2049 checker->rs = 0;
2050 checker->gs = checker->rs + PIXMAN_FORMAT_R (format);
2051 checker->bs = checker->gs + PIXMAN_FORMAT_G (format);
2052 checker->as = checker->bs + PIXMAN_FORMAT_B (format);
2057 checker->bs = PIXMAN_FORMAT_BPP (format) - PIXMAN_FORMAT_B (format);
2058 checker->gs = checker->bs - PIXMAN_FORMAT_B (format);
2059 checker->rs = checker->gs - PIXMAN_FORMAT_G (format);
2060 checker->as = checker->rs - PIXMAN_FORMAT_R (format);
2065 checker->rs = PIXMAN_FORMAT_BPP (format) - PIXMAN_FORMAT_R (format);
2066 checker->gs = checker->rs - PIXMAN_FORMAT_R (format);
2067 checker->bs = checker->gs - PIXMAN_FORMAT_G (format);
2068 checker->as = checker->bs - PIXMAN_FORMAT_B (format);
2076 checker->am = ((1U << PIXMAN_FORMAT_A (format)) - 1) << checker->as;
2077 checker->rm = ((1U << PIXMAN_FORMAT_R (format)) - 1) << checker->rs;
2078 checker->gm = ((1U << PIXMAN_FORMAT_G (format)) - 1) << checker->gs;
2079 checker->bm = ((1U << PIXMAN_FORMAT_B (format)) - 1) << checker->bs;
2081 checker->aw = PIXMAN_FORMAT_A (format);
2082 checker->rw = PIXMAN_FORMAT_R (format);
2083 checker->gw = PIXMAN_FORMAT_G (format);
2084 checker->bw = PIXMAN_FORMAT_B (format);
2086 checker->ad = DEVIATION;
2087 checker->rd = DEVIATION;
2088 checker->gd = DEVIATION;
2089 checker->bd = DEVIATION;
2095 pixel_checker_allow_dither (pixel_checker_t *checker)
2097 checker->ad += 1 / (double)((1 << checker->aw) - 1);
2098 checker->rd += 1 / (double)((1 << checker->rw) - 1);
2099 checker->gd += 1 / (double)((1 << checker->gw) - 1);
2100 checker->bd += 1 / (double)((1 << checker->bw) - 1);
2104 pixel_checker_require_uint32_format (const pixel_checker_t *checker)
2106 assert (checker->format != PIXMAN_rgba_float &&
2107 checker->format != PIXMAN_rgb_float);
2111 pixel_checker_split_pixel (const pixel_checker_t *checker, uint32_t pixel,
2114 pixel_checker_require_uint32_format(checker);
2116 *a = (pixel & checker->am) >> checker->as;
2117 *r = (pixel & checker->rm) >> checker->rs;
2118 *g = (pixel & checker->gm) >> checker->gs;
2119 *b = (pixel & checker->bm) >> checker->bs;
2123 pixel_checker_get_masks (const pixel_checker_t *checker,
2129 pixel_checker_require_uint32_format(checker);
2132 *am = checker->am;
2134 *rm = checker->rm;
2136 *gm = checker->gm;
2138 *bm = checker->bm;
2142 pixel_checker_convert_pixel_to_color (const pixel_checker_t *checker,
2147 pixel_checker_require_uint32_format(checker);
2149 pixel_checker_split_pixel (checker, pixel, &a, &r, &g, &b);
2151 if (checker->am == 0)
2154 color->a = a / (double)(checker->am >> checker->as);
2156 if (checker->rm == 0)
2159 color->r = r / (double)(checker->rm >> checker->rs);
2161 if (checker->gm == 0)
2164 color->g = g / (double)(checker->gm >> checker->gs);
2166 if (checker->bm == 0)
2169 color->b = b / (double)(checker->bm >> checker->bs);
2171 if (PIXMAN_FORMAT_TYPE (checker->format) == PIXMAN_TYPE_ARGB_SRGB)
2194 get_limits (const pixel_checker_t *checker, double sign,
2200 if (PIXMAN_FORMAT_TYPE (checker->format) == PIXMAN_TYPE_ARGB_SRGB)
2210 *ao = convert (color->a + sign * checker->ad,
2211 checker->aw, checker->am, checker->as, 1.0);
2212 *ro = convert (color->r + sign * checker->rd,
2213 checker->rw, checker->rm, checker->rs, 0.0);
2214 *go = convert (color->g + sign * checker->gd,
2215 checker->gw, checker->gm, checker->gs, 0.0);
2216 *bo = convert (color->b + sign * checker->bd,
2217 checker->bw, checker->bm, checker->bs, 0.0);
2221 pixel_checker_get_max (const pixel_checker_t *checker, color_t *color,
2224 pixel_checker_require_uint32_format(checker);
2226 get_limits (checker, 1, color, am, rm, gm, bm);
2230 pixel_checker_get_min (const pixel_checker_t *checker, color_t *color,
2233 pixel_checker_require_uint32_format(checker);
2235 get_limits (checker, - 1, color, am, rm, gm, bm);
2239 pixel_checker_check (const pixel_checker_t *checker, uint32_t pixel,
2246 pixel_checker_require_uint32_format(checker);
2248 pixel_checker_get_min (checker, color, &a_lo, &r_lo, &g_lo, &b_lo);
2249 pixel_checker_get_max (checker, color, &a_hi, &r_hi, &g_hi, &b_hi);
2250 pixel_checker_split_pixel (checker, pixel, &ai, &ri, &gi, &bi);
2262 color_limits (const pixel_checker_t *checker,
2265 if (PIXMAN_FORMAT_A(checker->format))
2276 pixel_checker_check_color (const pixel_checker_t *checker,
2282 color_limits(checker, -DEVIATION, reference, &min);
2283 color_limits(checker, DEVIATION, reference, &max);