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

Instance Method Details

#apply_op(buffer, operation_name, array) ⇒ nil

Apply the operation to buffer, overwritting the contents of buffer. ended terminated with NULL.

Parameters:

  • buffer (Gegl::Buffer)

    the Gegl::Buffer to apply onto

  • operation_name (String)

    name of the operation to apply

  • array (Array)

    the settings for the operation. Zero or more key/value pairs,

Returns:

  • (nil)

#apply_op_valist(buffer, operation_name, var_args) ⇒ nil

Apply the operation to buffer, overwritting the contents of buffer. ended terminated with NULL.

Parameters:

  • buffer (Gegl::Buffer)

    the Gegl::Buffer to apply onto

  • operation_name (String)

    name of the operation to apply

  • var_args (Gegl::va_list)

    the settings for the operation. Zero or more key/value pairs,

Returns:

  • (nil)

#babl_variant(format, variant) ⇒ Babl::Object

Parameters:

Returns:

  • (Babl::Object)

#buffer_iterator_empty_new(max_slots) ⇒ Gegl::BufferIterator

Create a new buffer iterator without adding any buffers.

Parameters:

  • max_slots (Integer)

Returns:

  • (Gegl::BufferIterator)

    a new buffer iterator.

#calloc(size, n_memb) ⇒ GObject

allocated 0'd memory.

Parameters:

  • size (Integer)

    size of items to allocate

  • n_memb (Integer)

    number of members

Returns:

  • (GObject)

#cl_disablenil

Disable OpenCL

Returns:

  • (nil)

#cl_initBoolean

Initialize and enable OpenCL, calling this function again will re-enable OpenCL if it has been disabled.

Returns:

  • (Boolean)

    True if OpenCL was initialized

#cl_is_acceleratedBoolean

Check if OpenCL is enabled.

Returns:

  • (Boolean)

    True if OpenCL is initialized and enabled

#configGegl::Config

Returns a GeglConfig object with properties that can be manipulated to control GEGLs behavior.

Returns:

#create_chain(ops, op_start, op_end, time, rel_dim, path_root) ⇒ nil

Create a node chain from an unparsed commandline string.

Parameters:

  • ops (String)

    an argv style, NULL terminated array of arguments

  • op_start (Gegl::Node)

    node to pass in as input of chain

  • op_end (Gegl::Node)

    node to get processed data

  • time (Float)

    the time to use for interpolatino of keyframed values

  • rel_dim (Integer)

    relative dimension to scale rel suffixed values by

  • path_root (String)

    path in filesystem to use as relative root

Returns:

  • (nil)

#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.

Parameters:

  • ops (String)

    an argv style, NULL terminated array of arguments

  • op_start (Gegl::Node)

    node to pass in as input of chain

  • op_end (Gegl::Node)

    node to get processed data

  • time (Float)

    the time to use for interpolatino of keyframed values

  • rel_dim (Integer)

    relative dimension to scale rel suffixed values by

  • path_root (String)

    path in filesystem to use as relative root

Returns:

  • (nil)

#exitnil

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.

Returns:

  • (nil)

#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.

Parameters:

  • source_buffer (Gegl::Buffer)

    the source Gegl::Buffer for the filter

  • operation_name (String)

    name of the operation to apply

  • array (Array)

    the settings for the operation. Zero or more key/value pairs,

Returns:

#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.

Parameters:

  • source_buffer (Gegl::Buffer)

    the source Gegl::Buffer for the filter

  • operation_name (String)

    name of the operation to apply

  • var_args (Gegl::va_list)

    the settings for the operation. Zero or more key/value pairs,

Returns:

#format(format_name) ⇒ GObject::Value

Returns a value sutable to pass to the GeglBuffer constructor or any other property that expects a Babl format.

Parameters:

  • format_name (String)

    A Babl format name, e.g. "RGBA float"

Returns:

  • (GObject::Value)

    the format pointer

#format_get_name(format) ⇒ String

Returns the format name.

Parameters:

  • format (GObject::Value)

    A Babl pointer

Returns:

  • (String)

    the format name

#free(mem) ⇒ nil

Frees the memory pointed to by mem. If mem is NULL, does nothing.

Parameters:

  • mem (GObject)

    the memory to free.

Returns:

  • (nil)

#get_version(major, minor, micro) ⇒ nil

This function fetches the version of the GEGL library being used by the running process.

Parameters:

  • major (Integer)

    a pointer to a int where the major version number will be stored

  • minor (Integer)

    ditto for the minor version number

  • micro (Integer)

    ditto for the micro version number

Returns:

  • (nil)

#graph_dump_outputs(node) ⇒ nil

Dump the bounds and format of each node in the graph to stdout.

Parameters:

  • node (Gegl::Node)

    The final node of the graph

Returns:

  • (nil)

#graph_dump_request(node, roi) ⇒ nil

Dump the region that will be rendered for each node to fulfill the request.

Parameters:

  • node (Gegl::Node)

    The final node of the graph

  • roi (Gegl::Rectangle)

    The request rectangle

