Core Graphics Functions

No overview available.

Topics

Functions

func CGAssociateMouseAndMouseCursorPosition(boolean_t) -> CGError

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

func CGCancelDisplayConfiguration(CGDisplayConfigRef?) -> CGError

Cancels a set of display configuration changes.

func CGCaptureAllDisplays() -> CGError

Captures all attached displays.

func CGCaptureAllDisplaysWithOptions(CGCaptureOptions) -> CGError

Captures all attached displays, using the specified options.

func CGConfigureDisplayFadeEffect(CGDisplayConfigRef?, CGDisplayFadeInterval, CGDisplayFadeInterval, Float, Float, Float) -> CGError

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

func CGConfigureDisplayOrigin(CGDisplayConfigRef?, CGDirectDisplayID, Int32, Int32) -> CGError

Configures the origin of a display in the global display coordinate space.

func CGConfigureDisplayStereoOperation(CGDisplayConfigRef?, CGDirectDisplayID, boolean_t, boolean_t) -> CGError

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

func CGDisplayBounds(CGDirectDisplayID) -> CGRect

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

func CGDisplayCapture(CGDirectDisplayID) -> CGError

Captures a display for exclusive use by an application.

func CGDisplayCaptureWithOptions(CGDirectDisplayID, CGCaptureOptions) -> CGError

Captures a display for exclusive use by an application, using the specified options.

func CGDisplayCopyAllDisplayModes(CGDirectDisplayID, CFDictionary?) -> CFArray?

Returns information about the currently available display modes.

func CGDisplayCopyDisplayMode(CGDirectDisplayID) -> CGDisplayMode?

Returns information about a display’s current configuration.

func CGDisplayCreateImage(CGDirectDisplayID) -> CGImage?

Returns an image containing the contents of the specified display.

func CGDisplayCreateImage(CGDirectDisplayID, rect: CGRect) -> CGImage?

Returns an image containing the contents of a portion of the specified display.

func CGDisplayGammaTableCapacity(CGDirectDisplayID) -> UInt32

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

func CGDisplayGetDrawingContext(CGDirectDisplayID) -> CGContext?

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

func CGDisplayHideCursor(CGDirectDisplayID) -> CGError

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

func CGDisplayIsActive(CGDirectDisplayID) -> boolean_t

Returns a Boolean value indicating whether a display is active.

func CGDisplayIsAlwaysInMirrorSet(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsAsleep(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsBuiltin(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsInHWMirrorSet(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsInMirrorSet(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsMain(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsOnline(CGDirectDisplayID) -> boolean_t

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

func CGDisplayIsStereo(CGDirectDisplayID) -> boolean_t

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

func CGDisplayMirrorsDisplay(CGDirectDisplayID) -> CGDirectDisplayID

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

func CGDisplayModelNumber(CGDirectDisplayID) -> UInt32

Returns the model number of a display monitor.

func CGDisplayMoveCursorToPoint(CGDirectDisplayID, CGPoint) -> CGError

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

func CGDisplayPixelsHigh(CGDirectDisplayID) -> Int

Returns the display height in pixel units.

func CGDisplayPixelsWide(CGDirectDisplayID) -> Int

Returns the display width in pixel units.

func CGDisplayPrimaryDisplay(CGDirectDisplayID) -> CGDirectDisplayID

Returns the primary display in a hardware mirroring set.

func CGDisplayRegisterReconfigurationCallback(CGDisplayReconfigurationCallBack?, UnsafeMutableRawPointer?) -> CGError

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

func CGDisplayRemoveReconfigurationCallback(CGDisplayReconfigurationCallBack?, UnsafeMutableRawPointer?) -> CGError

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

func CGDisplayRestoreColorSyncSettings()

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

func CGDisplayRotation(CGDirectDisplayID) -> Double

Returns the rotation angle of a display in degrees.

func CGDisplayScreenSize(CGDirectDisplayID) -> CGSize

Returns the width and height of a display in millimeters.

func CGDisplaySerialNumber(CGDirectDisplayID) -> UInt32

Returns the serial number of a display monitor.

func CGDisplayShowCursor(CGDirectDisplayID) -> CGError

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

func CGDisplayUnitNumber(CGDirectDisplayID) -> UInt32

Returns the logical unit number of a display.

func CGDisplayUsesOpenGLAcceleration(CGDirectDisplayID) -> boolean_t

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

func CGDisplayVendorNumber(CGDirectDisplayID) -> UInt32

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

func CGGetLastMouseDelta() -> (x: Int32, y: Int32)

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

func CGMainDisplayID() -> CGDirectDisplayID

Returns the display ID of the main display.

func CGReleaseAllDisplays() -> CGError

Releases all captured displays.

func CGReleaseDisplayFadeReservation(CGDisplayFadeReservationToken) -> CGError

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

func CGRestorePermanentDisplayConfiguration()

Restores the permanent display configuration settings for the current user.

func CGSessionCopyCurrentDictionary() -> CFDictionary?

Returns information about the caller’s window server session.

func CGShieldingWindowID(CGDirectDisplayID) -> CGWindowID

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

func CGShieldingWindowLevel() -> CGWindowLevel

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

func CGWarpMouseCursorPosition(CGPoint) -> CGError

Moves the mouse cursor without generating events.

func CGWindowLevelForKey(CGWindowLevelKey) -> CGWindowLevel

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

func CGWindowListCopyWindowInfo(CGWindowListOption, CGWindowID) -> CFArray?

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

func CGWindowListCreateDescriptionFromArray(CFArray?) -> CFArray?

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

func CGWindowListCreateImage(CGRect, CGWindowListOption, CGWindowID, CGWindowImageOption) -> CGImage?

Returns a composite image based on a dynamically generated list of windows.

init?(src: CGColorSpace, dst: CGColorSpace)

Creates a conversion between two specified color spaces.

class var typeID: CFTypeID

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

func CGEnableEventStateCombining(boolean_t) -> CGError

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

Deprecated
func CGInhibitLocalEvents(boolean_t) -> CGError

Turns off local hardware events in the current session.

Deprecated
func CGPostKeyboardEvent(CGCharCode, CGKeyCode, boolean_t) -> CGError

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

Deprecated
func CGRegisterScreenRefreshCallback(CGScreenRefreshCallback, UnsafeMutableRawPointer?) -> CGError

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

Deprecated
func CGReleaseScreenRefreshRects(UnsafeMutablePointer<CGRect>?)

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

Deprecated
func CGScreenRegisterMoveCallback(CGScreenUpdateMoveCallback, UnsafeMutableRawPointer?) -> CGError

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

Deprecated
func CGScreenUnregisterMoveCallback(CGScreenUpdateMoveCallback, UnsafeMutableRawPointer?)

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

Deprecated
func CGSetLocalEventsFilterDuringSuppressionState(CGEventFilterMask, CGEventSuppressionState) -> CGError

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

Deprecated
func CGSetLocalEventsSuppressionInterval(CFTimeInterval) -> CGError

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

Deprecated
func CGUnregisterScreenRefreshCallback(CGScreenRefreshCallback, UnsafeMutableRawPointer?)

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

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software