macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

NSAvailableWindowDepths

利用できるウインドウの色深度を返します
const  NSWindowDepth ( 
        NSAvailableWindowDepths   void );

解説

利用できるウインドウの色深度を返します。
関数
NSBitsPerPixelFromDepth()
NSBitsPerSampleFromDepth()
NSColorSpaceFromDepth()
NSPlanarFromDepth()
でそれぞれのプロパティを得ることができます。

返り値

引数

( NSAvailableWindowDepths )void

フレームワーク

ApplicationKit

クラス

NSAvailableWindowDepths

Function

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
const NSWindowDepth *dpt = NSAvailableWindowDepths();

NSLog([NSString stringWithFormat:@"bpp = %d",NSBitsPerPixelFromDepth((int)dpt)]);
NSLog([NSString stringWithFormat:@"bps = %d",NSBitsPerSampleFromDepth((int)dpt)]);
NSLog([NSString stringWithFormat:@"colorspace = %@",NSColorSpaceFromDepth((int)dpt)]);
if (NSPlanarFromDepth((int)dpt))
{
    NSLog(@"YES");
}else{
    NSLog(@"NO");
}
}

@end