Skip to content

Instantly share code, notes, and snippets.

@dennda
Created September 29, 2011 19:12
Show Gist options
  • Save dennda/1251646 to your computer and use it in GitHub Desktop.
Save dennda/1251646 to your computer and use it in GitHub Desktop.
uint8 *fourchan = (uint8*) malloc(sizeof(uint8) * width * height * 4);
short cur;
short *subscript = (short*) imgData;
for (int i = 0; i < width * height; i++) {
cur = subscript[i] + 1000;
fourchan[i*4] = cur;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment