iphone Programming Glossary: linepointer
Is programmatically inverting the colors of an image possible? http://stackoverflow.com/questions/6672517/is-programmatically-inverting-the-colors-of-an-image-possible pixel a scan line at a time... for int y 0 y height y get a pointer to the start of this scan line unsigned char linePointer memoryPool y width 4 step through the pixels one by one... for int x 0 x width x get RGB values. We're dealing with premultiplied.. zero of course to get uninflected RGB. We multiply by 255 to keep precision while still using integers int r g b if linePointer 3 r linePointer 0 255 linePointer 3 g linePointer 1 255 linePointer 3 b linePointer 2 255 linePointer 3 else r g b.. get uninflected RGB. We multiply by 255 to keep precision while still using integers int r g b if linePointer 3 r linePointer 0 255 linePointer 3 g linePointer 1 255 linePointer 3 b linePointer 2 255 linePointer 3 else r g b 0 perform the colour..
|