macOS/iOS API解説

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

目次

NSBitsPerSampleFromDepth

ピクセル当たりのサンプル数を返します
int  NSBitsPerSampleFromDepth ( 
      NSWindowDepth   depth );

解説

ピクセル当たりのサンプル数を返します。

返り値

引数

( NSWindowDepth )depth

フレームワーク

ApplicationKit

クラス

NSBitsPerSampleFromDepth

Function

使用可能

10.0

参照


defaultDepthLimit - Cocoa API解説(iOS/OS X)

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
int *dpt = NSAvailableWindowDepths();
NSLog([NSString stringWithFormat:@"depth = %d",dpt]);
NSLog([NSString stringWithFormat:@"bpp = %d",NSBitsPerPixelFromDepth(dpt)]);
NSLog([NSString stringWithFormat:@"bps = %d",NSBitsPerSampleFromDepth(dpt)]);
NSLog([NSString stringWithFormat:@"colorspace = %d",NSColorSpaceFromDepth(dpt)]);
NSLog([NSString stringWithFormat:@"planar = %d",NSPlanarFromDepth(dpt)]);

}

@end