How to get the list of filter names in CIFilter class?

后端 未结 7 1855
感情败类
感情败类 2021-01-30 23:40

I am using the following code for exposure adjustment and its working. I need the filter names for sharpen, denoise, highlighs, color temperature, shadows, blur, etc.

         


        
7条回答
  •  忘了有多久
    2021-01-31 00:05

    In Swift (4.2, at the time of writing this), you can use this code to get all filter names:

    For filters in a specified category:

    CIFilter.filterNames(inCategory: "Name_of_the_category")
    

    For filters in specified categories:

    CIFilter.filterNames(inCategories: ["Name_of_the_category_1", "Name_of_the_category_2"])
    

    For filters in all categories, just pass nil either in inCategory or inCategories:

    CIFilter.filterNames(inCategory: nil)
    

    or

    CIFilter.filterNames(inCategories: nil)
    

    All the functions above returns an Array of the filter names in String values:

    [ "CIAccordionFoldTransition", "CIAdditionCompositing", "CIAffineClamp", "CIAffineTile", "CIAffineTransform", "CIAreaAverage", "CIAreaHistogram"... ]

提交回复
热议问题