Mac OS X Reference Library Apple Developer Connection spyglass button

Deprecated Quartz Display Services Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.6

CGConfigureDisplayMode

Configures the display mode of a display. (Deprecated in Mac OS X v10.6.)

CGError CGConfigureDisplayMode (
   CGDisplayConfigRef configRef,
   CGDirectDisplayID display,
   CFDictionaryRef mode
);
Parameters
configRef

A display configuration, acquired by calling CGBeginDisplayConfiguration.

display

The display being configured.

mode

A display mode dictionary (see the discussion below).

Return Value

A result code. See Core Graphics Constants Reference.

Discussion

A display mode is a set of properties such as width, height, pixel depth, and refresh rate, and options such as stretched LCD panel filling.

The display mode you provide must be one of the following:

If you use this function to change the mode of a display in a mirroring set, Quartz may adjust the bounds, resolutions, and depth of the other displays in the set to a safe mode, with matching depth and the smallest enclosing size.

Availability
Declared In
CGDisplayConfiguration.h

CGDisplayAddressForPosition

Returns the address in frame buffer memory that corresponds to a position on an online display. (Deprecated in Mac OS X v10.6.)

void * CGDisplayAddressForPosition (
   CGDirectDisplayID display,
   CGDisplayCoord x,
   CGDisplayCoord y
);
Parameters
display

The display to access.

x

The x-coordinate of a position in global display space. The origin is the upper left corner of the main display.

y

The y-coordinate of a position in global display space. The origin is the upper left corner of the main display, and the y-axis is oriented down.

Return Value

The address in frame buffer memory that corresponds to the specified position. If the display ID is invalid or the point lies outside the bounds of the display, the return value is NULL.

Discussion

If the display has not been captured, the returned address may refer to read-only memory.

Availability
Declared In
CGDirectDisplay.h

CGDisplayAvailableModes

Returns information about the currently available display modes. (Deprecated in Mac OS X v10.6.)

