CoreGraphics is the Quartz 2D drawing engine for rendering paths, colors, images, fonts, gradients, and PDF content across iOS, macOS, tvOS, watchOS, and visionOS. You issue drawing commands into a CGContext, controlling appearance with types such as CGBlendMode, CGPathDrawingMode, CGTextDrawingMode, and CGInterpolationQuality, and you manage color with CGColor, CGColorSpace, and CGColorRenderingIntent. Pixel data flows through CGDataProvider and CGDataConsumer, while types like CGDisplayMode, CGDisplayStream, and CGEvent give access to display configuration, screen capture, and input events. CGError reports the outcome of these operations.
Drawing Contexts 3
The destinations and offscreen surfaces that receive Quartz 2D drawing commands.
- ClCGContextA Quartz 2D drawing destination that receives path, image, text, and shading commands.
- ClCGLayerAn offscreen drawing surface optimized for repeated reuse within a context.
- St__CGBitmapParametersA structure that holds the low-level parameters describing a bitmap context's layout.
Paths and Geometry 8
Types for building, stroking, and filling vector paths.
- ClCGPathAn immutable graphics path describing a set of lines, curves, and shapes.
- ClCGMutablePathA mutable graphics path that you build by adding lines, curves, and subpaths.
- StCGPathElementA structure that describes a single segment of a graphics path and its points.
- EnCGPathElementTypeConstants that identify the kind of segment described by a path element.
- EnCGPathDrawingModeConstants that specify whether a path is filled, stroked, or both.
- EnCGPathFillRuleiOS 7.0+Constants that specify the rule used to determine the interior of a path.
- EnCGLineJoinConstants that specify how connected line segments are joined when stroked.
- EnCGLineCapConstants that specify how the endpoints of an open path are drawn when stroked.
Colors and Color Spaces 12
Types that define colors, color spaces, and color management for accurate rendering.
- ClCGColorAn object that represents a color in a specific color space, including its components and alpha value.
- ClCGColorSpaceAn object that defines how the numeric color values of an image or context are interpreted.
- EnCGColorSpaceModelConstants that identify the color model of a color space.
- ClCGColorConversionInfoAn object that describes how to convert color values from one color space to another.
- EnCGColorConversionInfoTransformTypeConstants that specify the direction of a color-space transform.
- EnCGColorRenderingIntentConstants that specify how out-of-gamut colors are mapped during rendering.
- ClColorSyncProfileAn object that represents an ICC color profile used for color management.
- StCGColorModelA type that identifies the basic color model used by a color space.
- StCGDeviceColorA structure that represents a color expressed in device-specific components.
- StCGColorBufferFormatA structure that describes the memory layout of a buffer of color values.
- StCGColorDataFormatA structure that describes the format of color data exchanged with a color space.
- EnCGComponentA type that identifies an individual color component within a color value.
Images and Bitmaps 11
Types for creating, inspecting, and configuring bitmap images and their pixel layout.
- ClCGImageAn object that represents a bitmap image and its pixel data, color space, and alpha information.
- StCGBitmapInfomacOS 10.0+A structure of flags that describe the alpha and pixel-component layout of a bitmap.
- EnCGBitmapLayoutConstants that describe the in-memory layout of a bitmap's pixel components.
- EnCGImageAlphaInfoConstants that specify how a bitmap stores and interprets its alpha component.
- EnCGImageByteOrderInfomacOS 10.0+Constants that specify the byte order of an image's pixel data.
- EnCGImagePixelFormatInfomacOS 10.14+Constants that identify the pixel format used to store an image's data.
- EnCGImageComponentInfomacOS 10.0+Constants that describe the role of a component within an image's pixels.
- EnCGInterpolationQualityConstants that specify the quality level used when interpolating image pixels.
- StCGContentInfoA structure that describes characteristics of image content, such as its dynamic range.
- ClIOSurfaceRefA reference to a shareable hardware-accelerated image buffer that can back Core Graphics images and surfaces.
- ClCGRenderingBufferProviderAn object that supplies a buffer of memory used to back rendering operations.
Gradients, Patterns, and Shadings 9
Types that fill regions with smooth color transitions, repeating tiles, and shading functions.
- ClCGGradientAn object that defines a smooth transition between colors for filling regions.
- StCGGradientDrawingOptionsA structure of options that control how a gradient extends beyond its endpoints.
- ClCGShadingAn object that paints a smooth color gradient defined by a function across a region.
- ClCGPatternAn object that defines a repeating image or drawing used to fill or stroke shapes.
- EnCGPatternTilingConstants that specify how a pattern is tiled across a fill area.
- StCGPatternCallbacksA structure of callbacks that draw and release a repeating pattern's content.
- ClCGFunctionAn object that wraps a callback evaluating a function used by shadings and patterns.
- StCGFunctionCallbacksA structure of callbacks that evaluate and release a Core Graphics function.
- EnCGBlendModeConstants that specify how source and destination colors combine during compositing.
Fonts and Text 4
Types for loading glyph data and controlling how text is rendered.
- ClCGFontAn object that represents a font and its glyph data for rendering text in a context.
- EnCGFontPostScriptFormatConstants that identify the PostScript format of an embedded font.
- EnCGTextDrawingModeConstants that specify how glyphs are filled, stroked, or used for clipping.
- EnCGGlyphDeprecatedEnumA deprecated enumeration formerly used to represent glyph values.
Data Providers and Consumers 5
Types that supply raw bytes to and read rendered bytes from Quartz.
- ClCGDataProviderAn object that supplies raw bytes of data, such as image or font content, to Core Graphics.
- StCGDataProviderSequentialCallbacksA structure of callbacks that a data provider uses to supply bytes sequentially.
- StCGDataProviderDirectCallbacksA structure of callbacks that a data provider uses to supply bytes by direct access.
- ClCGDataConsumerAn object that receives the bytes of data written during a Core Graphics operation.
- StCGDataConsumerCallbacksA structure of callbacks that a data consumer uses to write and release bytes.
PDF Documents 15
Types for reading, parsing, and rendering PDF content and its object structure.
- ClCGPDFDocumentAn object that represents a PDF document and provides access to its pages and metadata.
- ClCGPDFPageAn object that represents a single page of a PDF document for drawing or inspection.
- EnCGPDFBoxConstants that identify a page boundary box within a PDF page.
- StCGPDFObjectRefA reference to a generic object within a PDF document.
- EnCGPDFObjectTypeConstants that identify the type of an object stored in a PDF document.
- StCGPDFArrayRefA reference to an array object within a PDF document's content structure.
- StCGPDFDictionaryRefA reference to a dictionary object within a PDF document's content structure.
- StCGPDFStreamRefA reference to a stream object within a PDF document.
- StCGPDFStringRefA reference to a string object within a PDF document.
- EnCGPDFDataFormatConstants that identify the encoding format of a PDF data stream.
- StCGPDFAccessPermissionsA structure of flags that describe the permitted operations on a PDF document.
- EnCGPDFTagTypemacOS 10.15+Constants that identify the structural tag type of a tagged PDF element.
- StCGPDFTagPropertyA structure that identifies a property associated with a tagged PDF element.
- ClCGPSConverterAn object that converts PostScript data into PDF content.
- StCGPSConverterCallbacksA structure of callbacks that report progress during PostScript-to-PDF conversion.
Display Configuration and Capture 13
Types for querying display modes, reconfiguring displays, and streaming captured screen frames.
- ClCGDisplayModeAn object that describes a display's resolution, pixel depth, and refresh rate.
- StCGConfigureOptionA structure of options that control how a display reconfiguration is applied.
- StCGDisplayChangeSummaryFlagsA structure of flags that summarize the changes from a display reconfiguration.
- StCGCaptureOptionsA structure of options that control how a display is captured.
- ClCGDisplayStream@typedef CGDisplayStreamRef
- ClCGDisplayStreamUpdate@typedef CGDisplayStreamUpdateRef
- EnCGDisplayStreamUpdateRectType@enum CGDisplayStreamUpdateRectType
- EnCGDisplayStreamFrameStatus@enum CGDisplayStreamFrameStatus
- StCGScreenUpdateOperationA structure of flags that describe the kind of update applied to a screen region.
- StCGScreenUpdateMoveDeltaA structure that describes the offset by which a screen region moved.
- St__CGContentToneMappingInfomacOS 26.0+A structure that holds parameters describing how content is tone-mapped.
- EnCGContentToneMappingInfoiOS 26.0+An enumeration that describes the tone-mapping information applied to displayed content.
- EnCGToneMappingConstants that specify the tone-mapping method applied to high-dynamic-range content.
Window Lists and Images 5
Types for enumerating on-screen windows and capturing their composited images.
- StCGWindowListOptionA structure of options that control which windows a window list includes.
- StCGWindowImageOptionA structure of options that control how a window image is composited.
- EnCGWindowSharingTypeConstants that specify how a window's contents may be shared with other processes.
- EnCGWindowBackingTypeConstants that identify the type of backing store used by a window.
- EnCGWindowLevelKeyConstants that identify standard window levels in the on-screen window ordering.
Events and Input 18
Types for creating, posting, and intercepting low-level keyboard, mouse, and scroll events.
- ClCGEventAn object that represents a low-level keyboard, mouse, scroll, or tablet event.
- ClCGEventSourceAn object that represents the source state used to create and post events.
- EnCGEventTypeConstants that identify the kind of a low-level event.
- EnCGEventFieldConstants that identify the data fields that can be read from or written to an event.
- StCGEventFlagsA structure of modifier-key and state flags associated with an event.
- EnCGEventSourceStateIDConstants that identify the source state used when creating events.
- EnCGEventTapLocationConstants that specify where in the event stream an event tap is installed.
- EnCGEventTapPlacementConstants that specify whether an event tap is inserted before or after existing taps.
- EnCGEventTapOptionsConstants that specify whether an event tap can modify events or only observe them.
- St__CGEventTapInformationA structure that describes the configuration and state of an installed event tap.
- StCGEventFilterMaskA structure of flags that specify which event types an event filter passes.
- EnCGEventMouseSubtypeConstants that identify the subtype of a mouse event.
- EnCGEventSuppressionStateConstants that specify how local hardware events are suppressed when posting events.
- EnCGMouseButtonConstants that identify the mouse button associated with an event.
- EnCGScrollEventUnitConstants that specify whether scroll amounts are measured in pixels or lines.
- EnCGScrollPhaseConstants that describe the phase of a scroll gesture.
- EnCGMomentumScrollPhaseConstants that describe the momentum phase of a continuous scroll gesture.
- EnCGGesturePhaseConstants that describe the phase of a continuous gesture.
Errors 1
Result codes reported by Core Graphics operations.
- EnCGErrorResult codes that report the outcome of a Core Graphics operation.
Structures 1
- StCGBitmapParametersiOS 26.0+
Type Aliases 66
- TyCGBitmapContextReleaseDataCallback
- TyCGDataConsumerPutBytesCallback
- TyCGDataConsumerReleaseInfoCallback
- TyCGDataProviderGetBytesCallback
- TyCGDataProviderSkipForwardCallback
- TyCGDataProviderRewindCallback
- TyCGDataProviderReleaseInfoCallback
- TyCGDataProviderGetBytePointerCallback
- TyCGDataProviderReleaseBytePointerCallback
- TyCGDataProviderGetBytesAtPositionCallback
- TyCGDataProviderReleaseDataCallback
- TyCGDirectDisplayID
- TyCGOpenGLDisplayMask
- TyCGRefreshRate
- TyCGGammaValue
- TyCGDisplayCount
Show 50 more
- TyCGDisplayErr
- TyCGDisplayConfigRef
- TyCGDisplayReconfigurationCallBack
- TyCGDisplayFadeReservationToken
- TyCGDisplayBlendFraction
- TyCGDisplayFadeInterval
- TyCGDisplayReservationInterval
- TyCGDisplayStreamFrameAvailableHandler
- TyCGErrorCallback
- TyCGEventTimestamp
- TyCGEventMask
- TyCGEventTapProxy
- TyCGEventTapCallBack
- TyCGEventTapInformation
- TyCGEventSourceKeyboardType
- TyCGFontIndex
- TyCGGlyph
- TyCGFunctionEvaluateCallback
- TyCGFunctionReleaseInfoCallback
- TyCGPDFArrayApplierBlock
- TyCGPDFContentStreamRef
- TyCGPDFDictionaryApplierFunction
- TyCGPDFDictionaryApplierBlock
- TyCGPDFBoolean
- TyCGPDFInteger
- TyCGPDFReal
- TyCGPDFOperatorTableRef
- TyCGPDFOperatorCallback
- TyCGPDFScannerRef
- TyCGPSConverterBeginDocumentCallback
- TyCGPSConverterEndDocumentCallback
- TyCGPSConverterBeginPageCallback
- TyCGPSConverterEndPageCallback
- TyCGPSConverterProgressCallback
- TyCGPSConverterMessageCallback
- TyCGPSConverterReleaseInfoCallback
- TyCGPathApplierFunction
- TyCGPathApplyBlock
- TyCGPatternDrawPatternCallback
- TyCGPatternReleaseInfoCallback
- TyCGEventErr
- TyCGButtonCount
- TyCGWheelCount
- TyCGCharCode
- TyCGKeyCode
- TyCGScreenRefreshCallback
- TyCGScreenUpdateMoveCallback
- TyCGRectCount
- TyCGWindowID
- TyCGWindowLevel