Class RS::Graphics::RSImageUnit
In: rsil/graphics/rsimageunit.rb
Parent: Object
RSTripel RSRectangle RSObjcWrapper RSImageUnit RSImageList RSILRMagickConverter RSILTkConverter RSConverter RSProperties RSImageProperties RSPoint RSDimension Array RSVector RSFilter RSColor RSImage\n[rsil/extension/rsimageextension.rb\nrsil/graphics/rsimage.rb] RSImageX Comparable RSAbstractConverter Enumerable Test::Unit::TestCase RSTestPoint RSTestFilter RSTestImage RSTestExtension RSTestDimension RSTestVector RSTestImageUnit RSTestImageProperties RSTestColor RSTestRectangle RSTestProperties RSTestImageList RSTestConverter RSTestComparison RSTestStress RSTestUseCases RSTestTripel RSTestScenarios MonitorMixin Benchmark StandardError Assertion RSEXIFProperties RSTests rsil/geometry/rsdimension.rb rsil/geometry/rspoint.rb rsil/geometry/rsvector.rb rsil/geometry/rsrectangle.rb rsil/geometry/rstripel.rb Geometry rsil/graphics/rsfilter.rb rsil/graphics/rsimagelist.rb rsil/graphics/rscolor.rb rsil/graphics/rsimageunit.rb rsil/extension/rsimagex.rb rsil/graphics/rsimage.rb Graphics rsil/converter/rsconverter.rb rsil/converter/rsabstractconverter.rb rsil/converter/rsiltkconverter.rb rsil/converter/rsilrmagickconverter.rb Converter rsil/test/rstestusecases.rb rsil/test/rstestcolor.rb rsil/test/rstestdimension.rb rsil/test/rstestfilter.rb rsil/test/rstestpoint.rb rsil/test/rstestconverter.rb rsil/test/rstestimagelist.rb rsil/test/rstestimageproperties.rb rsil/test/rstestscenarios.rb rsil/test/rstestvector.rb rsil/test/rstesttripel.rb rsil/test/rstestproperties.rb rsil/test/rstestimageunit.rb rsil/test/rstestextension.rb rsil/test/rstestimage.rb rsil/test/rsteststress.rb rsil/test/rstestcomparison.rb rsil/test/rstestrectangle.rb rsil/test/rstests.rb Test rsil/extension/rsextension.rb Extension rsil/utils/rsimageproperties.rb rsil/utils/rsobjcwrapper.rb rsil/utils/rsproperties.rb rsil/utils/rsexifproperties.rb Utils RS Module: RS

Class:RSImageUnit
File:rsimageunit.rb
Purpose:RSFilter represents an Image Unit for Filters through wrapping of OSX::CIPlugin
Created by:Mario Pehle, 2006/04/29
Required modules:-
Offers functions:-

Methods

Included Modules

RS::Extension

Attributes

file  [R]  saves the path and filename of the Image Unit as a String.

Public Class methods

Description:Checks, whether image unit was loaded. If no argument is given, checks the actual image unit if loaded.
Precondition:-
Postcondition:-
Exceptions:-
Uses:@@loaded_files
Returns:true if loaded, else false
Parameters:Name | i/o/io | default | Meaning
:file | i | - | String, the path and name of the file to check

[Source]

     # File rsil/graphics/rsimageunit.rb, line 116
116:   def self::image_unit_loaded? file
117:     @@loaded_files.include?(file)
118:   end
Description:Loads all filters (executable and nonexecutable) from image units stored in files with extension .plugin. Scans the directories /Library/Graphics/Image Units and ~/Library/Graphics/Image Units. Because of the used method this method can not guarantee, that the Image Unit was loaded successfully.
Precondition:-
Postcondition:-
Exceptions:-
Uses:OSX::CIPlugIn.oadPlugIns
Returns:nil
Parameters:Name | i/o/io | default | Meaning

[Source]

    # File rsil/graphics/rsimageunit.rb, line 52
