【问题标题】:what parameters of CIVignette meanCIVignette的参数是什么意思
【发布时间】:2022-03-18 10:50:51
【问题描述】:

我在以下位置查看 Core Image Filter Reference 的 CIVignette http://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIColorControls

并使用参数来玩 a: 输入半径 输入强度 并且仍然没有完全理解每个参数的影响。有人能解释一下吗?

【问题讨论】:

  • 赞成,因为苹果文档不够用
  • 现在你有足够的声望来支持我的abswer

标签: core-image


【解决方案1】:

看看 wiki 了解摄影中的渐晕是什么意思。
这是从图像中心向角落的光的下降。

Apple 没有对这些参数做太多解释。

显然,半径指定了渐晕开始的位置

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

【讨论】:

  • 谢谢,但仍然没有得到它。我将半径设置为 100,强度设置为 100 并得到以下结果:dropbox.com/s/7po4enfod5f58ah/1.png 然后如果我将半径设置为 200,我得到以下结果:@987654322 @ 这似乎是一样的......
  • sw 开发者喜欢 0 到 1.0 之间的参数。所以 1 在某种程度上与你的图片大小有关。使用半径 = 0.8 强度:使用值 0,5 - 2
  • 再次感谢您,但将半径设置为 1 以下似乎根本没有应用小插图...
  • def值是rad 1,inten 0。尝试稍微提高rad:1.2
  • 如果我的帖子有用,请投票,并可选择接受。
【解决方案2】:

强度绝对是 1 到 10 或更大的数字。 1有一些效果,10已经比较暗了。

半径似乎以像素(或点)为单位。我使用了一部分图像尺寸(比如宽度的 1/10),效果还不错!但是,如果强度很大(例如 10),则半径可以很小(例如 1),您仍然可以看到不同。

【讨论】:

    【解决方案3】:

    原来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 之间的浮点数,它会影响过滤器的“暗度”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-07
      • 2020-12-16
      • 1970-01-01
      • 2016-10-17
      • 2015-03-05
      • 2014-05-31
      • 2012-09-16
      • 2017-04-13
      相关资源
      最近更新 更多