iOS: Values for CIFilter (Hue) from Photoshop

后端 未结 1 507
灰色年华
灰色年华 2020-12-16 07:25

I am using the Hue filter to change the hue of an image:

CIFilter* hueFilter = 
     [CIFilter filterWithName:@\"CIHueAdjust\"          


        
相关标签:
1条回答
  • 2020-12-16 08:25

    The Hue in HSL/HSV color mode is an angular coordinate. In Photoshop, it is given in degrees (-180 to +180).

    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

    Parameters

    inputAngle

    An NSNumber class whose attribute type is CIAttributeTypeAngle and whose display name is Angle.

    Default value: 0.00 Minimum: 0.00 Maximum: 0.00 Slider minimum: -3.14 Slider maximum: 3.14 Identity: 0.00

    The formula to go from Photoshop value (degrees) to CIHueAdjust value (radians) is a linear conversion:

    filterAngle = photoshopAngle * π / 180
    
    0 讨论(0)
提交回复
热议问题