エラーで、
"_vproc_transaction_end", referenced from:
"_vproc_transaction_begin", referenced from:
とか出た場合は、コンパイラを「LLVM GCC 4.2」に変更するとOKだったりします。
コンパイラの変更は、
「プロジェクトを選択(クリック)」→「ファイル」→「情報を見る」→「C/C++ コンパイラのバージョン」
で、『GCC 4.2→LLVM GCC4.2』に変更する。

日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
NSString *path = @"test.png";
//load image data
NSData *dat = [NSData dataWithContentsOfFile:path];
//create bitmap data
NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:dat];
//get image info usage CGImageRef
CGImageRef imageRef = [bitmap CGImage];
UInt8 *buf = (UInt8*)CFDataGetBytePtr(CGDataProviderCopyData(CGImageGetDataProvider(imageRef)));
UInt8 bytePerPixel = CGImageGetBitsPerPixel(imageRef)/8;
//display debug info
NSLog(@"plane size:%d",[bitmap bytesPerPlane]);
NSLog(@"width:%d",CGImageGetWidth(imageRef));
NSLog(@"height:%d",CGImageGetHeight(imageRef));
NSLog(@"bytePerPixel:%d",bytePerPixel);
//display plane binary
for(int i=0;i<CGImageGetWidth(imageRef)*CGImageGetHeight(imageRef);i++)
{
for(int j=0;j<bytePerPixel;j++)
{
NSLog(@"%u",buf[i*bytePerPixel+j]);
}
}
この広告は180日以上新しい記事の投稿がないブログに表示されております。