CIVignette的哪些参数是什么意思?

7

1
因为苹果文档不足,所以点赞了。 - AlexWien
现在你已经有足够的声望来为我的回答点赞了。 - AlexWien
3个回答

1

看一下维基百科,了解摄影中的暗角是什么意思。
它是从图像中心向角落逐渐减弱的光线。

苹果没有详细说明这些参数。

显然,半径指定了暗角开始的位置。

我期望参数强度是指暗角开始后光线下降的速度。
半径可能不是以点为单位给出的,值为1.0与您的图片大小相关。


1
谢谢你再次回复,但是将半径设置为小于1似乎根本没有应用晕影效果... - user985409
默认值为rad 1,inten 0。尝试稍微提高一下rad:1.2。 - AlexWien
如果我的帖子对您有用,请投票支持,可选择接受。 - AlexWien
将rad更改为1.2并将intensity设置为1.8,似乎仍未应用任何效果。目前我将rad设置为300,将intensity设置为1.8以获得良好的结果,但我仍然不知道rad是以像素还是百分比或其他形式表示...由于投票需要15个声望,因此我无法投票。 - user985409
由于 'rad' 的默认值为 1,因此它不是像素。 使用强度 0.2 接近默认值。 - AlexWien
显示剩余2条评论

0
原来在 CIFilter 上有一个 attributes 属性,它解释了其属性和范围。
let filter = CIFilter(name: "CIVignette")!
print("\(filter.attributes)")

生成以下输出:
[
"CIAttributeFilterDisplayName": Vignette,
"CIAttributeFilterCategories": <__NSArrayI 0x6000037020c0>(
CICategoryColorEffect,
CICategoryVideo,
CICategoryInterlaced,
CICategoryStillImage,
CICategoryBuiltIn
), 
"inputRadius": {
    CIAttributeClass = NSNumber;
    CIAttributeDefault = 1;
    CIAttributeDescription = "The distance from the center of the effect.";
    CIAttributeDisplayName = Radius;
    CIAttributeMax = 2;
    CIAttributeMin = 0;
    CIAttributeSliderMax = 2;
    CIAttributeSliderMin = 0;
    CIAttributeType = CIAttributeTypeScalar;
}, 
"CIAttributeFilterName": CIVignette,
"inputImage": {
    CIAttributeClass = CIImage;
    CIAttributeDescription = "The image to use as an input image. For filters that also use a background image, this is the foreground image.";
    CIAttributeDisplayName = Image;
    CIAttributeType = CIAttributeTypeImage;
},
"inputIntensity": {
    CIAttributeClass = NSNumber;
    CIAttributeDefault = 0;
    CIAttributeDescription = "The intensity of the effect.";
    CIAttributeDisplayName = Intensity;
    CIAttributeIdentity = 0;
    CIAttributeMax = 1;
    CIAttributeMin = "-1";
    CIAttributeSliderMax = 1;
    CIAttributeSliderMin = "-1";
    CIAttributeType = CIAttributeTypeScalar;
}, 
"CIAttributeFilterAvailable_Mac": 10.9, 
"CIAttributeFilterAvailable_iOS": 5, 
"CIAttributeReferenceDocumentation": http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIVignette
]

inputRadius 是一个浮点数,范围介于 0 和 2 之间,它会影响阴影的“大小”。

inputIntensity 是一个浮点数,范围介于 -1 和 1 之间,它会影响滤镜的“深度”。


0

强度肯定是类似于1到10或更大的数字。1有一些效果,10已经相当暗了。

半径似乎是以像素(或点)为单位的。我使用图像大小的一部分(比如宽度的1/10),效果非常好!然而,如果强度很强(比如10),半径可以很小(比如1),你仍然可以看到不同之处。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接