Returns:

  • (nil)

#has_operation(operation_type) ⇒ Boolean

also returns true for any compat-name registered by operations.

Parameters:

  • operation_type (String)

    the name of the operation

Returns:

  • (Boolean)

    A boolean telling whether the operation is present or not. This

#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().

Parameters:

  • argc (Integer)

    a pointer to the number of command line arguments.

  • argv (Array<String>)

    a pointer to the array of command line arguments.

Returns:

  • (nil)

#is_main_threadBoolean

Returns:

  • (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);

Parameters:

  • n_operations_p (Integer)

    return location for number of operations.

Returns:

  • (Array<String>)

    An

#load_module_directory(path) ⇒ nil

Load all gegl modules found in the given directory.

Parameters:

  • path (String)

    the directory to load modules from

Returns:

  • (nil)

#lookup_new(function, data) ⇒ Gegl::Lookup

Returns a Gegl::Lookup.

Parameters:

  • function (Gegl::LookupFunction)

    The function to build a lookup for

  • data (GObject)

    A user data pointer passed to lookup calls

Returns:

  • (Gegl::Lookup)

    a Gegl::Lookup

#lookup_new_full(function, data, start, end, precision) ⇒ Gegl::Lookup

Returns a Gegl::Lookup.

Parameters:

  • function (Gegl::LookupFunction)

    The function to build a lookup for

  • data (GObject)

    A user data pointer passed to lookup calls

  • start (Gegl::gfloat)

    Lower bound of the lookup

  • end (Gegl::gfloat)

    Upper bound of the lookup

  • precision (Gegl::gfloat)

    The precision of the lookup table

Returns:

  • (Gegl::Lookup)

    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.

Parameters:

  • n_bytes (Integer)

    the number of bytes to allocte.

Returns:

  • (GObject)

#memeq_zero(ptr, size) ⇒ Boolean

Checks if all the bytes of the memory block ptr, of size size, are equal to zero.

Parameters:

  • ptr (GObject)

    pointer to the memory block

  • size (Integer)

    block size

Returns:

  • (Boolean)

    TRUE if all the bytes 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.

Parameters:

  • dst_ptr (GObject)

    pointer to copy to

  • src_ptr (GObject)

    pointer to copy from

  • pattern_size (Integer)

    the length of src_ptr

  • count (Integer)

    number of copies

Returns:

  • (nil)

#option_groupGLib::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.

Returns:

  • (GLib::OptionGroup)

#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.

Parameters:

  • max_n (Integer)

    the maximal number of threads to use

  • func (Gegl::ParallelDistributeFunc)

    the function to call

  • user_data (GObject)

    user data to pass to the function

Returns:

  • (nil)

#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.

Parameters:

  • area (Gegl::Rectangle)

    the area to process

  • thread_cost (Float)

    the cost of using each additional thread, relative to the cost of processing a single data element

  • split_strategy (Gegl::SplitStrategy)

    the strategy to use for dividing the area

  • func (Gegl::ParallelDistributeAreaFunc)

    the function to call

  • user_data (GObject)

    user data to pass to the function

Returns:

  • (nil)

#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.

Parameters:

  • size (Integer)

    the total size of the data

  • thread_cost (Float)

    the cost of using each additional thread, relative to the cost of processing a single data element

  • func (Gegl::ParallelDistributeRangeFunc)

    the function to call

  • user_data (GObject)

    user data to pass to the function

Returns:

  • (nil)

#param_spec_audio_fragment(name, nick, blurb, flags) ⇒ GObject::ParamSpec

Creates a new GParam::Spec instance specifying a #GeglAudioFragment property.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_color(name, nick, blurb, default_color, flags) ⇒ GObject::ParamSpec

Creates a new GParam::Spec instance specifying a #GeglColor property.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • default_color (Gegl::Color)

    the default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_color_from_string(name, nick, blurb, default_color_string, flags) ⇒ GObject::ParamSpec

Creates a new GParam::Spec instance specifying a #GeglColor property.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • default_color_string (String)

    the default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_color_get_default(self) ⇒ Gegl::Color

Get the default color value of the param spec

Parameters:

  • self (GObject::ParamSpec)

    a Gegl::Color #GParamSpec

Returns:

#param_spec_curve(name, nick, blurb, default_curve, flags) ⇒ GObject::ParamSpec

Creates a new GParam::Spec instance specifying a #GeglCurve property.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • default_curve (Gegl::Curve)

    the default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#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.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • minimum (Float)

    minimum value for the property specified

  • maximum (Float)

    maximum value for the property specified

  • default_value (Float)

    default value for the property specified

  • ui_minimum (Float)

    minimum value a user should be allowed to input

  • ui_maximum (Float)

    maximum value a user should be allowed to input

  • ui_gamma (Float)

    the gamma that should be used when adjusting the value

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_enum(name, nick, blurb, enum_type, default_value, flags) ⇒ GObject::ParamSpec

