Skip to content

Instantly share code, notes, and snippets.

@JulesGorny
Created September 24, 2014 10:13
Show Gist options
  • Save JulesGorny/8ae91322b22ccc0415aa to your computer and use it in GitHub Desktop.
Save JulesGorny/8ae91322b22ccc0415aa to your computer and use it in GitHub Desktop.
//Functions to copy a pixel
void Anonymizer::copyPixel(const Uint8* src, Uint8* dest, int at, int SamplesPerPixel)
{
for(int spp=0; spp<SamplesPerPixel; spp++)
dest[at+spp] = src[at+spp];
}
void Anonymizer::copyPixel(const Uint16* src, Uint16* dest, int at, int SamplesPerPixel)
{
for(int spp=0; spp<SamplesPerPixel; spp++)
dest[at+spp] = src[at+spp];
}
//Functions to modify a grayscale value
void Anonymizer::setDataGrayScale(Uint8* img, int at, int SamplesPerPixel, Uint8 value)
{
for(int spp=0; spp<SamplesPerPixel; spp++)
img[at+spp] = value;
}
void Anonymizer::setDataGrayScale(Uint16* img, int at, int SamplesPerPixel, Uint16 value)
{
for(int spp=0; spp<SamplesPerPixel; spp++)
img[at+spp] = value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment