Skip to content

Instantly share code, notes, and snippets.

@ProTip
Created March 12, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProTip/fdc31e85bfac7416fdb01dc25dd7ba4d to your computer and use it in GitHub Desktop.
Save ProTip/fdc31e85bfac7416fdb01dc25dd7ba4d to your computer and use it in GitHub Desktop.
Mask position conversion
for(int w = 0; w < width; w++) {
for(int h = 0; h < height; h++) {
maskPos = w * height + h;
colorPos = h * width + w;
colorMask[colorPos] = mask[maskPos];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment