MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / rgb2cb

Function rgb2cb

extern/toojpeg/toojpeg.cpp:202–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200// convert from RGB to YCbCr, constants are similar to ITU-R, see https://en.wikipedia.org/wiki/YCbCr#JPEG_conversion
201float rgb2y (float r, float g, float b) { return +0.299f * r +0.587f * g +0.114f * b; }
202float rgb2cb(float r, float g, float b) { return -0.16874f * r -0.33126f * g +0.5f * b; }
203float rgb2cr(float r, float g, float b) { return +0.5f * r -0.41869f * g -0.08131f * b; }
204
205// forward DCT computation "in one dimension" (fast AAN algorithm by Arai, Agui and Nakajima: "A fast DCT-SQ scheme for images")

Callers 1

writeJpegFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected