1 /* This file is part of GEGL 2 * 3 * GEGL is free software; you can redistribute it and/or 4 * modify it under the terms of the GNU Lesser General Public 5 * License as published by the Free Software Foundation; either 6 * version 3 of the License, or (at your option) any later version. 7 * 8 * GEGL is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public 14 * License along with GEGL; if not, see <https://www.gnu.org/licenses/>. 15 * 16 * Copyright 2003 Calvin Williamson 17 * Copyright 2013 Daniel Sabo 18 */ 19 20 #ifndef __GEGL_EVAL_MANAGER_H__ 21 #define __GEGL_EVAL_MANAGER_H__ 22 23 #include "gegl-types-internal.h" 24 #include "buffer/gegl-buffer-types.h" 25 #include "process/gegl-graph-traversal.h" 26 27 G_BEGIN_DECLS 28 29 30 typedef enum 31 { 32 INVALID, 33 READY 34 } GeglEvalManagerStates; 35 36 37 #define GEGL_TYPE_EVAL_MANAGER (gegl_eval_manager_get_type ()) 38 #define GEGL_EVAL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_EVAL_MANAGER, GeglEvalManager)) 39 #define GEGL_EVAL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEGL_TYPE_EVAL_MANAGER, GeglEvalManagerClass)) 40 #define GEGL_IS_EVAL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_EVAL_MANAGER)) 41 #define GEGL_IS_EVAL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_EVAL_MANAGER)) 42 #define GEGL_EVAL_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEGL_TYPE_EVAL_MANAGER, GeglEvalManagerClass)) 43 44 45 typedef struct _GeglEvalManagerClass GeglEvalManagerClass; 46 47 struct _GeglEvalManager 48 { 49 GObject parent_instance; 50 GeglNode *node; 51 gchar *pad_name; 52 53 GeglGraphTraversal *traversal; 54 GeglEvalManagerStates state; 55 56 }; 57 58 struct _GeglEvalManagerClass 59 { 60 GObjectClass parent_class; 61 }; 62 63 64 GType gegl_eval_manager_get_type (void) G_GNUC_CONST; 65 66 void gegl_eval_manager_prepare (GeglEvalManager *self); 67 GeglRectangle gegl_eval_manager_get_bounding_box (GeglEvalManager *self); 68 69 GeglBuffer * gegl_eval_manager_apply (GeglEvalManager *self, 70 const GeglRectangle *roi, 71 gint level); 72 GeglEvalManager * gegl_eval_manager_new (GeglNode *node, 73 const gchar *pad_name); 74 75 G_END_DECLS 76 77 #endif /* __GEGL_EVAL_MANAGER_H__ */ 78