Creates a new Gegl::ParamSpecEnum instance.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • enum_type (GLib::Type)

    the enum type to get valid values from

  • default_value (Integer)

    default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_file_path(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec

Creates a new Gegl::ParamSpecFilePath instance.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • no_validate (Boolean)

    true if the string should be validated with g_utf8_validate

  • null_ok (Boolean)

    true if the string can be NULL

  • default_value (String)

    default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_format(name, nick, blurb, flags) ⇒ GObject::ParamSpec

Creates a new Gegl::ParamSpecFormat instance specifying a Babl format.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_get_property_key(pspec, key_name) ⇒ String

Parameters:

  • pspec (GObject::ParamSpec)
  • key_name (String)

Returns:

  • (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.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • minimum (Integer)

    minimum value for the property specified

  • maximum (Integer)

    maximum value for the property specified

  • default_value (Integer)

    default value for the property specified

  • ui_minimum (Integer)

    minimum value a user should be allowed to input

  • ui_maximum (Integer)

    maximum value a user should be allowed to input

  • ui_gamma (Float)

    the gamma that should be used when adjusting the value

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_path(name, nick, blurb, default_path, flags) ⇒ GObject::ParamSpec

Creates a new GParam::Spec instance specifying a #GeglPath property.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • default_path (Gegl::Path)

    the default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_seed(name, nick, blurb, flags) ⇒ GObject::ParamSpec

Creates a new Gegl::ParamSpecSeed instance specifying an integer random seed.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_set_property_key(pspec, key_name, value) ⇒ nil

Parameters:

  • pspec (GObject::ParamSpec)
  • key_name (String)
  • value (String)

Returns:

  • (nil)

#param_spec_string(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec

Creates a new Gegl::ParamSpecString instance.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • no_validate (Boolean)

    true if the string should be validated with g_utf8_validate

  • null_ok (Boolean)

    true if the string can be NULL

  • default_value (String)

    default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#param_spec_uri(name, nick, blurb, no_validate, null_ok, default_value, flags) ⇒ GObject::ParamSpec

Creates a new Gegl::ParamSpecUri instance.

Parameters:

  • name (String)

    canonical name of the property specified

  • nick (String)

    nick name for the property specified

  • blurb (String)

    description of the property specified

  • no_validate (Boolean)

    true if the string should be validated with g_utf8_validate

  • null_ok (Boolean)

    true if the string can be NULL

  • default_value (String)

    default value for the property specified

  • flags (GObject::ParamFlags)

    flags for the property specified

Returns:

  • (GObject::ParamSpec)

    a newly created parameter specification

#rectangle_infinite_planeGegl::Rectangle

Returns a GeglRectangle that represents an infininte plane.

Returns:

  • (Gegl::Rectangle)

#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.

Parameters:

  • source_buffer (Gegl::Buffer)

    the source Gegl::Buffer for the filter

  • target_buffer (Gegl::Buffer)

    the source Gegl::Buffer for the filter

  • operation_name (String)

    name of the operation to apply

  • array (Array)

    the settings for the operation. Zero or more key/value pairs,

Returns:

  • (nil)

#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.

Parameters:

  • source_buffer (Gegl::Buffer)

    the source Gegl::Buffer for the filter

  • target_buffer (Gegl::Buffer)

    the source Gegl::Buffer for the filter

  • operation_name (String)

    name of the operation to apply

  • var_args (Gegl::va_list)

    the settings for the operation. Zero or more key/value pairs,

Returns:

  • (nil)

#reset_statsnil

Resets the cumulative data gathered by the Gegl::Stats object returned by #gegl_stats().

Returns:

  • (nil)

#scratch_alloc(size) ⇒ GObject

Allocates size bytes of scratch memory.

Returns a pointer to the allocated memory.

Parameters:

  • size (Integer)

    the number of bytes to allocte.

Returns:

  • (GObject)

#scratch_alloc0(size) ⇒ GObject

Allocates size bytes of scratch memory, initialized to zero.

Returns a pointer to the allocated memory.

Parameters:

  • size (Integer)

    the number of bytes to allocte.

Returns:

  • (GObject)

#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.

Parameters:

  • ptr (GObject)

    the memory to free.

Returns:

  • (nil)

#serialize(start, end, basepath, serialize_flags) ⇒ String

GEGL_SERIALIZE_TRIM_DEFAULTS, GEGL_SERIALIZE_VERSION, GEGL_SERIALIZE_INDENT.

Parameters:

  • start (Gegl::Node)

    first node in chain to serialize

  • end (Gegl::Node)

    last node in chain to serialize

  • basepath (String)

    top-level absolute path to turn into relative root

  • serialize_flags (Gegl::SerializeFlag)

    anded together combination of:

Returns:

  • (String)

#statsGegl::Stats

Returns a GeglStats object with properties that can be read to monitor GEGL statistics.

Returns:

#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.

Parameters:

  • n_bytes (Integer)

    the number of bytes to allocte.

Returns:

  • (GObject)