CFArrayRef CGDisplayAvailableModes (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

An array of dictionaries with display mode information, or NULL if the display is invalid. The array is owned by the system and you should not release it. Each dictionary in the array contains information about a mode that the display supports. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.

Availability
Related Sample Code
Declared In
CGDirectDisplay.h

CGDisplayBaseAddress

Returns the base address in frame buffer memory of an online display. (Deprecated in Mac OS X v10.6.)

void * CGDisplayBaseAddress (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

The base address in frame buffer memory of the specified display. If the display ID is invalid, the return value is NULL.

Discussion

If the display has not been captured, the returned address may refer to read-only memory.

Availability
Declared In
CGDirectDisplay.h

CGDisplayBestModeForParameters

Returns information about the display mode closest to a specified depth and screen size. (Deprecated in Mac OS X v10.6.)

CFDictionaryRef CGDisplayBestModeForParameters (
   CGDirectDisplayID display,
   size_t bitsPerPixel,
   size_t width,
   size_t height,
   boolean_t *exactMatch
);
Parameters
display

The display to optimize.

bitsPerPixel

Optimal display depth in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.

width

Optimal display width in pixel units.

height

Optimal display height in pixel units.

exactMatch

A pointer to a Boolean variable. On return, its value is true if an exact match in display depth, width, and height is found; otherwise, false. If this information is not needed, pass NULL.

Return Value

A display mode dictionary, or NULL if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode closest to the specified depth and screen size. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.

Discussion

This function tries to find an optimal display mode for the specified display. The function first tries to find a mode with the specified pixel depth and dimensions equal to or greater than the specified width and height. If no depth match is found, it tries to find a mode with greater depth and the same or greater dimensions. If a suitable display mode is not found, this function simply returns the current display mode.

Availability
Declared In
CGDirectDisplay.h

CGDisplayBestModeForParametersAndRefreshRate

Returns information about the display mode closest to a specified depth, screen size, and refresh rate. (Deprecated in Mac OS X v10.6.)

CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRate (
   CGDirectDisplayID display,
   size_t bitsPerPixel,
   size_t width,
   size_t height,
   CGRefreshRate refresh,
   boolean_t *exactMatch
);
Parameters
display

The display to access.

bitsPerPixel

Optimal display depth, in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.

width

Optimal display width, in pixel units.

height

Optimal display height, in pixel units.

refresh

Optimal display refresh rate, in frames per second.

exactMatch

A pointer to a Boolean variable. On return, its value is true if an exact match in display depth, width, height, and refresh rate is found; otherwise, false. If this information is not needed, pass NULL.

Return Value

A display mode dictionary, or NULL if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode closest to the specified depth, screen size, and refresh rate. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.

Discussion

This function searches the list of available display modes for a mode that comes closest to satisfying these criteria:

If a suitable display mode is not found, this function simply returns the current display mode.

Availability
Related Sample Code
Declared In
CGDirectDisplay.h

CGDisplayBestModeForParametersAndRefreshRateWithProperty

Returns information about the display mode closest to a specified depth, screen size, and refresh rate, with a required property. (Deprecated in Mac OS X v10.6.)

CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRateWithProperty (
   CGDirectDisplayID display,
   size_t bitsPerPixel,
   size_t width,
   size_t height,
   CGRefreshRate refresh,
   CFStringRef property,
   boolean_t *exactMatch
);
Parameters
display

The display to access.

bitsPerPixel

Optimal display depth, in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.

width

Optimal display width, in pixels.

height

Optimal display height, in pixels.

refresh

Optimal display refresh rate, in refreshes per second.

property

A required display mode property. For a list of the properties you can specify, see “Display Mode Optional Properties.”

exactMatch

A pointer to a Boolean variable. On return, its value is true if an exact match in display depth, width, height, refresh rate, and property is found; otherwise, false. If this information is not needed, pass NULL.

Return Value

A display mode dictionary, or NULL if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode with the specified property that comes closest to the specified depth, screen size, and refresh rate. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.

Discussion

This function searches the list of available display modes for a mode that includes the specified property and comes closest to satisfying these criteria:

If no matching display mode is found, this function simply returns the current display mode.

Availability
Declared In
CGDirectDisplay.h

CGDisplayBitsPerPixel

Returns the number of bits used to represent a pixel in the frame buffer. (Deprecated in Mac OS X v10.6.)

size_t CGDisplayBitsPerPixel (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

The number of bits used to represent a pixel in the frame buffer.

Availability
Declared In
CGDirectDisplay.h

CGDisplayBitsPerSample

Returns the number of bits used to represent a pixel component in the frame buffer. (Deprecated in Mac OS X v10.6.)

size_t CGDisplayBitsPerSample (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

The number of bits used to represent a pixel component such as a color value in the frame buffer.

Availability
Declared In
CGDirectDisplay.h

CGDisplayBytesPerRow

Returns the number of bytes per row in a display. (Deprecated in Mac OS X v10.6.)

size_t CGDisplayBytesPerRow (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

The number of bytes per row in the display. This number also represents the stride between pixels in the same column of the display.

Availability
Declared In
CGDirectDisplay.h

CGDisplayCurrentMode

Returns information about the current display mode. (Deprecated in Mac OS X v10.6.)

CFDictionaryRef CGDisplayCurrentMode (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

A display mode dictionary, or NULL if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the current display mode. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.

Availability
Related Sample Code
Declared In
CGDirectDisplay.h

CGDisplaySamplesPerPixel

Returns the number of color components used to represent a pixel. (Deprecated in Mac OS X v10.6.)

size_t CGDisplaySamplesPerPixel (
   CGDirectDisplayID display
);
Parameters
display

The display to access.

Return Value

The number of color components used to represent a pixel.

Availability
Declared In
CGDirectDisplay.h

CGDisplaySwitchToMode

Switches a display to a different mode. (Deprecated in Mac OS X v10.6.)

CGDisplayErr CGDisplaySwitchToMode (
   CGDirectDisplayID display,
   CFDictionaryRef mode
);
Parameters
display

The display to access.

mode

A display mode dictionary that contains information about the display mode to set. The dictionary passed in must be a dictionary returned by another Quartz display function such as CGDisplayAvailableModes or CGDisplayBestModeForParameters. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.

Return Value

A result code. See Core Graphics Constants Reference.

Discussion

This function switches the display mode of the specified display. The operation is always synchronous; the function does not return until the mode switch is complete. Note that after switching, display parameters and addresses may change.

The selected display mode persists for the life of the calling program. When the program terminates, the display mode automatically reverts to the permanent setting in the Displays panel of System Preferences.

When changing the display mode of a display in a mirroring set, other displays in the mirroring set will be assigned a mode that's capable of mirroring the bounds of the display being adjusted. To avoid this automatic behavior, you can use the following procedure: call CGBeginDisplayConfiguration, call CGConfigureDisplayMode for each display to explicitly set the mode, and finally call CGCompleteDisplayConfiguration.

Availability
Related Sample Code
Declared In
CGDirectDisplay.h


Last updated: 2009-05-14

Did this document help you? Yes It's good, but... Not helpful...