83 assert(coordOffset >=
iPoint2D(0, 0) &&
"Offset is non-negative.");
86 std::array<T, 4> tgtData;
88 for (
int row = 0; row < tgt.
height(); ++row) {
89 for (
int col = 0; col < tgt.
width(); ++col) {
90 tgt(row, col) = src((coordOffset.
y + row) % 2, (coordOffset.
x + col) % 2);
110 std::array<T, 4> tgtData =
applyPhaseShift(srcData, srcPhase, tgtPhase);
117 const std::array<CFAColor, 4> tgtColors =
getAsCFAColors(tgtPhase);
119 std::distance(tgtColors.begin(),
120 std::find_if(tgtColors.begin(), tgtColors.end(), is_green));
121 auto green1Idx = std::distance(std::find_if(tgtColors.rbegin(),
122 tgtColors.rend(), is_green),
126 std::swap(tgtData[green0Idx], tgtData[green1Idx]);