|
Packit Service |
2781ba |
/* This file is part of GEGL
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* GEGL is free software; you can redistribute it and/or
|
|
Packit Service |
2781ba |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
2781ba |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
2781ba |
* version 3 of the License, or (at your option) any later version.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* GEGL is distributed in the hope that it will be useful,
|
|
Packit Service |
2781ba |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
2781ba |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
2781ba |
* Lesser General Public License for more details.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
2781ba |
* License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* Copyright 2003 Calvin Williamson
|
|
Packit Service |
2781ba |
* 2006 Øyvind Kolås
|
|
Packit Service |
2781ba |
*/
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#ifndef __GEGL_NODE_H__
|
|
Packit Service |
2781ba |
#define __GEGL_NODE_H__
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#include "operation/gegl-operation-context.h"
|
|
Packit Service |
2781ba |
#include <gegl/buffer/gegl-buffer.h>
|
|
Packit Service |
2781ba |
#include <gegl/buffer/gegl-cache.h>
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
G_BEGIN_DECLS
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#define GEGL_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEGL_TYPE_NODE, GeglNodeClass))
|
|
Packit Service |
2781ba |
#define GEGL_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_NODE))
|
|
Packit Service |
2781ba |
#define GEGL_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEGL_TYPE_NODE, GeglNodeClass))
|
|
Packit Service |
2781ba |
/* The rest is in gegl-types.h */
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
typedef struct _GeglNodeClass GeglNodeClass;
|
|
Packit Service |
2781ba |
typedef struct _GeglNodePrivate GeglNodePrivate;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
struct _GeglNode
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
GObject parent_instance;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* The current operation associated with this node */
|
|
Packit Service |
2781ba |
GeglOperation *operation;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* The region for which this node provides pixel data */
|
|
Packit Service |
2781ba |
GeglRectangle have_rect;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* If TRUE the above have_rect is correct and can be returned
|
|
Packit Service |
2781ba |
* directly instead of computed
|
|
Packit Service |
2781ba |
*/
|
|
Packit Service |
2781ba |
gboolean valid_have_rect;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* All the pads on this node, depends on operation */
|
|
Packit Service |
2781ba |
GSList *pads;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* The input pads */
|
|
Packit Service |
2781ba |
GSList *input_pads;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* The output pads */
|
|
Packit Service |
2781ba |
GSList *output_pads;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* If a node is a graph it means it has children. Typically the
|
|
Packit Service |
2781ba |
* children connect to the input/output proxies of their graph
|
|
Packit Service |
2781ba |
* node. This results in that the graph node can more or less be
|
|
Packit Service |
2781ba |
* transparently treated as a normal node in most contexts
|
|
Packit Service |
2781ba |
*/
|
|
Packit Service |
2781ba |
gboolean is_graph;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* For a node, the cache should be created at first demand if
|
|
Packit Service |
2781ba |
* applicable, and the cache object reused for all subsequent
|
|
Packit Service |
2781ba |
* requests for the cache object.
|
|
Packit Service |
2781ba |
*/
|
|
Packit Service |
2781ba |
GeglCache *cache;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* Whether result is cached or not, inherited by children */
|
|
Packit Service |
2781ba |
gboolean dont_cache;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GMutex *mutex;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/*< private >*/
|
|
Packit Service |
2781ba |
GeglNodePrivate *priv;
|
|
Packit Service |
2781ba |
};
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
struct _GeglNodeClass
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
GObjectClass parent_class;
|
|
Packit Service |
2781ba |
};
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* renders the desired region of interest to a buffer of the specified
|
|
Packit Service |
2781ba |
* bablformat */
|
|
Packit Service |
2781ba |
void gegl_node_blit (GeglNode *node,
|
|
Packit Service |
2781ba |
gdouble scale,
|
|
Packit Service |
2781ba |
const GeglRectangle *roi,
|
|
Packit Service |
2781ba |
const Babl *format,
|
|
Packit Service |
2781ba |
gpointer destination_buf,
|
|
Packit Service |
2781ba |
gint rowstride,
|
|
Packit Service |
2781ba |
GeglBlitFlags flags);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
void gegl_node_process (GeglNode *self);
|
|
Packit Service |
2781ba |
void gegl_node_link (GeglNode *source,
|
|
Packit Service |
2781ba |
GeglNode *sink);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
void gegl_node_link_many (GeglNode *source,
|
|
Packit Service |
2781ba |
GeglNode *dest,
|
|
Packit Service |
2781ba |
...) G_GNUC_NULL_TERMINATED;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
gboolean gegl_node_connect_from (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *input_pad_name,
|
|
Packit Service |
2781ba |
GeglNode *source,
|
|
Packit Service |
2781ba |
const gchar *output_pad_name);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
gboolean gegl_node_connect_to (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *output_pad_name,
|
|
Packit Service |
2781ba |
GeglNode *sink,
|
|
Packit Service |
2781ba |
const gchar *input_pad_name);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
gboolean gegl_node_disconnect (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *input_pad_name);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
void gegl_node_set (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *first_property_name,
|
|
Packit Service |
2781ba |
...) G_GNUC_NULL_TERMINATED;
|
|
Packit Service |
2781ba |
void gegl_node_get (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *first_property_name,
|
|
Packit Service |
2781ba |
...) G_GNUC_NULL_TERMINATED;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_get_parent (GeglNode *self);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* functions below are internal to gegl */
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GType gegl_node_get_type (void) G_GNUC_CONST;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglOperationContext *gegl_node_get_context (GeglNode *self,
|
|
Packit Service |
2781ba |
gpointer context_id);
|
|
Packit Service |
2781ba |
void gegl_node_remove_context (GeglNode *self,
|
|
Packit Service |
2781ba |
gpointer context_id);
|
|
Packit Service |
2781ba |
GeglOperationContext *gegl_node_add_context (GeglNode *self,
|
|
Packit Service |
2781ba |
gpointer context_id);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
void gegl_node_add_pad (GeglNode *self,
|
|
Packit Service |
2781ba |
GeglPad *pad);
|
|
Packit Service |
2781ba |
void gegl_node_remove_pad (GeglNode *self,
|
|
Packit Service |
2781ba |
GeglPad *pad);
|
|
Packit Service |
2781ba |
gboolean gegl_node_has_pad (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *name);
|
|
Packit Service |
2781ba |
GeglPad * gegl_node_get_pad (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *name);
|
|
Packit Service |
2781ba |
GSList * gegl_node_get_pads (GeglNode *self);
|
|
Packit Service |
2781ba |
GSList * gegl_node_get_input_pads (GeglNode *self);
|
|
Packit Service |
2781ba |
GSList * gegl_node_get_sinks (GeglNode *self);
|
|
Packit Service |
2781ba |
gint gegl_node_get_num_sinks (GeglNode *self);
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_get_producer (GeglNode *self,
|
|
Packit Service |
2781ba |
gchar *pad_name,
|
|
Packit Service |
2781ba |
gchar **output_pad);
|
|
Packit Service |
2781ba |
void gegl_node_dump_depends_on (GeglNode *self);
|
|
Packit Service |
2781ba |
void gegl_node_set_valist (GeglNode *object,
|
|
Packit Service |
2781ba |
const gchar *first_property_name,
|
|
Packit Service |
2781ba |
va_list var_args);
|
|
Packit Service |
2781ba |
void gegl_node_get_valist (GeglNode *object,
|
|
Packit Service |
2781ba |
const gchar *first_property_name,
|
|
Packit Service |
2781ba |
va_list var_args);
|
|
Packit Service |
2781ba |
void gegl_node_set_property (GeglNode *object,
|
|
Packit Service |
2781ba |
const gchar *property_name,
|
|
Packit Service |
2781ba |
const GValue *value);
|
|
Packit Service |
2781ba |
void gegl_node_get_property (GeglNode *object,
|
|
Packit Service |
2781ba |
const gchar *property_name,
|
|
Packit Service |
2781ba |
GValue *value);
|
|
Packit Service |
2781ba |
GParamSpec * gegl_node_find_property (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *property_name);
|
|
Packit Service |
2781ba |
void gegl_node_set_need_rect (GeglNode *node,
|
|
Packit Service |
2781ba |
gpointer context_id,
|
|
Packit Service |
2781ba |
const GeglRectangle *rect);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* Graph related member functions of the GeglNode class */
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_add_child (GeglNode *self,
|
|
Packit Service |
2781ba |
GeglNode *child);
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_remove_child (GeglNode *self,
|
|
Packit Service |
2781ba |
GeglNode *child);
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_get_nth_child (GeglNode *self,
|
|
Packit Service |
2781ba |
gint n);
|
|
Packit Service |
2781ba |
GSList * gegl_node_get_children (GeglNode *self);
|
|
Packit Service |
2781ba |
void gegl_node_remove_children (GeglNode *self);
|
|
Packit Service |
2781ba |
gint gegl_node_get_num_children (GeglNode *self);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_new (void);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_new_child (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *first_property_name,
|
|
Packit Service |
2781ba |
...) G_GNUC_NULL_TERMINATED;
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_create_child (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *operation);
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_get_input_proxy (GeglNode *graph,
|
|
Packit Service |
2781ba |
const gchar *name);
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_get_output_proxy (GeglNode *graph,
|
|
Packit Service |
2781ba |
const gchar *name);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
const gchar * gegl_node_get_operation (const GeglNode*node);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
const gchar * gegl_node_get_debug_name (GeglNode *node);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglNode * gegl_node_detect (GeglNode *root,
|
|
Packit Service |
2781ba |
gint x,
|
|
Packit Service |
2781ba |
gint y);
|
|
Packit Service |
2781ba |
void gegl_node_insert_before (GeglNode *self,
|
|
Packit Service |
2781ba |
GeglNode *to_be_inserted);
|
|
Packit Service |
2781ba |
gint gegl_node_get_consumers (GeglNode *node,
|
|
Packit Service |
2781ba |
const gchar *output_pad,
|
|
Packit Service |
2781ba |
GeglNode ***nodes,
|
|
Packit Service |
2781ba |
const gchar ***pads);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
GeglCache * gegl_node_get_cache (GeglNode *node);
|
|
Packit Service |
2781ba |
void gegl_node_invalidated (GeglNode *node,
|
|
Packit Service |
2781ba |
const GeglRectangle *rect,
|
|
Packit Service |
2781ba |
gboolean clean_cache);
|
|
Packit Service |
2781ba |
GeglRectangle gegl_node_get_bounding_box (GeglNode *root);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
const gchar * gegl_node_get_name (GeglNode *self);
|
|
Packit Service |
2781ba |
void gegl_node_set_name (GeglNode *self,
|
|
Packit Service |
2781ba |
const gchar *name);
|
|
Packit Service |
2781ba |
void
|
|
Packit Service |
2781ba |
gegl_node_emit_computed (GeglNode *node,
|
|
Packit Service |
2781ba |
const GeglRectangle *rect);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
/* macros used to set flags on objects passed in the graph */
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#define gegl_object_set_has_forked(object) \
|
|
Packit Service |
2781ba |
g_object_set_data(G_OBJECT(object), "gegl has-forked", (void*)0xf)
|
|
Packit Service |
2781ba |
#define gegl_object_get_has_forked(object) \
|
|
Packit Service |
2781ba |
(g_object_get_data(G_OBJECT(object), "gegl has-forked")!=NULL)
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#define GEGL_MAX_THREADS 16
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
G_END_DECLS
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#endif /* __GEGL_NODE_H__ */
|