Module: Gegl
- Defined in:
- lib/gegl/node.rb,
lib/gegl.rb,
lib/gegl/loader.rb,
lib/gegl/version.rb
Overview
Copyright (C) 2018 Ruby-GNOME2 Project Team
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Defined Under Namespace
Modules: AbyssPolicy, AccessMode, BablVariant, BlitFlags, CachePolicy, DistanceMetric, DitherMethod, MapFlags, Metadata, Orientation, PadType, RectangleAlignment, ResolutionUnit, SamplerType, SerializeFlag, SplitStrategy, TileCommand, Version Classes: AudioFragment, Buffer, Color, Config, Curve, Loader, MetadataHash, MetadataStore, Node, Operation, ParamAudioFragment, ParamColor, ParamCurve, ParamDouble, ParamEnum, ParamFilePath, ParamFormat, ParamInt, ParamPath, ParamSeed, ParamString, ParamUri, Path, Processor, Stats, TileBackend, TileHandler, TileSource
Constant Summary collapse
- AUTO_ROWSTRIDE =
0- CH_BACK_CENTER =
256- CH_BACK_LEFT =
16- CH_BACK_RIGHT =
32- CH_FRONT_CENTER =
4- CH_FRONT_LEFT =
1- CH_FRONT_LEFT_OF_CENTER =
64- CH_FRONT_RIGHT =
2- CH_FRONT_RIGHT_OF_CENTER =
128- CH_LAYOUT_2POINT1 =
0- CH_LAYOUT_2_1 =
0- CH_LAYOUT_2_2 =
0- CH_LAYOUT_3POINT1 =
0- CH_LAYOUT_4POINT0 =
0- CH_LAYOUT_4POINT1 =
0- CH_LAYOUT_5POINT0 =
0- CH_LAYOUT_5POINT0_BACK =
0- CH_LAYOUT_5POINT1 =
0- CH_LAYOUT_5POINT1_BACK =
0- CH_LAYOUT_6POINT0 =
0- CH_LAYOUT_6POINT0_FRONT =
0- CH_LAYOUT_6POINT1 =
0- CH_LAYOUT_6POINT1_BACK =
0- CH_LAYOUT_6POINT1_FRONT =
0- CH_LAYOUT_7POINT0 =
0- CH_LAYOUT_7POINT0_FRONT =
0- CH_LAYOUT_7POINT1 =
0- CH_LAYOUT_7POINT1_WIDE =
0- CH_LAYOUT_7POINT1_WIDE_BACK =
0- CH_LAYOUT_HEXADECAGONAL =
0- CH_LAYOUT_HEXAGONAL =
0- CH_LAYOUT_NATIVE =
9223372036854775808- CH_LAYOUT_OCTAGONAL =
0- CH_LAYOUT_QUAD =
0- CH_LAYOUT_STEREO =
0- CH_LAYOUT_STEREO_DOWNMIX =
0- CH_LAYOUT_SURROUND =
0- CH_LOW_FREQUENCY =
8- CH_LOW_FREQUENCY_2 =
34359738368- CH_SIDE_LEFT =
512- CH_SIDE_RIGHT =
1024- CH_STEREO_LEFT =
536870912- CH_STEREO_RIGHT =
1073741824- CH_SURROUND_DIRECT_LEFT =
8589934592- CH_SURROUND_DIRECT_RIGHT =
17179869184- CH_TOP_BACK_CENTER =
65536- CH_TOP_BACK_LEFT =
32768- CH_TOP_BACK_RIGHT =
131072- CH_TOP_CENTER =
2048- CH_TOP_FRONT_CENTER =
8192- CH_TOP_FRONT_LEFT =
4096- CH_TOP_FRONT_RIGHT =
16384- CH_WIDE_LEFT =
2147483648- CH_WIDE_RIGHT =
4294967296- FLOAT_EPSILON =
0.000010- LOOKUP_MAX_ENTRIES =
819200- MAJOR_VERSION =
0- MAX_AUDIO_CHANNELS =
8- MICRO_VERSION =
48- MINOR_VERSION =
4- PARAM_NO_VALIDATE =
64- LOG_DOMAIN =
"Gegl"
Instance Method Summary collapse
-
#apply_op(buffer, operation_name, array) ⇒ nil
Apply the operation to buffer, overwritting the contents of buffer.
-
#apply_op_valist(buffer, operation_name, var_args) ⇒ nil
Apply the operation to buffer, overwritting the contents of buffer.
- #babl_variant(format, variant) ⇒ Babl::Object
-
#buffer_iterator_empty_new(max_slots) ⇒ Gegl::BufferIterator
Create a new buffer iterator without adding any buffers.
-
#calloc(size, n_memb) ⇒ GObject
allocated 0'd memory.
-
#cl_disable ⇒ nil
Disable OpenCL.
-
#cl_init ⇒ Boolean
Initialize and enable OpenCL, calling this function again will re-enable OpenCL if it has been disabled.
-
#cl_is_accelerated ⇒ Boolean
Check if OpenCL is enabled.
-
#config ⇒ Gegl::Config
Returns a GeglConfig object with properties that can be manipulated to control GEGLs behavior.
-
#create_chain(ops, op_start, op_end, time, rel_dim, path_root) ⇒ nil
Create a node chain from an unparsed commandline string.
-
#create_chain_argv(ops, op_start, op_end, time, rel_dim, path_root) ⇒ nil
Create a node chain from argv style list of op data.
-
#exit ⇒ nil
Call this function when you're done using GEGL.
-
#filter_op(source_buffer, operation_name, array) ⇒ Gegl::Buffer
Apply the operation to source_buffer, returning the result in a new buffer.
-
#filter_op_valist(source_buffer, operation_name, var_args) ⇒ Gegl::Buffer
Apply the operation to source_buffer, returning the result in a new buffer.
-
#format(format_name) ⇒ GObject::Value
Returns a value sutable to pass to the GeglBuffer constructor or any other property that expects a Babl format.
-
#format_get_name(format) ⇒ String
The format name.
-
#free(mem) ⇒ nil
Frees the memory pointed to by mem.
-
#get_version(major, minor, micro) ⇒ nil
This function fetches the version of the GEGL library being used by the running process.
-
#graph_dump_outputs(node) ⇒ nil
Dump the bounds and format of each node in the graph to stdout.
-
#graph_dump_request(node, roi) ⇒ nil
Dump the region that will be rendered for each node to fulfill the request.
-
#has_operation(operation_type) ⇒ Boolean
also returns true for any compat-name registered by operations.
-
#init(argc, argv) ⇒ nil
Call this function before using any other GEGL functions.
- #is_main_thread ⇒ Boolean
-
#list_operations(n_operations_p) ⇒ Array<String>
alphabetically sorted array of available operation names.
-
#load_module_directory(path) ⇒ nil
Load all gegl modules found in the given directory.
-
#lookup_new(function, data) ⇒ Gegl::Lookup
A Gegl::Lookup.
-
#lookup_new_full(function, data, start, end, precision) ⇒ Gegl::Lookup
A Gegl::Lookup.
-
#malloc(n_bytes) ⇒ GObject
Allocates n_bytes of memory.
-
#memeq_zero(ptr, size) ⇒ Boolean
Checks if all the bytes of the memory block ptr, of size size, are equal to zero.
-
#memset_pattern(dst_ptr, src_ptr, pattern_size, count) ⇒ nil
Fill dst_ptr with count copies of the bytes in src_ptr.
-
#option_group ⇒ GLib::OptionGroup
Returns a GOptionGroup for the commandline arguments recognized by GEGL.
-
#parallel_distribute(max_n, func, user_data) ⇒ nil
Distributes the execution of a function across multiple threads, by calling it with a different index on each thread.
-
#parallel_distribute_area(area, thread_cost, split_strategy, func, user_data) ⇒ nil
Distributes the processing of a planar data-structure across multiple threads, by calling the given function with different sub-areas on different threads.
-
#parallel_distribute_range(size, thread_cost, func, user_data) ⇒ nil
Distributes the processing of a linear data-structure across multiple threads, by calling the given function with different sub-ranges on different threads.
-
#param_spec_audio_fragment(name, nick, blurb, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglAudioFragment property.
-
#param_spec_color(name, nick, blurb, default_color, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglColor property.
-
#param_spec_color_from_string(name, nick, blurb, default_color_string, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglColor property.
-
#param_spec_color_get_default(self) ⇒ Gegl::Color
Get the default color value of the param spec.
-
#param_spec_curve(name, nick, blurb, default_curve, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglCurve property.
-
#param_spec_double(name, nick, blurb, minimum, maximum, default_value, ui_minimum, ui_maximum, ui_gamma, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecDouble instance.
-
#param_spec_enum(name, nick, blurb, enum_type, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecEnum instance.
-
#param_spec_file_path(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecFilePath instance.
-
#param_spec_format(name, nick, blurb, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecFormat instance specifying a Babl format.
- #param_spec_get_property_key(pspec, key_name) ⇒ String
-
#param_spec_int(name, nick, blurb, minimum, maximum, default_value, ui_minimum, ui_maximum, ui_gamma, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecInt instance.
-
#param_spec_path(name, nick, blurb, default_path, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglPath property.
-
#param_spec_seed(name, nick, blurb, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecSeed instance specifying an integer random seed.
- #param_spec_set_property_key(pspec, key_name, value) ⇒ nil
-
#param_spec_string(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecString instance.
-
#param_spec_uri(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecUri instance.
-
#rectangle_infinite_plane ⇒ Gegl::Rectangle
Returns a GeglRectangle that represents an infininte plane.
-
#render_op(source_buffer, target_buffer, operation_name, array) ⇒ nil
Apply the operation to source_buffer, writing the results to target_buffer.
-
#render_op_valist(source_buffer, target_buffer, operation_name, var_args) ⇒ nil
Apply the operation to source_buffer, writing the results to target_buffer.
-
#reset_stats ⇒ nil
Resets the cumulative data gathered by the Gegl::Stats object returned by #gegl_stats().
-
#scratch_alloc(size) ⇒ GObject
Allocates size bytes of scratch memory.
-
#scratch_alloc0(size) ⇒ GObject
Allocates size bytes of scratch memory, initialized to zero.
-
#scratch_free(ptr) ⇒ nil
Frees the memory pointed to by ptr.
-
#serialize(start, end, basepath, serialize_flags) ⇒ String
GEGL_SERIALIZE_TRIM_DEFAULTS, GEGL_SERIALIZE_VERSION, GEGL_SERIALIZE_INDENT.
-
#stats ⇒ Gegl::Stats
Returns a GeglStats object with properties that can be read to monitor GEGL statistics.
-
#try_malloc(n_bytes) ⇒ GObject
Allocates n_bytes of memory.
Instance Method Details
#apply_op(buffer, operation_name, array) ⇒ nil
Apply the operation to buffer, overwritting the contents of buffer. ended terminated with NULL.
#apply_op_valist(buffer, operation_name, var_args) ⇒ nil
Apply the operation to buffer, overwritting the contents of buffer. ended terminated with NULL.
#babl_variant(format, variant) ⇒ Babl::Object
#buffer_iterator_empty_new(max_slots) ⇒ Gegl::BufferIterator
Create a new buffer iterator without adding any buffers.
#calloc(size, n_memb) ⇒ GObject
allocated 0'd memory.
#cl_disable ⇒ nil
Disable OpenCL
#cl_init ⇒ Boolean
Initialize and enable OpenCL, calling this function again will re-enable OpenCL if it has been disabled.
#cl_is_accelerated ⇒ Boolean
Check if OpenCL is enabled.
#config ⇒ Gegl::Config
Returns a GeglConfig object with properties that can be manipulated to control GEGLs behavior.
#create_chain(ops, op_start, op_end, time, rel_dim, path_root) ⇒ nil
Create a node chain from an unparsed commandline string.
#create_chain_argv(ops, op_start, op_end, time, rel_dim, path_root) ⇒ nil
Create a node chain from argv style list of op data.
#exit ⇒ nil
Call this function when you're done using GEGL. It will clean up caches and write/dump debug information if the correct debug flags are set.
#filter_op(source_buffer, operation_name, array) ⇒ Gegl::Buffer
Apply the operation to source_buffer, returning the result in a new buffer. ended terminated with NULL.
#filter_op_valist(source_buffer, operation_name, var_args) ⇒ Gegl::Buffer
Apply the operation to source_buffer, returning the result in a new buffer. ended terminated with NULL.
#format(format_name) ⇒ GObject::Value
Returns a value sutable to pass to the GeglBuffer constructor or any other property that expects a Babl format.
#format_get_name(format) ⇒ String
Returns the format name.
#free(mem) ⇒ nil
Frees the memory pointed to by mem. If mem is NULL, does nothing.
#get_version(major, minor, micro) ⇒ nil
This function fetches the version of the GEGL library being used by the running process.
#graph_dump_outputs(node) ⇒ nil
Dump the bounds and format of each node in the graph to stdout.
#graph_dump_request(node, roi) ⇒ nil
Dump the region that will be rendered for each node to fulfill the request.
#has_operation(operation_type) ⇒ Boolean
also returns true for any compat-name registered by operations.
#init(argc, argv) ⇒ nil
Call this function before using any other GEGL functions. It will initialize everything needed to operate GEGL and parses some standard command line options. argc and argv are adjusted accordingly so your own code will never see those standard arguments.
Note that there is an alternative way to initialize GEGL: if you are calling g_option_context_parse() with the option group returned by #gegl_get_option_group(), you don't have to call #gegl_init().
#is_main_thread ⇒ Boolean
#list_operations(n_operations_p) ⇒ Array<String>
alphabetically sorted array of available operation names. This excludes any compat-name registered by operations. The list should be freed with g_free after use.
gchar **operations; guint n_operations; gint i;
operations = gegl_list_operations (&n_operations); g_print ("Available operations:\n"); for (i=0; i < n_operations; i++) { g_print ("\t%s\n", operations[i]); } g_free (operations);
#load_module_directory(path) ⇒ nil
Load all gegl modules found in the given directory.
#lookup_new(function, data) ⇒ Gegl::Lookup
Returns a Gegl::Lookup.
#lookup_new_full(function, data, start, end, precision) ⇒ Gegl::Lookup
Returns a Gegl::Lookup.
#malloc(n_bytes) ⇒ GObject
Allocates n_bytes of memory. If n_bytes is 0, returns NULL.
Returns a pointer to the allocated memory.
#memeq_zero(ptr, size) ⇒ Boolean
Checks if all the bytes of the memory block ptr, of size size, are equal to zero.
#memset_pattern(dst_ptr, src_ptr, pattern_size, count) ⇒ nil
Fill dst_ptr with count copies of the bytes in src_ptr.
#option_group ⇒ GLib::OptionGroup
Returns a GOptionGroup for the commandline arguments recognized by GEGL. You should add this group to your GOptionContext with g_option_context_add_group() if you are using g_option_context_parse() to parse your commandline arguments.
#parallel_distribute(max_n, func, user_data) ⇒ nil
Distributes the execution of a function across multiple threads, by calling it with a different index on each thread.
#parallel_distribute_area(area, thread_cost, split_strategy, func, user_data) ⇒ nil
Distributes the processing of a planar data-structure across multiple threads, by calling the given function with different sub-areas on different threads.
#parallel_distribute_range(size, thread_cost, func, user_data) ⇒ nil
Distributes the processing of a linear data-structure across multiple threads, by calling the given function with different sub-ranges on different threads.
#param_spec_audio_fragment(name, nick, blurb, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglAudioFragment property.
#param_spec_color(name, nick, blurb, default_color, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglColor property.
#param_spec_color_from_string(name, nick, blurb, default_color_string, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglColor property.
#param_spec_color_get_default(self) ⇒ Gegl::Color
Get the default color value of the param spec
#param_spec_curve(name, nick, blurb, default_curve, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglCurve property.
#param_spec_double(name, nick, blurb, minimum, maximum, default_value, ui_minimum, ui_maximum, ui_gamma, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecDouble instance.
#param_spec_enum(name, nick, blurb, enum_type, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecEnum instance.
#param_spec_file_path(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecFilePath instance.
#param_spec_format(name, nick, blurb, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecFormat instance specifying a Babl format.
#param_spec_get_property_key(pspec, key_name) ⇒ String
#param_spec_int(name, nick, blurb, minimum, maximum, default_value, ui_minimum, ui_maximum, ui_gamma, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecInt instance.
#param_spec_path(name, nick, blurb, default_path, flags) ⇒ GObject::ParamSpec
Creates a new GParam::Spec instance specifying a #GeglPath property.
#param_spec_seed(name, nick, blurb, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecSeed instance specifying an integer random seed.
#param_spec_set_property_key(pspec, key_name, value) ⇒ nil
#param_spec_string(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecString instance.
#param_spec_uri(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec
Creates a new Gegl::ParamSpecUri instance.
#rectangle_infinite_plane ⇒ Gegl::Rectangle
Returns a GeglRectangle that represents an infininte plane.
#render_op(source_buffer, target_buffer, operation_name, array) ⇒ nil
Apply the operation to source_buffer, writing the results to target_buffer. ended terminated with NULL.
#render_op_valist(source_buffer, target_buffer, operation_name, var_args) ⇒ nil
Apply the operation to source_buffer, writing the results to target_buffer. ended terminated with NULL.
#reset_stats ⇒ nil
Resets the cumulative data gathered by the Gegl::Stats object returned by #gegl_stats().
#scratch_alloc(size) ⇒ GObject
Allocates size bytes of scratch memory.
Returns a pointer to the allocated memory.
#scratch_alloc0(size) ⇒ GObject
Allocates size bytes of scratch memory, initialized to zero.
Returns a pointer to the allocated memory.
#scratch_free(ptr) ⇒ nil
Frees the memory pointed to by ptr.
The memory must have been allocated using one of the scratch-memory allocation functions.
#serialize(start, end, basepath, serialize_flags) ⇒ String
GEGL_SERIALIZE_TRIM_DEFAULTS, GEGL_SERIALIZE_VERSION, GEGL_SERIALIZE_INDENT.
#stats ⇒ Gegl::Stats
Returns a GeglStats object with properties that can be read to monitor GEGL statistics.
#try_malloc(n_bytes) ⇒ GObject
Allocates n_bytes of memory. If allocation fails, or if n_bytes is 0, returns nil.
Returns a pointer to the allocated memory, or NULL.