Structure

vImage_Buffer

The basic data structure used by vImage functions for passing image data.

Declaration

struct vImage_Buffer

Overview

vImage functions will not attempt to read pixel data outside the area described by the height and width fields of the vImage buffer. The function will also not write data outside that area.

Topics

Initializers

init(width: Int, height: Int, bitsPerPixel: UInt32)

Returns a new, initialized buffer of the specified size and bits per pixel.

init(cgImage: CGImage, flags: vImage.Options)

Returns a new, initialized buffer with the contents of a Core Graphics image.

init(cgImage: CGImage, format: vImage_CGImageFormat, flags: vImage.Options)

Returns a new, initialized buffer with the contents of a Core Graphics image, that uses the supplied image format.

Buffer Methods

func copy(destinationBuffer: inout vImage_Buffer, flags: vImage.Options)

Copies the vImage buffer to the specified destination buffer.

func free()

Frees the resoures associated with the vImage buffer.

Buffer Properties

var data: UnsafeMutableRawPointer!

A pointer to memory for image data.

var height: vImagePixelCount

The height of the image, in pixels.

var width: vImagePixelCount

The width of the image, in pixels.

var size: CGSize

The size of the image, in pixels.

var rowBytes: Int

The distance, in bytes, between the start of one pixel row and the next in an image, including any unused space between them.

Type Methods

static func preferredAlignmentAndRowBytes(width: Int, height: Int, bitsPerPixel: UInt32) -> (alignment: Int, rowBytes: Int)

Returns the preferred alignment and row bytes for a specified size and bits per pixel.