Class CIFilterGenerator

  • All Implemented Interfaces:
    CIFilterConstructor, NSCoding, NSCopying, NSSecureCoding, NSObject

    public class CIFilterGenerator
    extends NSObject
    implements NSSecureCoding, NSCopying, CIFilterConstructor
    The goal is to CIFilters to be connected and form a single CIFilter for ease of reusability. The CIFilterGenerator allows developers to create complex effects built out of one or more CIFilter and reuse them without changing code. The resulting CIFilterGenerator can be written into a file for which we introduce a new file type (extension). A CIFilterGenerator can be created from the API or more conveniently through an editor view that we provide. CIFilterGenerator files can be put into the Image Units folders on the system and they will be loaded when the user invokes one of the loadPlugIns methods. They will be registered by their filename or if present by an attribute in its description.
    • Constructor Detail

      • CIFilterGenerator

        protected CIFilterGenerator​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static CIFilterGenerator allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classAttributes

        @NotNull
        public @NotNull NSDictionary<?,​?> classAttributes()
        Retrieve or Set the class attributes that will be used to register the filter using the registerFilterName method. Make sure you set the class attributes before using the registerFilterName method. See CIFilter for a description of the classAttributes that are needed to register a filter.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • connectObjectWithKeyToObjectWithKey

        public void connectObjectWithKeyToObjectWithKey​(@NotNull
                                                        @NotNull java.lang.Object sourceObject,
                                                        @Nullable
                                                        @Nullable java.lang.String sourceKey,
                                                        @NotNull
                                                        @NotNull java.lang.Object targetObject,
                                                        @NotNull
                                                        @NotNull java.lang.String targetKey)
        Connect two objects into the filter chain. This method connects two object in the filter chain. For instance you can connect the outputImage key of a CISepiaTone filter object to the inputImage key of another CIFilter.
        Parameters:
        sourceObject - A CIFilter, CIImage, NSString, or NSURL describing the path to the image
        sourceKey - For KVC access to the source object. Can be nil which means that the source object will be used directly.
        targetObject - The object that you link the source object to.
        targetKey - The key that you assign the source object to.
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • disconnectObjectWithKeyToObjectWithKey

        public void disconnectObjectWithKeyToObjectWithKey​(@NotNull
                                                           @NotNull java.lang.Object sourceObject,
                                                           @NotNull
                                                           @NotNull java.lang.String sourceKey,
                                                           @NotNull
                                                           @NotNull java.lang.Object targetObject,
                                                           @NotNull
                                                           @NotNull java.lang.String targetKey)
        Removes the connection between two objects in the filter chain. Use this method to disconnect two objects that you connected using the connectObject:withKey:toObject:withKey: method.
        Parameters:
        sourceObject - A CIFilter or CIImage or an NSString or an NSURL describing the path to the image
        sourceKey - For KVC access to the source object. Can be nil which means that the source object will be used directly.
        targetObject - The object that you linked the source object to.
        targetKey - The key that you assigned the source object to.
      • exportKeyFromObjectWithName

        public void exportKeyFromObjectWithName​(@NotNull
                                                @NotNull java.lang.String key,
                                                @NotNull
                                                @NotNull java.lang.Object targetObject,
                                                @Nullable
                                                @Nullable java.lang.String exportedKeyName)
        This methods allows you to export an input or output key of an object in the filter chain to be available through the inputKeys or outputKeys API when converted into a CIFilter When you create a CIFilter from the CIFilterGenerator, you might want the client of the filter being able to set some of the paramters of the filter chain. To do so these parameters have to be exported as keys much like the inputKeys and outputKeys of all CIFilters.
        Parameters:
        key - The key path that is to be exported from the target object (eg. inputImage)
        targetObject - The object of which the key is to be exported (eg the filter).
        exportedKeyName - The name under which you want the new key to be available. This parameter can be nil in which case the original key name will be used. This name has to be unique. If a key being exported is an inputKey of the filter it will be exported as an input key and the other way around for output keys.
      • exportedKeys

        @NotNull
        public @NotNull NSDictionary<?,​?> exportedKeys()
        An array of the exported keys. Use this method to get an NSArray of all the keys that you have exported using exportKey:fromObject:withName: or that were exported before written to a file from which you read the filter chain.
        Returns:
        An array of dictionaries that describe the exported key and target object. See CIExportedKey, CIExportedKeyTargetObject and CIExportedKeyName for keys used in the dictionary.
      • filter

        @NotNull
        public @NotNull CIFilter filter()
        Create a CIFilter object based on this filter chain. This method creates a CIFilter from the filter chain where the topology of the chain is immutable, meaning that changes to the filter chain will not be reflected in the filter. The filter will have the input and output keys that were exported as described above.
      • filterGenerator

        @NotNull
        public static @NotNull CIFilterGenerator filterGenerator()
        This creates an empty CIFilterGenerator in which you connect filters and images.
      • filterGeneratorWithContentsOfURL

        @Nullable
        public static @Nullable CIFilterGenerator filterGeneratorWithContentsOfURL​(@NotNull
                                                                                   @NotNull NSURL aURL)
        Create a CIFilterGenerator with the contents of the file.
        Returns:
        CIFilterGenerator object. If the file could not be read it returns nil.
      • hash_static

        public static long hash_static()
      • initWithContentsOfURL

        public CIFilterGenerator initWithContentsOfURL​(@NotNull
                                                       @NotNull NSURL aURL)
        Initializes a CIFilterGenerator with the contents of the file.
        Returns:
        CIFilterGenerator object. If the file could not be read it returns nil.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • registerFilterName

        public void registerFilterName​(@NotNull
                                       @NotNull java.lang.String name)
        Register the resulting filter of the chain in the CIFilter repository. This method allows you to register the filter chain as a named filter in the filter repository. You can then create a CIFilter object from it using the filterWithName: method. Make sure you set the class attributes first - see CIFilter for a description of the classAttributes that are needed to register a filter. When registering Core Image automatically adds the kCIFilterGeneratorCategory to the filters categories. The kCIFilterGeneratorCategory is purely for identification purpose and will not be exposed in the filter browser as a seperate category.
        Parameters:
        name - The name under which the filter will be registered. This name has to be unique.
      • removeExportedKey

        public void removeExportedKey​(@NotNull
                                      @NotNull java.lang.String exportedKeyName)
        Removes a key that was exported before using exportKey:fromObject:withName: Use this method when you want to remove a prior exported key. It will not show up under inputKeys or outputKeys anymore.
        Parameters:
        exportedKeyName - Name of the key that was exported.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setAttributesForExportedKey

        public void setAttributesForExportedKey​(@NotNull
                                                @NotNull NSDictionary<?,​?> attributes,
                                                @NotNull
                                                @NotNull java.lang.String key)
        Set a new dictionary of attributes for an exported key. By default, the exported key inherits the attributes from its original key and target object. Use this method to for instance change the default value or lower the maximum allowed value.
      • setClassAttributes

        public void setClassAttributes​(@NotNull
                                       @NotNull NSDictionary<?,​?> value)
        Retrieve or Set the class attributes that will be used to register the filter using the registerFilterName method. Make sure you set the class attributes before using the registerFilterName method. See CIFilter for a description of the classAttributes that are needed to register a filter.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • version_static

        public static long version_static()
      • writeToURLAtomically

        public boolean writeToURLAtomically​(@NotNull
                                            @NotNull NSURL aURL,
                                            boolean flag)
        Write the CIFilterGenerator into a file
        Returns:
        Returns true when the chain with written our succesfully