4 ms·
I'll also note: one of the recommended ways to avoid bugs where you type out rgg instead of rgb is to use loops and index by component instead of manually nami
by MaulingMonkey 5y ago
I'll also note: one of the recommended ways to avoid bugs where you type out rgg instead of rgb is to use loops and index by component instead of manually naming the components. Perhaps:
Color color;
for (size_t c=0; c<3; ++c) color[c] = (u8)block[c][pixel_index];
However, this becomes impossible in many programming languages if you give every individual component a unique type!