如何改变图像某些部分的饱和度?

时间:2015-01-14 16:50:39

标签: ios image swift core-graphics

我有UIImageView图像和一些点(CGPOint值)。我可以像这样创建路径

var mutablePath = CGPathCreateMutable()
    var point1 = patternImageView.someFeature.rightPoints.objectAtIndex(1).CGPointValue()
    CGPathMoveToPoint(mutablePath, nil, point1.x, point1.y)
    point1 = patternImageView.someFeature.rightPoints.objectAtIndex(2).CGPointValue()
    CGPathAddLineToPoint(mutablePath, nil, point1.x, point1.y)
    point1 = patternImageView.someFeature.rightPoints.objectAtIndex(3).CGPointValue()
    CGPathAddLineToPoint(mutablePath, nil, point1.x, point1.y)
    point1 = patternImageView.someFeature.rightPoints.objectAtIndex(4).CGPointValue()
    CGPathAddLineToPoint(mutablePath, nil, point1.x, point1.y)
    CGPathCloseSubpath(mutablePath)
    var pathForRight:CGPathRef = mutablePath

我可以使用像这样的路径中的所有点创建矩形

var rectRight = CGPathGetBoundingBox(pathForRight)

或者我可以将数组添加为NSValue

var arrayRect = NSMutableArray()
    arrayRect.addObject(NSValue(CGRect: CGPathGetBoundingBox(pathForRight)))

是否可以更改rect“rectRight”中所有像素的饱和度或更改某些矩形图像的饱和度?

0 个答案:

没有答案