MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / cfaChannel

Function cfaChannel

pj_scene2D/core/src/codecs.cpp:401–409  ·  view source on GitHub ↗

Channel sampled by the CFA at (row, col): 0=R, 1=G, 2=B. Indexed by the top-left 2x2 tile of each pattern.

Source from the content-addressed store, hash-verified

399// Channel sampled by the CFA at (row, col): 0=R, 1=G, 2=B. Indexed by the
400// top-left 2x2 tile of each pattern.
401int cfaChannel(BayerPattern pattern, int row, int col) noexcept {
402 static constexpr int kTiles[4][2][2] = {
403 {{0, 1}, {1, 2}}, // RGGB
404 {{1, 0}, {2, 1}}, // GRBG
405 {{1, 2}, {0, 1}}, // GBRG
406 {{2, 1}, {1, 0}}, // BGGR
407 };
408 return kTiles[static_cast<int>(pattern)][row & 1][col & 1];
409}
410
411} // namespace
412

Callers 1

decodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected