MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / grayPixel

Function grayPixel

source/util/pixelMatch.cpp:67–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67double grayPixel(const U8* img, U32 i) {
68 double a = double(img[i + 3]) / 255;
69 U8 r = blend(img[i + 0], a);
70 U8 g = blend(img[i + 1], a);
71 U8 b = blend(img[i + 2], a);
72 return rgb2y(r, g, b);
73}
74
75// check if a pixel is likely a part of anti-aliasing;
76// based on "Anti-aliased Pixel and Intensity Slope Detector" paper by V. Vysniauskas, 2009

Callers 1

pixelmatchFunction · 0.85

Calls 2

blendFunction · 0.85
rgb2yFunction · 0.85

Tested by

no test coverage detected