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.


typedef enum NSWindowDepth : int32_t {
} NSWindowDepth;


Use the functions NSColorSpaceFromDepth, NSBitsPerPixelFromDepth, and NSPlanarFromDepth 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 * NSNumberOfColorComponents); 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.




One hundred and twenty eight bit RGB depth limit.


Sixty four bit RGB depth limit.


Twenty four bit RGB depth limit.