Class

CGImage

A bitmap image or image mask.

Topics

Examining an Image

var isMask: Bool

Returns whether a bitmap image is an image mask.

var width: Int

Returns the width of a bitmap image.

var height: Int

Returns the height of a bitmap image.

var bitsPerComponent: Int

Returns the number of bits allocated for a single color component of a bitmap image.

var bitsPerPixel: Int

Returns the number of bits allocated for a single pixel in a bitmap image.

var bytesPerRow: Int

Returns the number of bytes allocated for a single row of a bitmap image.

var colorSpace: CGColorSpace?

Return the color space for a bitmap image.

var alphaInfo: CGImageAlphaInfo

Returns the alpha channel information for a bitmap image.

enum CGImageAlphaInfo

Storage options for alpha component data.

var dataProvider: CGDataProvider?

Returns the data provider for a bitmap image.

var decode: UnsafePointer<CGFloat>?

Returns the decode array for a bitmap image.

var shouldInterpolate: Bool

Returns the interpolation setting for a bitmap image.

var renderingIntent: CGColorRenderingIntent

Returns the rendering intent setting for a bitmap image.

var bitmapInfo: CGBitmapInfo

Returns the bitmap information for a bitmap image.

struct CGBitmapInfo

Component information for a bitmap image.

var utType: CFString?

The Universal Type Identifier for the image.

Copying an Image

func copy() -> CGImage?

Creates a copy of a bitmap image.

func copy(colorSpace: CGColorSpace) -> CGImage?

Creates a copy of a bitmap image, replacing its colorspace.

Creating Images by Modifying an Image

func cropping(to: CGRect) -> CGImage?

Creates a bitmap image using the data contained within a subregion of an existing bitmap image.

func masking(CGImage) -> CGImage?

Creates a bitmap image from an existing image and an image mask.

func copy(maskingColorComponents: [CGFloat]) -> CGImage?

Creates a bitmap image by masking an existing bitmap image with the provided color values.

Working with Core Foundation Types

class var typeID: CFTypeID

Returns the type identifier for CGImage objects.

See Also

2D Drawing

class CGContext

A Quartz 2D drawing environment.

class CGPath

An immutable graphics path: a mathematical description of shapes or lines to be drawn in a graphics context.

class CGMutablePath

A mutable graphics path: a mathematical description of shapes or lines to be drawn in a graphics context.

class CGLayer

An offscreen context for reusing content drawn with Core Graphics.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software