CGImage

A bitmap image or image mask.

Overview

A bitmap (or sampled) image is a rectangular array of pixels, with each pixel representing a single sample or data point in a source image.

Symbols

Creating Bitmap Images

func copy()

Creates a copy of a bitmap image.

func copy(colorSpace: CGColorSpace)

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

func cropping(to: CGRect)

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

func masking(CGImage)

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

func copy(maskingColorComponents: [CGFloat])

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

Getting the CFType ID

class var typeID: CFTypeID

Returns the type identifier for CGImage objects.

Getting Information About an Image

var alphaInfo: CGImageAlphaInfo

Returns the alpha channel information for a bitmap image.

var bitmapInfo: CGBitmapInfo

Returns the bitmap information for 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 dataProvider: CGDataProvider?

Returns the data provider for a bitmap image.

var decode: UnsafePointer<CGFloat>?

Returns the decode array for a bitmap image.

var height: Int

Returns the height of 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 width: Int

Returns the width of a bitmap image.

var isMask: Bool

Returns whether a bitmap image is an image mask.

Data Types

CGImage

A bitmap image or image mask.

Constants

CGImageAlphaInfo

Storage options for alpha component data.

CGBitmapInfo

Component information for a bitmap image.