아이폰에서 코어 이미지를 사용하려고합니다. Quartz를 사용하여 내 색상을 합성하여 UI를 그릴 수 있지만 각 구성 요소를 CALayer
(UIview는 더 많은 리소스를 사용함)으로 구분하고 싶습니다.합성 색상 : iPhone의 CALayer 및 혼합 모드
그래서 배경 비트 맵을 필터링하는 데 사용하려는 흰색 마스크가 있고 다른 혼합 모드를 시도하고 싶습니다. 안타깝게도 레이어는 색상을 "추가"합니다. 여기
내 코드입니다 :@implementation WhiteLayerHelper
- (void)drawLayer:(CALayer *)theLayer
inContext:(CGContextRef)myContext
{
// draw a white overlay, with special blending and alpha values, so that the saturation can be animated
CGContextSetBlendMode(myContext,kCGBlendModeSaturation);
CGContextSetRGBFillColor(myContext,1.0,1.0,1.0,0.9);
CGContextFillRect(myContext,[UIScreen mainScreen].bounds);
}
@end
그리고 여기 내의 CALayer 사용하는 경우 기본보기 drawrect
코드입니다 : 뭔가 잘못
- (void)drawRect:(CGRect)rect {
//get the drawing context
CGContextRef myContext = UIGraphicsGetCurrentContext();
// draw the background
[self fillContext:myContext withBounds:m_overlayRect withImage:m_currentImage];
[whiteLayer renderInContext:myContext];
}
거기를?
CoreImage가 iOS에서 현재 제공되지 않습니까? – openfrog
@openfrog 예. OS X와 비교하여 제한적입니다. 예를 들어 OS X에서 제한됩니다. CALayers는 합성 필트를 가질 수 있습니다. rs. iOS에서는 그리 많지 않습니다. –