A bitmap image or image mask.
SDKs
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
class CGImage
A bitmap image or image mask.
SDKs
Framework
class CGImage
init?(width: Int, height: Int, bits Per Component: Int, bits Per Pixel: Int, bytes Per Row: Int, space: CGColor Space, bitmap Info: CGBitmap Info, provider: CGData Provider, decode: Unsafe Pointer<CGFloat>?, should Interpolate: Bool, intent: CGColor Rendering Intent)
Creates a bitmap image from data supplied by a data provider.
init?(jpeg Data Provider Source: CGData Provider, decode: Unsafe Pointer<CGFloat>?, should Interpolate: Bool, intent: CGColor Rendering Intent)
Creates a bitmap image using JPEG-encoded data supplied by a data provider.
init?(png Data Provider Source: CGData Provider, decode: Unsafe Pointer<CGFloat>?, should Interpolate: Bool, intent: CGColor Rendering Intent)
Creates a bitmap image using PNG-encoded data supplied by a data provider.
var is Mask: 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 bits Per Component: Int
Returns the number of bits allocated for a single color component of a bitmap image.
var bits Per Pixel: Int
Returns the number of bits allocated for a single pixel in a bitmap image.
var bytes Per Row: Int
Returns the number of bytes allocated for a single row of a bitmap image.
var color Space: CGColor Space?
Return the color space for a bitmap image.
var alpha Info: CGImage Alpha Info
Returns the alpha channel information for a bitmap image.
enum CGImage Alpha Info
Storage options for alpha component data.
var data Provider: CGData Provider?
Returns the data provider for a bitmap image.
var decode: Unsafe Pointer<CGFloat>?
Returns the decode array for a bitmap image.
var should Interpolate: Bool
Returns the interpolation setting for a bitmap image.
var rendering Intent: CGColor Rendering Intent
Returns the rendering intent setting for a bitmap image.
var bitmap Info: CGBitmap Info
Returns the bitmap information for a bitmap image.
struct CGBitmap Info
Component information for a bitmap image.
var ut Type: CFString?
The Universal Type Identifier for the image.
func copy() -> CGImage?
Creates a copy of a bitmap image.
func copy(color Space: CGColor Space) -> CGImage?
Creates a copy of a bitmap image, replacing its colorspace.
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(masking Color Components: [CGFloat]) -> CGImage?
Creates a bitmap image by masking an existing bitmap image with the provided color values.
init?(mask Width: Int, height: Int, bits Per Component: Int, bits Per Pixel: Int, bytes Per Row: Int, provider: CGData Provider, decode: Unsafe Pointer<CGFloat>?, should Interpolate: Bool)
Creates a bitmap image mask from data supplied by a data provider.
class var type ID: CFType ID
Returns the type identifier for CGImage objects.
init?(window List From Array Screen Bounds: CGRect, window Array: CFArray, image Option: CGWindow Image Option)
Returns a composite image of the specified windows.
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 CGMutable Path
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.