52:   def self::load_all_image_units
53:     OSX::CIPlugIn.loadAllPlugIns
54:   end
Description:Loads all filters from specified image units. Loads executable and nonexecutable filters by default. Set ‘only_nonexecutable’ to true to only load nonexecutable filters from the specified image unit. The return value "true" does not necessarily mean, the filters are loaded, but that the call to load the image unit was done the first time.
Precondition:Loads the file if not already loaded.
Postcondition:@@loaded_files is changed.
Exceptions:-
Uses:OSX::CIPlugIN.loadPlugIn, OSX::NSURL
Returns:true if loaded first, else false
Parameters:Name | i/o/io | default | Meaning
:file | i | - | String, the path and filename of the image unit to load
:only_nonexecutables | i | false | Boolean, only load nonexecutable filters from specified image unit

[Source]

     # File rsil/graphics/rsimageunit.rb, line 86
 86:   def self::load_image_unit file, only_nonexecutables=false
 87:     unless @@loaded_files.include? file and
 88:            file.respond_to?(:to_s) and
 89:            !file.nil?
 90:       nsurl = OSX::NSURL.fileURLWithPath file
 91:       assert "nsurl not initialized" if nsurl.nil?
 92:       OSX::CIPlugIn.loadPlugIn(
 93:         nsurl,
 94:         :allowNonExecutable,
 95:         only_nonexecutables
 96:       )
 97:       @@loaded_files << file
 98:       return true
 99:     end
100:     false
101:   end
Description:Loads all nonexecutable filters from image units stored in files with extension .plugin. Scans the directories /Library/Graphics/Image Units and ~/Library/Graphics/Image Units. Because of the used method this method can not guarantee, that the Image Unit was loaded successfully.
Precondition:-
Postcondition:-
Exceptions:-
Uses:OSX::CIPlugIn.loadNonExecutablePlugIns
Returns:nil
Parameters:Name | i/o/io | default | Meaning

[Source]

    # File rsil/graphics/rsimageunit.rb, line 68
68:   def self::load_nonexecutable_filters
69:     OSX::CIPlugIn.loadNonExecutablePlugIns
70:   end
Description:Initialize the RSImageList with a String.
Precondition:-
Postcondition:@file is changed.
Exceptions:ArgumentError
Uses:@file
Returns:self
Parameters:Name | i/o/io | default | Meaning
:file | i | - | String, the path and name of the image unit file

[Source]

     # File rsil/graphics/rsimageunit.rb, line 133
133:   def initialize file
134:     unless file.nil?
135:       if file.respond_to? :to_str
136:         @file = file.to_str
137:       else
138:         raise ArgumentError, "Can not convert argument."
139:       end
140:     else
141:       raise ArgumentError, "Argument 'file' has to be a String."
142:     end
143:     self
144:   end

Public Instance methods

Description:Checks, whether image unit was loaded. If no argument is given, checks the actual image unit if loaded.
Precondition:-
Postcondition:-
Exceptions:-
Uses:@file, @@loaded_files
Returns:true if loaded, else false
Parameters:Name | i/o/io | default | Meaning
:file | i | nil | String, the path and name of the file to check

[Source]

     # File rsil/graphics/rsimageunit.rb, line 176
176:   def image_unit_loaded? file=nil
177:     if file.nil?
178:       return @@loaded_files.include?(@file)
179:     else
180:       return @@loaded_files.include?(file)
181:     end
182:   end
Description:Loads all filters from specified image units. Loads executable and nonexecutable filters by default. Set ‘only_nonexecutable’ to true to only load nonexecutable filters from the specified image unit. The return value "true" does not necessarily mean, the filters are loaded, but that the call to load the image unit was done the first time.
Precondition:-
Postcondition:-
Exceptions:-
Uses:RSImageUnit#load_image_unit
Returns:true if loaded first, else false
Parameters:Name | i/o/io | default | Meaning
:only_nonexecutables | i | false | Boolean, only load nonexecutable filters from specified image unit

[Source]

     # File rsil/graphics/rsimageunit.rb, line 159
159:   def load_image_unit only_nonexecutables=false
160:     self.class.load_image_unit @file, only_nonexecutables
161:   end

[Validate]