awips2/pythonPackages/pil/libImaging/Negative.c
root 377dcd10b9 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 9f19e3f712 [formerly 9f19e3f712 [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

42 lines
762 B
C

/*
* The Python Imaging Library
* $Id: Negative.c 2134 2004-10-06 08:55:20Z fredrik $
*
* negate image
*
* to do:
* FIXME: Maybe this should be implemented using ImagingPoint()
*
* history:
* 95-11-27 fl: Created
*
* Copyright (c) Fredrik Lundh 1995.
* Copyright (c) Secret Labs AB 1997.
*
* See the README file for information on usage and redistribution.
*/
#include "Imaging.h"
Imaging
ImagingNegative(Imaging im)
{
Imaging imOut;
int x, y;
if (!im)
return (Imaging) ImagingError_ModeError();
imOut = ImagingNew(im->mode, im->xsize, im->ysize);
if (!imOut)
return NULL;
for (y = 0; y < im->ysize; y++)
for (x = 0; x < im->linesize; x++)
imOut->image[y][x] = ~im->image[y][x];
return imOut;
}