This type represents the depth, or amount of memory, devoted to a single pixel in a window or screen. A depth of 0 indicates default depth. Window depths should not be made persistent as they will not be the same across systems.


enum Depth : Int32


Use the functions colorSpaceName, bitsPerPixel, and isPlanar to extract info from an NSWindowDepth value. Use NSBestDepth(_:_:_:_:_:) to compute window depths. NSBestDepth(_:_:_:_:_:) tries to accommodate all the parameters (match or better); if there are multiple matches, it gives the closest, with matching color space first, then bps, then planar, then bpp. bpp is “bits per pixel”; 0 indicates default (same as the number of bits per plane, either bps or bps * numberOfColorComponents); other values maybe used as hints to provide backing stores of different configuration: for instance, 8-bit color.

You can also use one of the explicit bit depths defined in Explicit Window Depth Limits for the NSWindow property depthLimit.



case onehundredtwentyeightBitRGB

One hundred and twenty eight bit RGB depth limit.

case sixtyfourBitRGB

Sixty four bit RGB depth limit.

case twentyfourBitRGB

Twenty four bit RGB depth limit.

Instance Properties

var bitsPerPixel: Int

Returns the bits per pixel for the specified window depth.

var bitsPerSample: Int

Returns the bits per sample for the specified window depth.

var colorSpaceName: NSColorSpaceName?

Returns the name of the color space corresponding to the passed window depth.

var isPlanar: Bool

Returns whether the specified window depth is planar.