Contents

NSBestDepth

Attempts to return a window depth adequate for the specified parameters.

Declaration

extern NSWindowDepth NSBestDepth(NSColorSpaceName colorSpace, NSInteger bps, NSInteger bpp, BOOL planar, BOOL *exactMatch);

Discussion

Returns a window depth deep enough for the given number of colors in colorSpace, bits per sample specified by bps, bits per pixel specified by bpp, and whether planar as specified by planar. Upon return, the variable pointed to by exactMatch is true if the window depth can accommodate all of the values specified by the parameters, false if it can’t.

Use this function to compute window depths. This function tries to accommodate all the parameters (match or better); if there are multiple matches, it gives the closest, with matching colorSpace 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 may be used as hints to provide backing stores of different configuration; for instance, 8-bit color. The exactMatch parameter is optional and indicates whether all the parameters matched exactly.

See Also

Working with Window Depths