MEImageUtil Class Reference

Inherits from NSObject
Declared in MEImageUtil.h

Overview

Utility class for working with images.

+ createContext:scale:flippedY:

Creates a context of the specified dimensions that is compatible with the rendering engine.

+ (CGContextRef)createContext:(CGSize)size scale:(float)scale flippedY:(BOOL)flippedY

Declared In

MEImageUtil.h

+ destroyContext:

Destroys a context created by MEImageUtil

+ (void)destroyContext:(CGContextRef)context

Declared In

MEImageUtil.h

+ createImageFromContext:

Converts a context into a UIImage.

+ (UIImage *)createImageFromContext:(CGContextRef)context

Declared In

MEImageUtil.h

+ createImageFromView:

Converts a UIView into a UIImage.

+ (UIImage *)createImageFromView:(UIView *)uiView

Declared In

MEImageUtil.h

+ bitmapFromImage:flippedY:scale:resultantWidth:resultantHeight:

Copies and scales RGBA bitmap data from a UIImage to specified memory returning the new physical size in pixels in resultantWidht and resultantHeight, optionally flipping the Y. You must free the memory with a call to free().

+ (void *)bitmapFromImage:(UIImage *)image flippedY:(BOOL)flippedY scale:(float)scale resultantWidth:(unsigned int *)resultantWidth resultantHeight:(unsigned int *)resultantHeight

Declared In

MEImageUtil.h

+ bitmapFromImage:flippedY:targetWidth:targetHeight:

Copies and scales RGBA bitmap data from a UIImage to specified memory returning the new physical size specified by targetWidth and targetHeight in pixels, optionally flipping the Y. You must free the memory with a call to free().

+ (void *)bitmapFromImage:(UIImage *)image flippedY:(BOOL)flippedY targetWidth:(unsigned int)targetWidth targetHeight:(unsigned int)targetHeight

Declared In

MEImageUtil.h

+ imageToRGBA8888:imageData:imageWidth:imageHeight:imageDataLength:

Reads data from a UIImage, malloc’s memory at imageData and copies it there in RGBA8888 format. Stores image attributes in imageWidth, imageHeight, and imageDataLenght

+ (void)imageToRGBA8888:(UIImage *)image imageData:(void **)imageData imageWidth:(unsigned int *)imageWidth imageHeight:(unsigned int *)imageHeight imageDataLength:(unsigned int *)imageDataLength

Declared In

MEImageUtil.h

+ containsClearPixels:imageDataLength:

Returns YES if the RGBA8888 memory block pointed to by imageData contains any alpha values < 255.

+ (BOOL)containsClearPixels:(void *)imageData imageDataLength:(unsigned int)imageDataLength

Declared In

MEImageUtil.h

+ makeColor:g:b:a:

Returns a UIColor for r g b a bytes.

+ (UIColor *)makeColor:(int)r g:(int)g b:(int)b a:(int)a

Declared In

MEImageUtil.h

+ imageWithColor:

Returns a 1x1 pixel UIImage filled with the specified color.

+ (UIImage *)imageWithColor:(UIColor *)color

Parameters

color

The color to make the image.

Declared In

MEImageUtil.h