Skip to content

Instantly share code, notes, and snippets.

@dennda
Created September 21, 2011 23:03
Show Gist options
  • Save dennda/1233573 to your computer and use it in GitHub Desktop.
Save dennda/1233573 to your computer and use it in GitHub Desktop.
uint16_t *remapped = (uint16_t*) malloc(width * height * sizeof(uint16_t));
vImage_Buffer src = {imgData,
(vImagePixelCount) height,
(vImagePixelCount) width,
bytes_per_row
};
vImage_Buffer dst = {remapped,
(vImagePixelCount) height,
(vImagePixelCount) width,
bytes_per_row
};
double max_intensity = pow(2, bits_allocated);
vImageEndsInContrastStretch_PlanarF(&src, &dst, NULL, 10, 10, 1000, 0,
max_intensity, kvImageNoFlags);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment