<!--
{
  "documentType" : "article",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/core-graphics-functions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Core Graphics Functions"
}
-->

# Core Graphics Functions

## Topics

### Functions

[`func CGAcquireDisplayFadeReservation(CGDisplayReservationInterval, UnsafeMutablePointer<CGDisplayFadeReservationToken>?) -> CGError`](/documentation/CoreGraphics/CGAcquireDisplayFadeReservation(_:_:))

Reserves the fade hardware for a specified time interval.

[`func CGAssociateMouseAndMouseCursorPosition(boolean_t) -> CGError`](/documentation/CoreGraphics/CGAssociateMouseAndMouseCursorPosition(_:))

Connects or disconnects the mouse and cursor while an application is in the foreground.

[`func CGBeginDisplayConfiguration(UnsafeMutablePointer<CGDisplayConfigRef?>?) -> CGError`](/documentation/CoreGraphics/CGBeginDisplayConfiguration(_:))

Begins a new set of display configuration changes.

[`func CGCancelDisplayConfiguration(CGDisplayConfigRef?) -> CGError`](/documentation/CoreGraphics/CGCancelDisplayConfiguration(_:))

Cancels a set of display configuration changes.

[`func CGCaptureAllDisplays() -> CGError`](/documentation/CoreGraphics/CGCaptureAllDisplays())

Obtains exclusive use of all active displays, preventing other applications and system services from using the display or changing its configuration.

[`func CGCaptureAllDisplaysWithOptions(CGCaptureOptions) -> CGError`](/documentation/CoreGraphics/CGCaptureAllDisplaysWithOptions(_:))

Captures all attached displays, using the specified options.

[`extern CGColorConversionInfoRefCGColorConversionInfoCreateFromList(CFDictionaryRef options, CGColorSpaceRef , CGColorConversionInfoTransformType , CGColorRenderingIntent , ...);`](/documentation/CoreGraphics/CGColorConversionInfoCreateFromList)

Creates a conversion between an arbitrary number of specified color spaces.

[`func CGCompleteDisplayConfiguration(CGDisplayConfigRef?, CGConfigureOption) -> CGError`](/documentation/CoreGraphics/CGCompleteDisplayConfiguration(_:_:))

Completes a set of display configuration changes.

[`func CGConfigureDisplayFadeEffect(CGDisplayConfigRef?, CGDisplayFadeInterval, CGDisplayFadeInterval, Float, Float, Float) -> CGError`](/documentation/CoreGraphics/CGConfigureDisplayFadeEffect(_:_:_:_:_:_:))

Modifies the settings of the built-in fade effect that occurs during a display configuration.

[`func CGConfigureDisplayMirrorOfDisplay(CGDisplayConfigRef?, CGDirectDisplayID, CGDirectDisplayID) -> CGError`](/documentation/CoreGraphics/CGConfigureDisplayMirrorOfDisplay(_:_:_:))

Changes the configuration of a mirroring set.

[`func CGConfigureDisplayMode(CGDisplayConfigRef?, CGDirectDisplayID, CFDictionary?) -> CGError`](/documentation/CoreGraphics/CGConfigureDisplayMode(_:_:_:))

Configures the display mode of a display.

[`func CGConfigureDisplayOrigin(CGDisplayConfigRef?, CGDirectDisplayID, Int32, Int32) -> CGError`](/documentation/CoreGraphics/CGConfigureDisplayOrigin(_:_:_:_:))

Configures the origin of a display relative to the global display coordinate space.

[`func CGConfigureDisplayStereoOperation(CGDisplayConfigRef?, CGDirectDisplayID, boolean_t, boolean_t) -> CGError`](/documentation/CoreGraphics/CGConfigureDisplayStereoOperation(_:_:_:_:))

Enables or disables stereo operation for a display, as part of a display configuration.

[`func CGConfigureDisplayWithDisplayMode(CGDisplayConfigRef?, CGDirectDisplayID, CGDisplayMode?, CFDictionary?) -> CGError`](/documentation/CoreGraphics/CGConfigureDisplayWithDisplayMode(_:_:_:_:))

Configures the display mode of a display.

[`extern void CGContextDrawPDFDocument(CGContextRef c, CGRect rect, CGPDFDocumentRef document, int page);`](/documentation/CoreGraphics/CGContextDrawPDFDocument)

[`func CGCursorIsDrawnInFramebuffer() -> boolean_t`](/documentation/CoreGraphics/CGCursorIsDrawnInFramebuffer())

Returns a Boolean value indicating whether the mouse cursor is drawn in framebuffer memory.

[`func CGCursorIsVisible() -> boolean_t`](/documentation/CoreGraphics/CGCursorIsVisible())

Returns a Boolean value indicating whether the mouse cursor is visible.

[`func CGDirectDisplayCopyCurrentMetalDevice(CGDirectDisplayID) -> (any MTLDevice)?`](/documentation/CoreGraphics/CGDirectDisplayCopyCurrentMetalDevice(_:))

Returns the GPU device instance that’s currently driving a display.

[`func CGDisplayAvailableModes(CGDirectDisplayID) -> CFArray?`](/documentation/CoreGraphics/CGDisplayAvailableModes(_:))

Returns information about the currently available display modes.

[`func CGDisplayBestModeForParameters(CGDirectDisplayID, Int, Int, Int, UnsafeMutablePointer<boolean_t>?) -> CFDictionary?`](/documentation/CoreGraphics/CGDisplayBestModeForParameters(_:_:_:_:_:))

Returns information about the display mode closest to a specified depth and screen size.

[`func CGDisplayBestModeForParametersAndRefreshRate(CGDirectDisplayID, Int, Int, Int, CGRefreshRate, UnsafeMutablePointer<boolean_t>?) -> CFDictionary?`](/documentation/CoreGraphics/CGDisplayBestModeForParametersAndRefreshRate(_:_:_:_:_:_:))

Returns information about the display mode closest to a specified depth, screen size, and refresh rate.

[`func CGDisplayBounds(CGDirectDisplayID) -> CGRect`](/documentation/CoreGraphics/CGDisplayBounds(_:))

Returns the bounds of a display in the global display coordinate space.

[`func CGDisplayCapture(CGDirectDisplayID) -> CGError`](/documentation/CoreGraphics/CGDisplayCapture(_:))

Obtains exclusive use of a display, preventing other applications and system services from using the display or changing its configuration.

[`func CGDisplayCaptureWithOptions(CGDirectDisplayID, CGCaptureOptions) -> CGError`](/documentation/CoreGraphics/CGDisplayCaptureWithOptions(_:_:))

Obtains exclusive use of a display for an application using the options you specify.

[`func CGDisplayCopyAllDisplayModes(CGDirectDisplayID, CFDictionary?) -> CFArray?`](/documentation/CoreGraphics/CGDisplayCopyAllDisplayModes(_:_:))

Returns information about the currently available display modes.

[`func CGDisplayCopyColorSpace(CGDirectDisplayID) -> CGColorSpace`](/documentation/CoreGraphics/CGDisplayCopyColorSpace(_:))

Returns the color space for a display.

[`func CGDisplayCopyDisplayMode(CGDirectDisplayID) -> CGDisplayMode?`](/documentation/CoreGraphics/CGDisplayCopyDisplayMode(_:))

Returns information about a display’s current configuration.

[`func CGDisplayCurrentMode(CGDirectDisplayID) -> CFDictionary?`](/documentation/CoreGraphics/CGDisplayCurrentMode(_:))

Returns information about the current display mode.

[`func CGDisplayFade(CGDisplayFadeReservationToken, CGDisplayFadeInterval, CGDisplayBlendFraction, CGDisplayBlendFraction, Float, Float, Float, boolean_t) -> CGError`](/documentation/CoreGraphics/CGDisplayFade(_:_:_:_:_:_:_:_:))

Performs a single fade operation.

[`func CGDisplayFadeOperationInProgress() -> boolean_t`](/documentation/CoreGraphics/CGDisplayFadeOperationInProgress())

Returns a Boolean value indicating whether a fade operation is currently in progress.

[`func CGDisplayGammaTableCapacity(CGDirectDisplayID) -> UInt32`](/documentation/CoreGraphics/CGDisplayGammaTableCapacity(_:))

Returns the capacity, or number of entries, in the gamma table for a display.

[`func CGDisplayGetDrawingContext(CGDirectDisplayID) -> CGContext?`](/documentation/CoreGraphics/CGDisplayGetDrawingContext(_:))

Returns a graphics context suitable for drawing to a captured display.

[`func CGDisplayHideCursor(CGDirectDisplayID) -> CGError`](/documentation/CoreGraphics/CGDisplayHideCursor(_:))

Hides the mouse cursor, and increments the hide cursor count.

[`func CGDisplayIDToOpenGLDisplayMask(CGDirectDisplayID) -> CGOpenGLDisplayMask`](/documentation/CoreGraphics/CGDisplayIDToOpenGLDisplayMask(_:))

Maps a display ID to an OpenGL display mask.

[`func CGDisplayIOServicePort(CGDirectDisplayID) -> io_service_t`](/documentation/CoreGraphics/CGDisplayIOServicePort(_:))

Returns the I/O Kit service port of the specified display.

[`func CGDisplayIsActive(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsActive(_:))

Returns a Boolean value indicating whether a display is active.

[`func CGDisplayIsAlwaysInMirrorSet(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsAlwaysInMirrorSet(_:))

Returns a Boolean value indicating whether a display is always in a mirroring set.

[`func CGDisplayIsAsleep(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsAsleep(_:))

Returns a Boolean value indicating whether a display is sleeping (and is therefore not drawable).

[`func CGDisplayIsBuiltin(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsBuiltin(_:))

Returns a Boolean value indicating whether a display is built-in, such as the internal display in portable systems.

[`func CGDisplayIsCaptured(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsCaptured(_:))

Returns a Boolean value indicating whether a display is captured.

[`func CGDisplayIsInHWMirrorSet(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsInHWMirrorSet(_:))

Returns a Boolean value indicating whether a display is in a hardware mirroring set.

[`func CGDisplayIsInMirrorSet(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsInMirrorSet(_:))

Returns a Boolean value indicating whether a display is in a mirroring set.

[`func CGDisplayIsMain(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsMain(_:))

Returns a Boolean value indicating whether a display is the main display.

[`func CGDisplayIsOnline(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsOnline(_:))

Returns a Boolean value indicating whether a display is connected or online.

[`func CGDisplayIsStereo(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayIsStereo(_:))

Returns a Boolean value indicating whether a display is running in a stereo graphics mode.

[`func CGDisplayMirrorsDisplay(CGDirectDisplayID) -> CGDirectDisplayID`](/documentation/CoreGraphics/CGDisplayMirrorsDisplay(_:))

For a secondary display in a mirroring set, returns the primary display.

[`var pixelEncoding: CFString?`](/documentation/CoreGraphics/CGDisplayMode/pixelEncoding)

Returns the pixel encoding of the specified display mode.

[`var height: Int`](/documentation/CoreGraphics/CGDisplayMode/height)

Returns the height of the specified display mode.

[`var ioDisplayModeID: Int32`](/documentation/CoreGraphics/CGDisplayMode/ioDisplayModeID)

Returns the I/O Kit display mode ID of the specified display mode.

[`var ioFlags: UInt32`](/documentation/CoreGraphics/CGDisplayMode/ioFlags)

Returns the I/O Kit flags of the specified display mode.

[`var pixelWidth: Int`](/documentation/CoreGraphics/CGDisplayMode/pixelWidth)

[`var refreshRate: Double`](/documentation/CoreGraphics/CGDisplayMode/refreshRate)

Returns the refresh rate of the specified display mode.

[`class var typeID: CFTypeID`](/documentation/CoreGraphics/CGDisplayMode/typeID)

Returns the type identifier of Quartz display modes.

[`var width: Int`](/documentation/CoreGraphics/CGDisplayMode/width)

Returns the width of the specified display mode.

[`func isUsableForDesktopGUI() -> Bool`](/documentation/CoreGraphics/CGDisplayMode/isUsableForDesktopGUI())

Returns a Boolean value indicating whether the specified display mode is usable for a desktop graphical user interface.

[`extern void CGDisplayModeRelease(CGDisplayModeRef mode);`](/documentation/CoreGraphics/CGDisplayModeRelease)

Releases a Core Graphics display mode.

[`extern CGDisplayModeRefCGDisplayModeRetain(CGDisplayModeRef mode);`](/documentation/CoreGraphics/CGDisplayModeRetain)

Retains a Core Graphics display mode.

[`func CGDisplayModelNumber(CGDirectDisplayID) -> UInt32`](/documentation/CoreGraphics/CGDisplayModelNumber(_:))

Returns the model number of a display monitor.

[`func CGDisplayMoveCursorToPoint(CGDirectDisplayID, CGPoint) -> CGError`](/documentation/CoreGraphics/CGDisplayMoveCursorToPoint(_:_:))

Moves the mouse cursor to a specified point relative to the upper-left corner of the display.

[`func CGDisplayPixelsHigh(CGDirectDisplayID) -> Int`](/documentation/CoreGraphics/CGDisplayPixelsHigh(_:))

Returns the display height in pixel units.

[`func CGDisplayPixelsWide(CGDirectDisplayID) -> Int`](/documentation/CoreGraphics/CGDisplayPixelsWide(_:))

Returns the display width in pixel units.

[`func CGDisplayPrimaryDisplay(CGDirectDisplayID) -> CGDirectDisplayID`](/documentation/CoreGraphics/CGDisplayPrimaryDisplay(_:))

Returns the primary display in a hardware mirroring set.

[`func CGDisplayRegisterReconfigurationCallback(CGDisplayReconfigurationCallBack?, UnsafeMutableRawPointer?) -> CGError`](/documentation/CoreGraphics/CGDisplayRegisterReconfigurationCallback(_:_:))

Registers a callback function to be invoked whenever a local display is reconfigured.

[`func CGDisplayRelease(CGDirectDisplayID) -> CGError`](/documentation/CoreGraphics/CGDisplayRelease(_:))

Releases a captured display.

[`func CGDisplayRemoveReconfigurationCallback(CGDisplayReconfigurationCallBack?, UnsafeMutableRawPointer?) -> CGError`](/documentation/CoreGraphics/CGDisplayRemoveReconfigurationCallback(_:_:))

Removes the registration of a callback function that’s invoked whenever a local display is reconfigured.

[`func CGDisplayRestoreColorSyncSettings()`](/documentation/CoreGraphics/CGDisplayRestoreColorSyncSettings())

Restores the gamma tables to the values in the user’s ColorSync display profile.

[`func CGDisplayRotation(CGDirectDisplayID) -> Double`](/documentation/CoreGraphics/CGDisplayRotation(_:))

Returns the rotation angle of a display in degrees.

[`func CGDisplayScreenSize(CGDirectDisplayID) -> CGSize`](/documentation/CoreGraphics/CGDisplayScreenSize(_:))

Returns the width and height of a display in millimeters.

[`func CGDisplaySerialNumber(CGDirectDisplayID) -> UInt32`](/documentation/CoreGraphics/CGDisplaySerialNumber(_:))

Returns the serial number of a display monitor.

[`func CGDisplaySetDisplayMode(CGDirectDisplayID, CGDisplayMode?, CFDictionary?) -> CGError`](/documentation/CoreGraphics/CGDisplaySetDisplayMode(_:_:_:))

Switches a display to a different mode.

[`func CGDisplaySetStereoOperation(CGDirectDisplayID, boolean_t, boolean_t, CGConfigureOption) -> CGError`](/documentation/CoreGraphics/CGDisplaySetStereoOperation(_:_:_:_:))

Immediately enables or disables stereo operation for a display.

[`func CGDisplayShowCursor(CGDirectDisplayID) -> CGError`](/documentation/CoreGraphics/CGDisplayShowCursor(_:))

Decrements the hide cursor count, and shows the mouse cursor if the count is `0`.

[`func CGDisplaySwitchToMode(CGDirectDisplayID, CFDictionary?) -> CGError`](/documentation/CoreGraphics/CGDisplaySwitchToMode(_:_:))

Switches a display to a different mode.

[`func CGDisplayUnitNumber(CGDirectDisplayID) -> UInt32`](/documentation/CoreGraphics/CGDisplayUnitNumber(_:))

Returns the logical unit number of a display.

[`func CGDisplayUsesOpenGLAcceleration(CGDirectDisplayID) -> boolean_t`](/documentation/CoreGraphics/CGDisplayUsesOpenGLAcceleration(_:))

Returns a Boolean value indicating whether Quartz is using OpenGL-based window acceleration (Quartz Extreme) to render in a display.

[`func CGDisplayVendorNumber(CGDirectDisplayID) -> UInt32`](/documentation/CoreGraphics/CGDisplayVendorNumber(_:))

Returns the vendor number of the specified display’s monitor.

[`func CGEnableEventStateCombining(boolean_t) -> CGError`](/documentation/CoreGraphics/CGEnableEventStateCombining(_:))

Enables or disables the merging of actual key and mouse state with the application-specified state in a synthetic event.

[`init?(source: CGEventSource?)`](/documentation/CoreGraphics/CGEvent/init(source:))

Returns a new Quartz event.

[`func copy() -> CGEvent?`](/documentation/CoreGraphics/CGEvent/copy())

Returns a copy of an existing Quartz event.

[`extern CFDataRefCGEventCreateData(CFAllocatorRef allocator, CGEventRef event);`](/documentation/CoreGraphics/CGEventCreateData)

Returns a flattened data representation of a Quartz event.

[`init?(withDataAllocator: CFAllocator?, data: CFData?)`](/documentation/CoreGraphics/CGEvent/init(withDataAllocator:data:))

Returns a Quartz event created from a flattened data representation of the event.

[`init?(keyboardEventSource: CGEventSource?, virtualKey: CGKeyCode, keyDown: Bool)`](/documentation/CoreGraphics/CGEvent/init(keyboardEventSource:virtualKey:keyDown:))

Returns a new Quartz keyboard event.

[`init?(mouseEventSource: CGEventSource?, mouseType: CGEventType, mouseCursorPosition: CGPoint, mouseButton: CGMouseButton)`](/documentation/CoreGraphics/CGEvent/init(mouseEventSource:mouseType:mouseCursorPosition:mouseButton:))

Returns a new Quartz mouse event.

[`extern CGEventRefCGEventCreateScrollWheelEvent(CGEventSourceRef source, CGScrollEventUnit units, uint32_t wheelCount, int32_t wheel1, ...);`](/documentation/CoreGraphics/CGEventCreateScrollWheelEvent)

Returns a new Quartz scrolling event.

[`init?(event: CGEvent?)`](/documentation/CoreGraphics/CGEventSource/init(event:))

Returns a Quartz event source created from an existing Quartz event.

[`func getDoubleValueField(CGEventField) -> Double`](/documentation/CoreGraphics/CGEvent/getDoubleValueField(_:))

Returns the floating-point value of a field in a Quartz event.

[`var flags: CGEventFlags`](/documentation/CoreGraphics/CGEvent/flags)

Returns the event flags of a Quartz event.

[`func getIntegerValueField(CGEventField) -> Int64`](/documentation/CoreGraphics/CGEvent/getIntegerValueField(_:))

Returns the integer value of a field in a Quartz event.

[`var location: CGPoint`](/documentation/CoreGraphics/CGEvent/location)

Returns the location of a Quartz mouse event.

[`var timestamp: CGEventTimestamp`](/documentation/CoreGraphics/CGEvent/timestamp)

Returns the timestamp of a Quartz event.

[`var type: CGEventType`](/documentation/CoreGraphics/CGEvent/type)

Returns the event type of a Quartz event (left mouse down, for example).

[`class var typeID: CFTypeID`](/documentation/CoreGraphics/CGEvent/typeID)

Returns the type identifier for the opaque type `CGEventRef`.

[`var unflippedLocation: CGPoint`](/documentation/CoreGraphics/CGEvent/unflippedLocation)

Returns the location of a Quartz mouse event.

[`func keyboardGetUnicodeString(maxStringLength: Int, actualStringLength: UnsafeMutablePointer<Int>?, unicodeString: UnsafeMutablePointer<UniChar>?)`](/documentation/CoreGraphics/CGEvent/keyboardGetUnicodeString(maxStringLength:actualStringLength:unicodeString:))

Returns the Unicode string associated with a Quartz keyboard event.

[`func keyboardSetUnicodeString(stringLength: Int, unicodeString: UnsafePointer<UniChar>?)`](/documentation/CoreGraphics/CGEvent/keyboardSetUnicodeString(stringLength:unicodeString:))

Sets the Unicode string associated with a Quartz keyboard event.

[`func post(tap: CGEventTapLocation)`](/documentation/CoreGraphics/CGEvent/post(tap:))

Posts a Quartz event into the event stream at a specified location.

[`func postToPSN(processSerialNumber: UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGEvent/postToPSN(processSerialNumber:))

Posts a Quartz event into the event stream for a specific application.

[`func postToPid(pid_t)`](/documentation/CoreGraphics/CGEvent/postToPid(_:))

[`func setDoubleValueField(CGEventField, value: Double)`](/documentation/CoreGraphics/CGEvent/setDoubleValueField(_:value:))

Sets the floating-point value of a field in a Quartz event.

[`extern void CGEventSetFlags(CGEventRef event, CGEventFlags flags);`](/documentation/CoreGraphics/CGEventSetFlags)

Sets the event flags of a Quartz event.

[`func setIntegerValueField(CGEventField, value: Int64)`](/documentation/CoreGraphics/CGEvent/setIntegerValueField(_:value:))

Sets the integer value of a field in a Quartz event.

[`extern void CGEventSetLocation(CGEventRef event, CGPoint location);`](/documentation/CoreGraphics/CGEventSetLocation)

Sets the location of a Quartz mouse event.

[`func setSource(CGEventSource?)`](/documentation/CoreGraphics/CGEvent/setSource(_:))

Sets the event source of a Quartz event.

[`extern void CGEventSetTimestamp(CGEventRef event, CGEventTimestamp timestamp);`](/documentation/CoreGraphics/CGEventSetTimestamp)

Sets the timestamp of a Quartz event.

[`extern void CGEventSetType(CGEventRef event, CGEventType type);`](/documentation/CoreGraphics/CGEventSetType)

Sets the event type of a Quartz event (left mouse down, for example).

[`class func buttonState(CGEventSourceStateID, button: CGMouseButton) -> Bool`](/documentation/CoreGraphics/CGEventSource/buttonState(_:button:))

Returns a Boolean value indicating the current button state of a Quartz event source.

[`class func counterForEventType(CGEventSourceStateID, eventType: CGEventType) -> UInt32`](/documentation/CoreGraphics/CGEventSource/counterForEventType(_:eventType:))

Returns a count of events of a given type seen since the window server started.

[`init?(stateID: CGEventSourceStateID)`](/documentation/CoreGraphics/CGEventSource/init(stateID:))

Returns a Quartz event source created with a specified source state.

[`class func flagsState(CGEventSourceStateID) -> CGEventFlags`](/documentation/CoreGraphics/CGEventSource/flagsState(_:))

Returns the current flags of a Quartz event source.

[`var keyboardType: CGEventSourceKeyboardType`](/documentation/CoreGraphics/CGEventSource/keyboardType)

Returns the keyboard type to be used with a Quartz event source.

[`func getLocalEventsFilterDuringSuppressionState(CGEventSuppressionState) -> CGEventFilterMask`](/documentation/CoreGraphics/CGEventSource/getLocalEventsFilterDuringSuppressionState(_:))

Returns the mask that indicates which classes of local hardware events are enabled during event suppression.

[`var pixelsPerLine: Double`](/documentation/CoreGraphics/CGEventSource/pixelsPerLine)

Gets the scale of pixels per line in a scrolling event source.

[`var sourceStateID: CGEventSourceStateID`](/documentation/CoreGraphics/CGEventSource/sourceStateID)

Returns the source state associated with a Quartz event source.

[`class var typeID: CFTypeID`](/documentation/CoreGraphics/CGEventSource/typeID)

Returns the type identifier for the opaque type `CGEventSourceRef`.

[`var userData: Int64`](/documentation/CoreGraphics/CGEventSource/userData)

Returns the 64-bit user-specified data for a Quartz event source.

[`class func keyState(CGEventSourceStateID, key: CGKeyCode) -> Bool`](/documentation/CoreGraphics/CGEventSource/keyState(_:key:))

Returns a Boolean value indicating the current keyboard state of a Quartz event source.

[`class func secondsSinceLastEventType(CGEventSourceStateID, eventType: CGEventType) -> CFTimeInterval`](/documentation/CoreGraphics/CGEventSource/secondsSinceLastEventType(_:eventType:))

Returns the elapsed time since the last event for a Quartz event source.

[`extern void CGEventSourceSetKeyboardType(CGEventSourceRef source, CGEventSourceKeyboardType keyboardType);`](/documentation/CoreGraphics/CGEventSourceSetKeyboardType)

Sets the keyboard type to be used with a Quartz event source.

[`func setLocalEventsFilterDuringSuppressionState(CGEventFilterMask, state: CGEventSuppressionState)`](/documentation/CoreGraphics/CGEventSource/setLocalEventsFilterDuringSuppressionState(_:state:))

Sets the mask that indicates which classes of local hardware events are enabled during event suppression.

[`extern void CGEventSourceSetLocalEventsSuppressionInterval(CGEventSourceRef source, CFTimeInterval seconds);`](/documentation/CoreGraphics/CGEventSourceSetLocalEventsSuppressionInterval)

Sets the interval that local hardware events may be suppressed following the posting of a Quartz event.

[`extern void CGEventSourceSetPixelsPerLine(CGEventSourceRef source, double pixelsPerLine);`](/documentation/CoreGraphics/CGEventSourceSetPixelsPerLine)

Sets the scale of pixels per line in a scrolling event source.

[`extern void CGEventSourceSetUserData(CGEventSourceRef source, int64_t userData);`](/documentation/CoreGraphics/CGEventSourceSetUserData)

Sets the 64-bit user-specified data for a Quartz event source.

[`class func tapCreate(tap: CGEventTapLocation, place: CGEventTapPlacement, options: CGEventTapOptions, eventsOfInterest: CGEventMask, callback: CGEventTapCallBack, userInfo: UnsafeMutableRawPointer?) -> CFMachPort?`](/documentation/CoreGraphics/CGEvent/tapCreate(tap:place:options:eventsOfInterest:callback:userInfo:))

Creates an event tap.

[`class func tapCreateForPSN(processSerialNumber: UnsafeMutableRawPointer, place: CGEventTapPlacement, options: CGEventTapOptions, eventsOfInterest: CGEventMask, callback: CGEventTapCallBack, userInfo: UnsafeMutableRawPointer?) -> CFMachPort?`](/documentation/CoreGraphics/CGEvent/tapCreateForPSN(processSerialNumber:place:options:eventsOfInterest:callback:userInfo:))

Creates an event tap for a specified process.

[`class func tapCreateForPid(pid: pid_t, place: CGEventTapPlacement, options: CGEventTapOptions, eventsOfInterest: CGEventMask, callback: CGEventTapCallBack, userInfo: UnsafeMutableRawPointer?) -> CFMachPort?`](/documentation/CoreGraphics/CGEvent/tapCreateForPid(pid:place:options:eventsOfInterest:callback:userInfo:))

[`class func tapEnable(tap: CFMachPort, enable: Bool)`](/documentation/CoreGraphics/CGEvent/tapEnable(tap:enable:))

Enables or disables an event tap.

[`class func tapIsEnabled(tap: CFMachPort) -> Bool`](/documentation/CoreGraphics/CGEvent/tapIsEnabled(tap:))

Returns a Boolean value indicating whether an event tap is enabled.

[`func tapPostEvent(CGEventTapProxy?)`](/documentation/CoreGraphics/CGEvent/tapPostEvent(_:))

Posts a Quartz event from an event tap into the event stream.

[`func CGGetActiveDisplayList(UInt32, UnsafeMutablePointer<CGDirectDisplayID>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetActiveDisplayList(_:_:_:))

Provides a list of displays that are active for drawing.

[`func CGGetDisplayTransferByFormula(CGDirectDisplayID, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?) -> CGError`](/documentation/CoreGraphics/CGGetDisplayTransferByFormula(_:_:_:_:_:_:_:_:_:_:))

Gets the coefficients of the gamma transfer formula for a display.

[`func CGGetDisplayTransferByTable(CGDirectDisplayID, UInt32, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<CGGammaValue>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetDisplayTransferByTable(_:_:_:_:_:_:))

Gets the values in the RGB gamma tables for a display.

[`func CGGetDisplaysWithOpenGLDisplayMask(CGOpenGLDisplayMask, UInt32, UnsafeMutablePointer<CGDirectDisplayID>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetDisplaysWithOpenGLDisplayMask(_:_:_:_:))

Provides a list of displays that corresponds to the bits set in an OpenGL display mask.

[`func CGGetDisplaysWithPoint(CGPoint, UInt32, UnsafeMutablePointer<CGDirectDisplayID>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetDisplaysWithPoint(_:_:_:_:))

Provides a list of online displays with bounds that include the specified point.

[`func CGGetDisplaysWithRect(CGRect, UInt32, UnsafeMutablePointer<CGDirectDisplayID>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetDisplaysWithRect(_:_:_:_:))

Gets a list of online displays with bounds that intersect the specified rectangle.

[`func CGGetEventTapList(UInt32, UnsafeMutablePointer<CGEventTapInformation>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetEventTapList(_:_:_:))

Gets a list of currently installed event taps.

[`func CGGetLastMouseDelta() -> (x: Int32, y: Int32)`](/documentation/CoreGraphics/CGGetLastMouseDelta())

Reports the change in mouse position since the last mouse movement event received by the application.

[`extern void CGGetLastMouseDelta(int32_t *deltaX, int32_t *deltaY);`](/documentation/CoreGraphics/CGGetLastMouseDelta)

Reports the change in mouse position since the last mouse movement event received by the application.

[`func CGGetOnlineDisplayList(UInt32, UnsafeMutablePointer<CGDirectDisplayID>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGGetOnlineDisplayList(_:_:_:))

Provides a list of displays that are online (active, mirrored, or sleeping).

[`var utType: CFString?`](/documentation/CoreGraphics/CGImage/utType)

The Universal Type Identifier for the image.

[`func CGInhibitLocalEvents(boolean_t) -> CGError`](/documentation/CoreGraphics/CGInhibitLocalEvents(_:))

Turns off local hardware events in the current session.

[`func CGMainDisplayID() -> CGDirectDisplayID`](/documentation/CoreGraphics/CGMainDisplayID())

Returns the display ID of the main display.

[`func CGOpenGLDisplayMaskToDisplayID(CGOpenGLDisplayMask) -> CGDirectDisplayID`](/documentation/CoreGraphics/CGOpenGLDisplayMaskToDisplayID(_:))

Maps an OpenGL display mask to a display ID.

[`func CGPointEqualToPoint(CGPoint, CGPoint) -> Bool`](/documentation/CoreGraphics/CGPointEqualToPoint(_:_:))

Returns whether two points are equal.

[`func CGPostKeyboardEvent(CGCharCode, CGKeyCode, boolean_t) -> CGError`](/documentation/CoreGraphics/CGPostKeyboardEvent(_:_:_:))

Synthesizes a low-level keyboard event on the local machine.

[`extern CGError CGPostMouseEvent(CGPoint mouseCursorPosition, boolean_t updateMouseCursorPosition, CGButtonCount buttonCount, boolean_t mouseButtonDown, ...);`](/documentation/CoreGraphics/CGPostMouseEvent)

Synthesizes a low-level mouse-button event on the local machine.

[`extern CGError CGPostScrollWheelEvent(CGWheelCount wheelCount, int32_t wheel1, ...);`](/documentation/CoreGraphics/CGPostScrollWheelEvent)

Synthesizes a low-level scrolling event on the local machine.

[`func CGRegisterScreenRefreshCallback(CGScreenRefreshCallback, UnsafeMutableRawPointer?) -> CGError`](/documentation/CoreGraphics/CGRegisterScreenRefreshCallback(_:_:))

Registers a callback function to be invoked when local displays are refreshed or modified.

[`func CGReleaseAllDisplays() -> CGError`](/documentation/CoreGraphics/CGReleaseAllDisplays())

Releases all captured displays.

[`func CGReleaseDisplayFadeReservation(CGDisplayFadeReservationToken) -> CGError`](/documentation/CoreGraphics/CGReleaseDisplayFadeReservation(_:))

Releases a display fade reservation, and unfades the display if needed.

[`func CGReleaseScreenRefreshRects(UnsafeMutablePointer<CGRect>?)`](/documentation/CoreGraphics/CGReleaseScreenRefreshRects(_:))

Deallocates a list of rectangles that represent changed areas on local displays.

[`func CGRestorePermanentDisplayConfiguration()`](/documentation/CoreGraphics/CGRestorePermanentDisplayConfiguration())

Restores the permanent display configuration settings for the current user.

[`func CGScreenRegisterMoveCallback(CGScreenUpdateMoveCallback, UnsafeMutableRawPointer?) -> CGError`](/documentation/CoreGraphics/CGScreenRegisterMoveCallback(_:_:))

Registers a callback function to be invoked when an area of the display is moved.

[`func CGScreenUnregisterMoveCallback(CGScreenUpdateMoveCallback, UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGScreenUnregisterMoveCallback(_:_:))

Removes a previously registered callback function invoked when an area of the display is moved.

[`func CGSessionCopyCurrentDictionary() -> CFDictionary?`](/documentation/CoreGraphics/CGSessionCopyCurrentDictionary())

Returns information about the caller’s window server session.

[`func CGSetDisplayTransferByByteTable(CGDirectDisplayID, UInt32, UnsafePointer<UInt8>, UnsafePointer<UInt8>, UnsafePointer<UInt8>) -> CGError`](/documentation/CoreGraphics/CGSetDisplayTransferByByteTable(_:_:_:_:_:))

Sets the byte values in the 8-bit RGB gamma tables for a display.

[`func CGSetDisplayTransferByFormula(CGDirectDisplayID, CGGammaValue, CGGammaValue, CGGammaValue, CGGammaValue, CGGammaValue, CGGammaValue, CGGammaValue, CGGammaValue, CGGammaValue) -> CGError`](/documentation/CoreGraphics/CGSetDisplayTransferByFormula(_:_:_:_:_:_:_:_:_:_:))

Sets the gamma function for a display by specifying the coefficients of the gamma transfer formula.

[`func CGSetDisplayTransferByTable(CGDirectDisplayID, UInt32, UnsafePointer<CGGammaValue>?, UnsafePointer<CGGammaValue>?, UnsafePointer<CGGammaValue>?) -> CGError`](/documentation/CoreGraphics/CGSetDisplayTransferByTable(_:_:_:_:_:))

Sets the color gamma function for a display by specifying the values in the RGB gamma tables.

[`func CGSetLocalEventsFilterDuringSuppressionState(CGEventFilterMask, CGEventSuppressionState) -> CGError`](/documentation/CoreGraphics/CGSetLocalEventsFilterDuringSuppressionState(_:_:))

Filters local hardware events from the keyboard and mouse during the short interval after a synthetic event is posted.

[`func CGSetLocalEventsSuppressionInterval(CFTimeInterval) -> CGError`](/documentation/CoreGraphics/CGSetLocalEventsSuppressionInterval(_:))

Sets the time interval in seconds that local hardware events are suppressed after posting a synthetic event.

[`func CGShieldingWindowID(CGDirectDisplayID) -> CGWindowID`](/documentation/CoreGraphics/CGShieldingWindowID(_:))

Returns the window ID of the shield window for a captured display.

[`func CGShieldingWindowLevel() -> CGWindowLevel`](/documentation/CoreGraphics/CGShieldingWindowLevel())

Returns the window level of the shield window for a captured display.

[`func CGSizeEqualToSize(CGSize, CGSize) -> Bool`](/documentation/CoreGraphics/CGSizeEqualToSize(_:_:))

Returns whether two sizes are equal.

[`func CGUnregisterScreenRefreshCallback(CGScreenRefreshCallback, UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGUnregisterScreenRefreshCallback(_:_:))

Removes a previously registered callback function invoked when local displays are refreshed or modified.

[`func CGWaitForScreenRefreshRects(UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGWaitForScreenRefreshRects(_:_:))

Waits for screen refresh operations.

[`func CGWaitForScreenUpdateRects(CGScreenUpdateOperation, UnsafeMutablePointer<CGScreenUpdateOperation>?, UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, UnsafeMutablePointer<Int>?, UnsafeMutablePointer<CGScreenUpdateMoveDelta>?) -> CGError`](/documentation/CoreGraphics/CGWaitForScreenUpdateRects(_:_:_:_:_:))

Waits for screen update operations.

[`func CGWarpMouseCursorPosition(CGPoint) -> CGError`](/documentation/CoreGraphics/CGWarpMouseCursorPosition(_:))

Moves the mouse cursor without generating events.

[`func CGWindowLevelForKey(CGWindowLevelKey) -> CGWindowLevel`](/documentation/CoreGraphics/CGWindowLevelForKey(_:))

Returns the window level that corresponds to one of the standard window types.

[`func CGWindowListCopyWindowInfo(CGWindowListOption, CGWindowID) -> CFArray?`](/documentation/CoreGraphics/CGWindowListCopyWindowInfo(_:_:))

Generates and returns information about the selected windows in the current user session.

[`extern CFArrayRefCGWindowListCreate(CGWindowListOption option, CGWindowID relativeToWindow);`](/documentation/CoreGraphics/CGWindowListCreate)

Returns the list of window IDs associated with the specified windows in the current user session.

[`func CGWindowListCreateDescriptionFromArray(CFArray?) -> CFArray?`](/documentation/CoreGraphics/CGWindowListCreateDescriptionFromArray(_:))

Generates and returns information about windows with the specified window IDs.

[`func CGWindowServerCFMachPort() -> CFMachPort?`](/documentation/CoreGraphics/CGWindowServerCFMachPort())

Returns a Core Foundation Mach port (CFMachPort) that corresponds to the macOS window server.

[`func CGWindowServerCreateServerPort() -> CFMachPort?`](/documentation/CoreGraphics/CGWindowServerCreateServerPort())

[`func acos(CGFloat) -> CGFloat`](/documentation/CoreGraphics/acos(_:))

[`func acosh(CGFloat) -> CGFloat`](/documentation/CoreGraphics/acosh(_:))

[`func asin(CGFloat) -> CGFloat`](/documentation/CoreGraphics/asin(_:))

[`func asinh(CGFloat) -> CGFloat`](/documentation/CoreGraphics/asinh(_:))

[`func atan(CGFloat) -> CGFloat`](/documentation/CoreGraphics/atan(_:))

[`func atan2(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/atan2(_:_:))

[`func atanh(CGFloat) -> CGFloat`](/documentation/CoreGraphics/atanh(_:))

[`func cbrt(CGFloat) -> CGFloat`](/documentation/CoreGraphics/cbrt(_:))

[`func copysign(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/copysign(_:_:))

[`func cos(CGFloat) -> CGFloat`](/documentation/CoreGraphics/cos(_:))

[`func cosh(CGFloat) -> CGFloat`](/documentation/CoreGraphics/cosh(_:))

[`func erf(CGFloat) -> CGFloat`](/documentation/CoreGraphics/erf(_:))

[`func erfc(CGFloat) -> CGFloat`](/documentation/CoreGraphics/erfc(_:))

[`func exp(CGFloat) -> CGFloat`](/documentation/CoreGraphics/exp(_:))

[`func exp2(CGFloat) -> CGFloat`](/documentation/CoreGraphics/exp2(_:))

[`func expm1(CGFloat) -> CGFloat`](/documentation/CoreGraphics/expm1(_:))

[`func fdim(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/fdim(_:_:))

[`func fmax(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/fmax(_:_:))

[`func fmin(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/fmin(_:_:))

[`func hypot(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/hypot(_:_:))

[`func ilogb(CGFloat) -> Int`](/documentation/CoreGraphics/ilogb(_:))

[`func CGColorSpaceCreateLinearized(CGColorSpace) -> CGColorSpace?`](/documentation/CoreGraphics/CGColorSpaceCreateLinearized(_:))

[`init?(src: CGColorSpace, dst: CGColorSpace)`](/documentation/CoreGraphics/CGColorConversionInfo/init(src:dst:))

Creates a conversion between two specified color spaces.

[`func j0(CGFloat) -> CGFloat`](/documentation/CoreGraphics/j0(_:))

[`func j1(CGFloat) -> CGFloat`](/documentation/CoreGraphics/j1(_:))

[`func jn(Int, CGFloat) -> CGFloat`](/documentation/CoreGraphics/jn(_:_:))

[`func ldexp(CGFloat, Int) -> CGFloat`](/documentation/CoreGraphics/ldexp(_:_:))

[`func lgamma(CGFloat) -> (CGFloat, Int)`](/documentation/CoreGraphics/lgamma(_:))

[`func log(CGFloat) -> CGFloat`](/documentation/CoreGraphics/log(_:))

[`func log10(CGFloat) -> CGFloat`](/documentation/CoreGraphics/log10(_:))

[`func log1p(CGFloat) -> CGFloat`](/documentation/CoreGraphics/log1p(_:))

[`func log2(CGFloat) -> CGFloat`](/documentation/CoreGraphics/log2(_:))

[`func logb(CGFloat) -> CGFloat`](/documentation/CoreGraphics/logb(_:))

[`func nan(String) -> CGFloat`](/documentation/CoreGraphics/nan(_:))

[`func nearbyint(CGFloat) -> CGFloat`](/documentation/CoreGraphics/nearbyint(_:))

[`func nextafter(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/nextafter(_:_:))

[`func pow(CGFloat, CGFloat) -> CGFloat`](/documentation/CoreGraphics/pow(_:_:))

[`func remquo(CGFloat, CGFloat) -> (CGFloat, Int)`](/documentation/CoreGraphics/remquo(_:_:))

[`func rint(CGFloat) -> CGFloat`](/documentation/CoreGraphics/rint(_:))

[`func sin(CGFloat) -> CGFloat`](/documentation/CoreGraphics/sin(_:))

[`func sinh(CGFloat) -> CGFloat`](/documentation/CoreGraphics/sinh(_:))

[`func tan(CGFloat) -> CGFloat`](/documentation/CoreGraphics/tan(_:))

[`func tanh(CGFloat) -> CGFloat`](/documentation/CoreGraphics/tanh(_:))

[`func tgamma(CGFloat) -> CGFloat`](/documentation/CoreGraphics/tgamma(_:))

[`var localEventsSuppressionInterval: CFTimeInterval`](/documentation/CoreGraphics/CGEventSource/localEventsSuppressionInterval)

Returns the interval that local hardware events may be suppressed following the posting of a Quartz event.

[`var pixelHeight: Int`](/documentation/CoreGraphics/CGDisplayMode/pixelHeight)

[`class var typeID: CFTypeID`](/documentation/CoreGraphics/CGColorConversionInfo/typeID)

Returns the Core Foundation type identifier for a color conversion info data type.

[`func y0(CGFloat) -> CGFloat`](/documentation/CoreGraphics/y0(_:))

[`func y1(CGFloat) -> CGFloat`](/documentation/CoreGraphics/y1(_:))

[`func yn(Int, CGFloat) -> CGFloat`](/documentation/CoreGraphics/yn(_:_:))

[`func CGAffineTransformMake(CGFloat, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat) -> CGAffineTransform`](/documentation/CoreGraphics/CGAffineTransformMake(_:_:_:_:_:_:))

Returns an affine transformation matrix constructed from values you provide.

[`extern CGColorConversionInfoRefCGColorConversionInfoCreateFromListWithArguments(CFDictionaryRef options, CGColorSpaceRef , CGColorConversionInfoTransformType , CGColorRenderingIntent , va_list );`](/documentation/CoreGraphics/CGColorConversionInfoCreateFromListWithArguments)

[`func CGColorSpaceCopyBaseColorSpace(CGColorSpace) -> CGColorSpace`](/documentation/CoreGraphics/CGColorSpaceCopyBaseColorSpace(_:))

[`func CGColorSpaceCreateCopyWithStandardRange(CGColorSpace) -> CGColorSpace`](/documentation/CoreGraphics/CGColorSpaceCreateCopyWithStandardRange(_:))

[`func CGColorSpaceCreateExtended(CGColorSpace) -> CGColorSpace?`](/documentation/CoreGraphics/CGColorSpaceCreateExtended(_:))

[`func CGColorSpaceCreateExtendedLinearized(CGColorSpace) -> CGColorSpace?`](/documentation/CoreGraphics/CGColorSpaceCreateExtendedLinearized(_:))

[`func CGColorSpaceCreateWithColorSyncProfile(ColorSyncProfile?, CFDictionary?) -> CGColorSpace?`](/documentation/CoreGraphics/CGColorSpaceCreateWithColorSyncProfile(_:_:))

[`extern CFStringRefCGColorSpaceGetName(CGColorSpaceRef space);`](/documentation/CoreGraphics/CGColorSpaceGetName)

[`func CGColorSpaceIsHLGBased(CGColorSpace) -> Bool`](/documentation/CoreGraphics/CGColorSpaceIsHLGBased(_:))

[`func CGColorSpaceIsPQBased(CGColorSpace) -> Bool`](/documentation/CoreGraphics/CGColorSpaceIsPQBased(_:))

[`func CGColorSpaceUsesITUR_2100TF(CGColorSpace) -> Bool`](/documentation/CoreGraphics/CGColorSpaceUsesITUR_2100TF(_:))

[`func CGContextDrawConicGradient(CGContext, CGGradient?, CGPoint, CGFloat)`](/documentation/CoreGraphics/CGContextDrawConicGradient(_:_:_:_:))

[`extern bool CGContextDrawImageApplyingToneMapping(CGContextRef c, CGRect r, CGImageRef image, CGToneMapping method, CFDictionaryRef options);`](/documentation/CoreGraphics/CGContextDrawImageApplyingToneMapping)

[`func CGContextGetEDRTargetHeadroom(CGContext) -> Float`](/documentation/CoreGraphics/CGContextGetEDRTargetHeadroom(_:))

[`func CGConvertColorDataWithFormat(Int, Int, UnsafeMutableRawPointer!, CGColorDataFormat, UnsafeMutableRawPointer!, CGColorDataFormat, CFDictionary!) -> Bool`](/documentation/CoreGraphics/CGConvertColorDataWithFormat(_:_:_:_:_:_:_:))

[`func CGEnableEventStateCombining(boolean_t) -> CGError`](/documentation/CoreGraphics/CGEnableEventStateCombining(_:))

Enables or disables the merging of actual key and mouse state with the application-specified state in a synthetic event.

[`func CGErrorSetCallback(CGErrorCallback!)`](/documentation/CoreGraphics/CGErrorSetCallback(_:))

[`func CGImageCreateCopyWithContentHeadroom(Float, CGImage) -> CGImage?`](/documentation/CoreGraphics/CGImageCreateCopyWithContentHeadroom(_:_:))

[`func CGInhibitLocalEvents(boolean_t) -> CGError`](/documentation/CoreGraphics/CGInhibitLocalEvents(_:))

Turns off local hardware events in the current session.

[`func CGPDFArrayApplyBlock(CGPDFArrayRef, (Int, CGPDFObjectRef, UnsafeMutableRawPointer?) -> Bool, UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGPDFArrayApplyBlock(_:_:_:))

[`func CGPDFContextBeginTag(CGContext, CGPDFTagType, CFDictionary)`](/documentation/CoreGraphics/CGPDFContextBeginTag(_:_:_:))

[`func CGPDFContextEndTag(CGContext)`](/documentation/CoreGraphics/CGPDFContextEndTag(_:))

[`func CGPDFContextSetIDTree(CGContext, CGPDFDictionaryRef)`](/documentation/CoreGraphics/CGPDFContextSetIDTree(_:_:))

[`func CGPDFContextSetOutline(CGContext, CFDictionary?)`](/documentation/CoreGraphics/CGPDFContextSetOutline(_:_:))

[`func CGPDFContextSetPageTagStructureTree(CGContext, CFDictionary)`](/documentation/CoreGraphics/CGPDFContextSetPageTagStructureTree(_:_:))

[`func CGPDFContextSetParentTree(CGContext, CGPDFDictionaryRef)`](/documentation/CoreGraphics/CGPDFContextSetParentTree(_:_:))

[`func CGPDFDictionaryApplyBlock(CGPDFDictionaryRef, (UnsafePointer<CChar>, CGPDFObjectRef, UnsafeMutableRawPointer?) -> Bool, UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGPDFDictionaryApplyBlock(_:_:_:))

[`func CGPDFScannerStop(CGPDFScannerRef)`](/documentation/CoreGraphics/CGPDFScannerStop(_:))

[`func CGPointMake(CGFloat, CGFloat) -> CGPoint`](/documentation/CoreGraphics/CGPointMake(_:_:))

Returns a point with the specified coordinates.

[`func CGPointMakeWithDictionaryRepresentation(CFDictionary, UnsafeMutablePointer<CGPoint>) -> Bool`](/documentation/CoreGraphics/CGPointMakeWithDictionaryRepresentation(_:_:))

Fills in a point using the contents of the specified dictionary.

[`func CGPostKeyboardEvent(CGCharCode, CGKeyCode, boolean_t) -> CGError`](/documentation/CoreGraphics/CGPostKeyboardEvent(_:_:_:))

Synthesizes a low-level keyboard event on the local machine.

[`extern CGPathRefCGPathCreateCopyByFlattening(CGPathRef path, CGFloat flatteningThreshold);`](/documentation/CoreGraphics/CGPathCreateCopyByFlattening)

[`extern CGPathRefCGPathCreateCopyByIntersectingPath(CGPathRef path, CGPathRef maskPath, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyByIntersectingPath)

[`extern CGPathRefCGPathCreateCopyByNormalizing(CGPathRef path, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyByNormalizing)

[`extern CGPathRefCGPathCreateCopyBySubtractingPath(CGPathRef path, CGPathRef maskPath, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyBySubtractingPath)

[`extern CGPathRefCGPathCreateCopyBySymmetricDifferenceOfPath(CGPathRef path, CGPathRef maskPath, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyBySymmetricDifferenceOfPath)

[`extern CGPathRefCGPathCreateCopyByUnioningPath(CGPathRef path, CGPathRef maskPath, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyByUnioningPath)

[`extern CGPathRefCGPathCreateCopyOfLineByIntersectingPath(CGPathRef path, CGPathRef maskPath, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyOfLineByIntersectingPath)

[`extern CGPathRefCGPathCreateCopyOfLineBySubtractingPath(CGPathRef path, CGPathRef maskPath, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateCopyOfLineBySubtractingPath)

[`extern CFArrayRefCGPathCreateSeparateComponents(CGPathRef path, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathCreateSeparateComponents)

[`extern bool CGPathIntersectsPath(CGPathRef path1, CGPathRef path2, bool evenOddFillRule);`](/documentation/CoreGraphics/CGPathIntersectsPath)

[`func CGPreflightListenEventAccess() -> Bool`](/documentation/CoreGraphics/CGPreflightListenEventAccess())

[`func CGPreflightPostEventAccess() -> Bool`](/documentation/CoreGraphics/CGPreflightPostEventAccess())

[`func CGPreflightScreenCaptureAccess() -> Bool`](/documentation/CoreGraphics/CGPreflightScreenCaptureAccess())

[`func CGRectMake(CGFloat, CGFloat, CGFloat, CGFloat) -> CGRect`](/documentation/CoreGraphics/CGRectMake(_:_:_:_:))

Returns a rectangle with the specified coordinate and size values.

[`func CGRectMakeWithDictionaryRepresentation(CFDictionary, UnsafeMutablePointer<CGRect>) -> Bool`](/documentation/CoreGraphics/CGRectMakeWithDictionaryRepresentation(_:_:))

Fills in a rectangle using the contents of the specified dictionary.

[`func CGRegisterScreenRefreshCallback(CGScreenRefreshCallback, UnsafeMutableRawPointer?) -> CGError`](/documentation/CoreGraphics/CGRegisterScreenRefreshCallback(_:_:))

Registers a callback function to be invoked when local displays are refreshed or modified.

[`func CGReleaseScreenRefreshRects(UnsafeMutablePointer<CGRect>?)`](/documentation/CoreGraphics/CGReleaseScreenRefreshRects(_:))

Deallocates a list of rectangles that represent changed areas on local displays.

[`func CGRequestListenEventAccess() -> Bool`](/documentation/CoreGraphics/CGRequestListenEventAccess())

[`func CGRequestPostEventAccess() -> Bool`](/documentation/CoreGraphics/CGRequestPostEventAccess())

[`func CGRequestScreenCaptureAccess() -> Bool`](/documentation/CoreGraphics/CGRequestScreenCaptureAccess())

[`func CGScreenRegisterMoveCallback(CGScreenUpdateMoveCallback, UnsafeMutableRawPointer?) -> CGError`](/documentation/CoreGraphics/CGScreenRegisterMoveCallback(_:_:))

Registers a callback function to be invoked when an area of the display is moved.

[`func CGScreenUnregisterMoveCallback(CGScreenUpdateMoveCallback, UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGScreenUnregisterMoveCallback(_:_:))

Removes a previously registered callback function invoked when an area of the display is moved.

[`func CGSetLocalEventsFilterDuringSuppressionState(CGEventFilterMask, CGEventSuppressionState) -> CGError`](/documentation/CoreGraphics/CGSetLocalEventsFilterDuringSuppressionState(_:_:))

Filters local hardware events from the keyboard and mouse during the short interval after a synthetic event is posted.

[`func CGSetLocalEventsSuppressionInterval(CFTimeInterval) -> CGError`](/documentation/CoreGraphics/CGSetLocalEventsSuppressionInterval(_:))

Sets the time interval in seconds that local hardware events are suppressed after posting a synthetic event.

[`func CGSizeMake(CGFloat, CGFloat) -> CGSize`](/documentation/CoreGraphics/CGSizeMake(_:_:))

Returns a size with the specified dimension values.

[`func CGSizeMakeWithDictionaryRepresentation(CFDictionary, UnsafeMutablePointer<CGSize>) -> Bool`](/documentation/CoreGraphics/CGSizeMakeWithDictionaryRepresentation(_:_:))

Fills in a size using the contents of the specified dictionary.

[`func CGUnregisterScreenRefreshCallback(CGScreenRefreshCallback, UnsafeMutableRawPointer?)`](/documentation/CoreGraphics/CGUnregisterScreenRefreshCallback(_:_:))

Removes a previously registered callback function invoked when local displays are refreshed or modified.

[`func CGVectorMake(CGFloat, CGFloat) -> CGVector`](/documentation/CoreGraphics/CGVectorMake(_:_:))

Returns a vector with the specified dimension values.

[`func CGWaitForScreenRefreshRects(UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, UnsafeMutablePointer<UInt32>?) -> CGError`](/documentation/CoreGraphics/CGWaitForScreenRefreshRects(_:_:))

Waits for screen refresh operations.

[`func CGWaitForScreenUpdateRects(CGScreenUpdateOperation, UnsafeMutablePointer<CGScreenUpdateOperation>?, UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, UnsafeMutablePointer<Int>?, UnsafeMutablePointer<CGScreenUpdateMoveDelta>?) -> CGError`](/documentation/CoreGraphics/CGWaitForScreenUpdateRects(_:_:_:_:_:))

Waits for screen update operations.

[`var accessPermissions: CGPDFAccessPermissions`](/documentation/CoreGraphics/CGPDFDocument/accessPermissions)

[`func applyWithBlock((UnsafePointer<CGPathElement>) -> Void)`](/documentation/CoreGraphics/CGPath/applyWithBlock(_:))

[`var byteOrderInfo: CGImageByteOrderInfo`](/documentation/CoreGraphics/CGImage/byteOrderInfo)

[`var containsImageSpecificToneMappingMetadata: Bool`](/documentation/CoreGraphics/CGImage/containsImageSpecificToneMappingMetadata)

[`var contentHeadroom: Float`](/documentation/CoreGraphics/CGImage/contentHeadroom)

[`func convert(width: Int, height: Int, to: UnsafeMutableRawPointer, format: CGColorBufferFormat, from: UnsafeRawPointer, format: CGColorBufferFormat, options: CFDictionary?) -> Bool`](/documentation/CoreGraphics/CGColorConversionInfo/convert(width:height:to:format:from:format:options:))

[`func copyPropertyList() -> CFPropertyList?`](/documentation/CoreGraphics/CGColorSpace/copyPropertyList())

Returns a copy of the color space’s properties.

[`extern CGAffineTransformComponents CGAffineTransformDecompose(CGAffineTransform transform);`](/documentation/CoreGraphics/CGAffineTransformDecompose)

[`var info: UnsafeMutableRawPointer?`](/documentation/CoreGraphics/CGDataProvider/info)

[`extern CGAffineTransform CGAffineTransformMakeWithComponents(CGAffineTransformComponents components);`](/documentation/CoreGraphics/CGAffineTransformMakeWithComponents)

[`init(genericGrayGamma2_2Gray: CGFloat, alpha: CGFloat)`](/documentation/CoreGraphics/CGColor/init(genericGrayGamma2_2Gray:alpha:))

Creates a color in the Generic gray color space with a gamma ramp of 2.2.

[`init?(headroom: Float, width: Int, height: Int, bitsPerComponent: Int, bitsPerPixel: Int, bytesPerRow: Int, space: CGColorSpace, bitmapInfo: CGBitmapInfo, provider: CGDataProvider, decode: UnsafePointer<CGFloat>?, shouldInterpolate: Bool, intent: CGColorRenderingIntent)`](/documentation/CoreGraphics/CGImage/init(headroom:width:height:bitsPerComponent:bitsPerPixel:bytesPerRow:space:bitmapInfo:provider:decode:shouldInterpolate:intent:))

[`init?(iccData: CFTypeRef)`](/documentation/CoreGraphics/CGColorSpace/init(iccData:))

Creates an ICC-based color space using the ICC profile contained in the specified data.

[`init?(optionsSrc: CGColorSpace, dst: CGColorSpace, options: CFDictionary?)`](/documentation/CoreGraphics/CGColorConversionInfo/init(optionsSrc:dst:options:))

[`init?(propertyListPlist: CFPropertyList)`](/documentation/CoreGraphics/CGColorSpace/init(propertyListPlist:))

Creates a color space from a property list.

[`init?(scrollWheelEvent2Source: CGEventSource?, units: CGScrollEventUnit, wheelCount: UInt32, wheel1: Int32, wheel2: Int32, wheel3: Int32)`](/documentation/CoreGraphics/CGEvent/init(scrollWheelEvent2Source:units:wheelCount:wheel1:wheel2:wheel3:))

[`init?(src: CGColorSpace, srcHeadroom: Float, dst: CGColorSpace, dstHeadroom: Float, toneMapping: CGToneMapping, options: CFDictionary?, UnsafeMutablePointer<Unmanaged<CFError>?>?)`](/documentation/CoreGraphics/CGColorConversionInfo/init(src:srcHeadroom:dst:dstHeadroom:toneMapping:options:_:))

[`func isHDR() -> Bool`](/documentation/CoreGraphics/CGColorSpace/isHDR())

[`var name: UnsafePointer<CChar>`](/documentation/CoreGraphics/CGPDFTagType/name)

[`var outline: CFDictionary?`](/documentation/CoreGraphics/CGPDFDocument/outline)

[`var pixelFormatInfo: CGImagePixelFormatInfo`](/documentation/CoreGraphics/CGImage/pixelFormatInfo)

[`func resetClip()`](/documentation/CoreGraphics/CGContext/resetClip())

[`func setEDRTargetHeadroom(Float) -> Bool`](/documentation/CoreGraphics/CGContext/setEDRTargetHeadroom(_:))

[`var shouldToneMap: Bool`](/documentation/CoreGraphics/CGImage/shouldToneMap)

[`func CGColorSpaceUsesExtendedRange(CGColorSpace) -> Bool`](/documentation/CoreGraphics/CGColorSpaceUsesExtendedRange(_:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)