iOS:Photoshop中CIFilter(Hue)的值 [英] iOS: Values for CIFilter (Hue) from Photoshop
问题描述
我使用 Hue
过滤器来更改图片的色调:
I am using the Hue
filter to change the hue of an image:
CIFilter* hueFilter =
[CIFilter filterWithName:@"CIHueAdjust" <blah blah>
[NSNumber numberWithFloat:hue], nil];
我有 Hue
我想要的号码使用 Photoshop
,但它与我从iOS获得的结果不一致。
I have the Hue
number I wish to use from Photoshop
, but it doesn't correspond to the results I get from iOS.
是否有规则将 PhotoShop
中的数字更改为我应该在 iOS
中使用的数字?
Is there a rule to change the number in PhotoShop
to the number I should use in iOS
?
推荐答案
HSL / HSV颜色模式中的色调是角度坐标。
在Photoshop中,它以度(-180到+180)给出。
The Hue in HSL/HSV color mode is an angular coordinate. In Photoshop, it is given in degrees (-180 to +180).
在CIHueAdjust过滤器中,角度以弧度给出。
来自 http://developer.apple.com/library/ios/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIHueAdjust
In the CIHueAdjust filter, the angle is given in radians. From http://developer.apple.com/library/ios/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIHueAdjust
参数
inputAngle
一个 NSNumber
类,其属性类型为 CIAttributeTypeAngle
,其显示名称为Angle。
An NSNumber
class whose attribute type is CIAttributeTypeAngle
and whose display name is Angle.
默认值:0.00最小值:0.00最大值:0.00最小滑块:-3.14最大滑块:3.14标识:0.00
Default value: 0.00 Minimum: 0.00 Maximum: 0.00 Slider minimum: -3.14 Slider maximum: 3.14 Identity: 0.00
从Photoshop值(度)到CIHueAdjust值(弧度)的公式是线性转换:
The formula to go from Photoshop value (degrees) to CIHueAdjust value (radians) is a linear conversion:
filterAngle = photoshopAngle * π / 180
这篇关于iOS:Photoshop中CIFilter(Hue)的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!