Effect

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKEffect)
open class Effect : NSObject

The base class for effects that can be applied to a photo. It is meant to be subclassed.

  • The identifier of the effect.

    Declaration

    Swift

    public let identifier: String
  • The name that is displayed to the user.

    Declaration

    Swift

    public let displayName: String
  • Returns a new CIFilter object that implements the actual effect. Subclasses need to override this method.

    Declaration

    Swift

    open var newEffectFilter: CIFilter? { get }
  • Initializes the base class Effect. Use this initilizer in subclasses only and make sure to override newEffectFilter.

    Declaration

    Swift

    public init(identifier: String, displayName: String)

    Parameters

    identifier

    An identifier that uniquely identifies the effect.

    displayName

    The name that is displayed to the user.

    Return Value

    A newly initialized Effect object.

  • all

    Change this array to only support a subset of all available filters or to include custom filters. By default this array includes all available filters.

    Declaration

    Swift

    public static var all: [Effect] = [
     NoEffect(),
     DuoToneEffect(identifier: "imgly_duotone_desert", lightColor: UIColor(hexString: "#e1de9a"), darkColor: UIColor(hexString: "#cb2129"), displayName: "pesdk_filter_asset_duotoneDesert".localized),
     DuoToneEffect(identifier: "imgly_duotone_peach", lightColor: UIColor(hexString: "#e9abb8"), darkColor: UIColor(hexString: "#0040ff"), displayName: "pesdk_filter_asset_duotonePeach".localized),
     DuoToneEffect(identifier: "imgly_duotone_clash", lightColor: UIColor(hexString: "#f41a0f"), darkColor: UIColor(hexString: "#23007c"), displayName: "pesdk_filter_asset_duotoneClash".localized),
     DuoToneEffect(identifier: "imgly_duotone_plum", lightColor: UIColor(hexString: "#74d7ff"), darkColor: UIColor(hexString: "#23007c"), displayName: "pesdk_filter_asset_duotonePlum".localized),
     DuoToneEffect(identifier: "imgly_duotone_breezy", lightColor: UIColor(hexString: "#68fdff"), darkColor: UIColor(hexString: "#c20000"), displayName: "pesdk_filter_asset_duotoneBreezy".localized),
     DuoToneEffect(identifier: "imgly_duotone_deepblue", lightColor: UIColor(hexString: "#2de9eb"), darkColor: UIColor(hexString: "#58007c"), displayName: "pesdk_filter_asset_duotoneDeepBlue".localized),
     DuoToneEffect(identifier: "imgly_duotone_frog", lightColor: UIColor(hexString: "#5bff60"), darkColor: UIColor(hexString: "#7f23a9"), displayName: "pesdk_filter_asset_duotoneFrog".localized),
     DuoToneEffect(identifier: "imgly_duotone_sunset", lightColor: UIColor(hexString: "#f8ea46"), darkColor: UIColor(hexString: "#c400be"), displayName: "pesdk_filter_asset_duotoneSunset".localized),
     LUTEffect(identifier: "imgly_lut_ad1920", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_ad1920_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_ad1920".localized),
     LUTEffect(identifier: "imgly_lut_bw", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_bw_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_bw".localized),
     LUTEffect(identifier: "imgly_lut_x400", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_x400_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_x400".localized),
     LUTEffect(identifier: "imgly_lut_litho", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_litho_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_litho".localized),
     LUTEffect(identifier: "imgly_lut_sepiahigh", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_sepiahigh_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_sepiaHigh".localized),
     LUTEffect(identifier: "imgly_lut_plate", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_plate_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_plate".localized),
     LUTEffect(identifier: "imgly_lut_sin", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_sin_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_sin".localized),
     LUTEffect(identifier: "imgly_lut_blues", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_blues_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_blues".localized),
     LUTEffect(identifier: "imgly_lut_front", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_front_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_front".localized),
     LUTEffect(identifier: "imgly_lut_texas", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_texas_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_texas".localized),
     LUTEffect(identifier: "imgly_lut_celsius", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_celsius_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_celsius".localized),
     LUTEffect(identifier: "imgly_lut_cool", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_cool_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_cool".localized),
     LUTEffect(identifier: "imgly_lut_chest", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_chest_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_chest".localized),
     LUTEffect(identifier: "imgly_lut_winter", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_winter_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_winter".localized),
     LUTEffect(identifier: "imgly_lut_kdynamic", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_kdynamic_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_dynamic".localized),
     LUTEffect(identifier: "imgly_lut_fall", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_fall_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_fall".localized),
     LUTEffect(identifier: "imgly_lut_lenin", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_lenin_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_lenin".localized),
     LUTEffect(identifier: "imgly_lut_pola669", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_pola669_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_669".localized),
     LUTEffect(identifier: "imgly_lut_elder", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_elder_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_elder".localized),
     LUTEffect(identifier: "imgly_lut_orchid", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_orchid_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_orchid".localized),
     LUTEffect(identifier: "imgly_lut_bleached", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_bleached_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_bleached".localized),
     LUTEffect(identifier: "imgly_lut_bleachedblue", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_bleachedblue_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_bBlue".localized),
     LUTEffect(identifier: "imgly_lut_breeze", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_breeze_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_breeze".localized),
     LUTEffect(identifier: "imgly_lut_blueshadows", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_blueshadows_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_blueShade".localized),
     LUTEffect(identifier: "imgly_lut_sunset", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_sunset_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_sunset".localized),
     LUTEffect(identifier: "imgly_lut_eighties", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_eighties_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_80s".localized),
     LUTEffect(identifier: "imgly_lut_evening", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_evening_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_evening".localized),
     LUTEffect(identifier: "imgly_lut_k2", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_k2_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_k2".localized),
     LUTEffect(identifier: "imgly_lut_nogreen", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_nogreen_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_noGreen".localized),
     LUTEffect(identifier: "imgly_lut_ancient", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_ancient_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_ancient".localized),
     LUTEffect(identifier: "imgly_lut_cottoncandy", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_cottoncandy_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_candy".localized),
     LUTEffect(identifier: "imgly_lut_classic", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_classic_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_classic".localized),
     LUTEffect(identifier: "imgly_lut_colorful", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_colorful_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_colorful".localized),
     LUTEffect(identifier: "imgly_lut_creamy", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_creamy_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_creamy".localized),
     LUTEffect(identifier: "imgly_lut_fixie", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_fixie_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_fixie".localized),
     LUTEffect(identifier: "imgly_lut_food", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_food_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_food".localized),
     LUTEffect(identifier: "imgly_lut_fridge", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_fridge_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_fridge".localized),
     LUTEffect(identifier: "imgly_lut_glam", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_glam_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_glam".localized),
     LUTEffect(identifier: "imgly_lut_gobblin", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_gobblin_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_goblin".localized),
     LUTEffect(identifier: "imgly_lut_highcontrast", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_highcontrast_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_hicon".localized),
     LUTEffect(identifier: "imgly_lut_highcarb", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_highcarb_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_carb".localized),
     LUTEffect(identifier: "imgly_lut_k1", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_k1_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_k1".localized),
     LUTEffect(identifier: "imgly_lut_k6", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_k6_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_k6".localized),
     LUTEffect(identifier: "imgly_lut_keen", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_keen_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_keen".localized),
     LUTEffect(identifier: "imgly_lut_lomo", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_lomo_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_lomo".localized),
     LUTEffect(identifier: "imgly_lut_lomo100", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_lomo100_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_lomo100".localized),
     LUTEffect(identifier: "imgly_lut_lucid", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_lucid_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_lucid".localized),
     LUTEffect(identifier: "imgly_lut_mellow", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_mellow_8_8_512", withExtension: "png"), displayName: "pesdk_filter_asset_mellow".localized),
     LUTEffect(identifier: "imgly_lut_neat", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_neat_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_neat".localized),
     LUTEffect(identifier: "imgly_lut_pale", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_pale_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_pale".localized),
     LUTEffect(identifier: "imgly_lut_pitched", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_pitched_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_pitched".localized),
     LUTEffect(identifier: "imgly_lut_polasx", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_polasx_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_sx".localized),
     LUTEffect(identifier: "imgly_lut_pro400", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_pro400_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_pro400".localized),
     LUTEffect(identifier: "imgly_lut_quozi", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_quozi_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_quozi".localized),
     LUTEffect(identifier: "imgly_lut_settled", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_settled_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_settled".localized),
     LUTEffect(identifier: "imgly_lut_seventies", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_seventies_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_70s".localized),
     LUTEffect(identifier: "imgly_lut_soft", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_soft_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_soft".localized),
     LUTEffect(identifier: "imgly_lut_steel", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_steel_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_steel".localized),
     LUTEffect(identifier: "imgly_lut_summer", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_summer_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_summer".localized),
     LUTEffect(identifier: "imgly_lut_tender", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_tender_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_tender".localized),
     LUTEffect(identifier: "imgly_lut_twilight", lutURL: Bundle.imglyBundle.url(forResource: "imgly_lut_twilight_5_5_128", withExtension: "png"), displayName: "pesdk_filter_asset_twilight".localized)
    ]
  • This method returns the effect with the given identifier if such an effect exists.

    Declaration

    Swift

    public static func effect(withIdentifier identifier: String) -> Effect?

    Parameters

    identifier

    The identifier of the effect.

    Return Value

    A Effect object.