[英]iOS: Values for CIFilter (Hue) from Photoshop
I am using the Hue
filter to change the hue of an image: 我正在使用Hue
过滤器来更改图像的色调:
CIFilter* hueFilter =
[CIFilter filterWithName:@"CIHueAdjust" <blah blah>
[NSNumber numberWithFloat:hue], nil];
I have the Hue
number I wish to use from Photoshop
, but it doesn't correspond to the results I get from iOS. 我有我想在Photoshop
使用的Hue
编号,但它与我从iOS获得的结果不符。
Is there a rule to change the number in PhotoShop
to the number I should use in iOS
? 是否有规则将PhotoShop
中的数字更改为我应该在iOS
使用的数字?
The Hue in HSL/HSV color mode is an angular coordinate. HSL / HSV颜色模式中的色调是角坐标。 In Photoshop, it is given in degrees (-180 to +180). 在Photoshop中,它以度(-180到+180)给出。
In the CIHueAdjust filter, the angle is given in radians. 在CIHueAdjust过滤器中,角度以弧度为单位。 From http://developer.apple.com/library/ios/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIHueAdjust 来自http://developer.apple.com/library/ios/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIHueAdjust
Parameters 参数
inputAngle inputAngle
An
NSNumber
class whose attribute type isCIAttributeTypeAngle
and whose display name is Angle. 一个NSNumber
类,其属性类型为CIAttributeTypeAngle
,其显示名称为Angle。Default value: 0.00 Minimum: 0.00 Maximum: 0.00 Slider minimum: -3.14 Slider maximum: 3.14 Identity: 0.00 默认值:0.00最小值:0.00最大值:0.00最小滑块:-3.14最大滑块:3.14标识:0.00
The formula to go from Photoshop value (degrees) to CIHueAdjust value (radians) is a linear conversion: 从Photoshop值(度)到CIHueAdjust值(弧度)的公式是线性转换:
filterAngle = photoshopAngle * π / 180
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.