2014-08-28 34 views

回答

2

不能與加速。在CoreGraphics中,如果你喜歡,你可以設置一個遮罩顏色。

https://developer.apple.com/library/mac/documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_images/dq_images.html#//apple_ref/doc/uid/TP30001066-CH212-CJBHCADE

嚴格地說,如果設置一個CGImageRef掩蔽顏色,然後將其解碼與vImageBufer_InitWithCGImage像素,它應該做的是哪個/也許/資格。然而,在這種情況下,CG正在做遮掩工作。

您可以提交一份Radar請求。迄今爲止,它並不是一個優先事項,因爲你得到的alpha不是反鋸齒的。

typedef __attribute__ ((ext_vector_type(4),__aligned__(16))) uint32_t uint4; 

// ARGB example (on little endian processor): 
// uint4 result = maskByColor(pixels, (uint4)0, (uint4) 0x000000ff); 
uint4 maskByColor(uint4 fourPixels, uint4 maskColor, uint4 alphaMask){ 
    return fourPixels & ~(maskColor == (fourPixels & ~alphaMask)); 
}