|
Packit |
bc1512 |
/* This file is the public operation GEGL API, this API will change to much
|
|
Packit |
bc1512 |
* larger degrees than the api provided by gegl.h
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* GEGL is free software; you can redistribute it and/or
|
|
Packit |
bc1512 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
bc1512 |
* License as published by the Free Software Foundation; either
|
|
Packit |
bc1512 |
* version 3 of the License, or (at your option) any later version.
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* GEGL is distributed in the hope that it will be useful,
|
|
Packit |
bc1512 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
bc1512 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
bc1512 |
* Lesser General Public License for more details.
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
bc1512 |
* License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* 2000-2008 Øyvind Kolås.
|
|
Packit |
bc1512 |
*/
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#ifndef __GEGL_PLUGIN_H__
|
|
Packit |
bc1512 |
#define __GEGL_PLUGIN_H__
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#ifdef HAVE_CONFIG_H
|
|
Packit |
bc1512 |
#include "config.h"
|
|
Packit |
bc1512 |
#endif
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#include <string.h>
|
|
Packit |
bc1512 |
#include <glib-object.h>
|
|
Packit |
bc1512 |
#include <gegl.h>
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
G_BEGIN_DECLS
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
/* Extra types needed when coding operations */
|
|
Packit |
bc1512 |
typedef struct _GeglOperation GeglOperation;
|
|
Packit |
bc1512 |
typedef struct _GeglOperationContext GeglOperationContext;
|
|
Packit |
bc1512 |
typedef struct _GeglPad GeglPad;
|
|
Packit |
bc1512 |
typedef struct _GeglConnection GeglConnection;
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#include <gegl-matrix.h>
|
|
Packit |
bc1512 |
#include <gegl-utils.h>
|
|
Packit |
bc1512 |
#include <gegl-buffer.h>
|
|
Packit |
bc1512 |
#include <gegl-paramspecs.h>
|
|
Packit |
bc1512 |
#include <gmodule.h>
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
typedef struct _GeglModule GeglModule;
|
|
Packit |
bc1512 |
typedef struct _GeglModuleInfo GeglModuleInfo;
|
|
Packit |
bc1512 |
typedef struct _GeglModuleDB GeglModuleDB;
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
/***
|
|
Packit |
bc1512 |
* Writing GEGL operations
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
*/
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
/*#include <geglmodule.h>*/
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
/* increment the ABI version each time one of the following changes:
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* - the libgeglmodule implementation (if the change affects modules).
|
|
Packit |
bc1512 |
* - GeglOperation or one of it's base classes changes. (XXX:-
|
|
Packit |
bc1512 |
* should be extended so a range of abi versions are accepted.
|
|
Packit |
bc1512 |
*/
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#define GEGL_MODULE_ABI_VERSION 0x000A
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
struct _GeglModuleInfo
|
|
Packit |
bc1512 |
{
|
|
Packit |
bc1512 |
guint32 abi_version;
|
|
Packit |
bc1512 |
};
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
GType gegl_module_register_type (GTypeModule *module,
|
|
Packit |
bc1512 |
GType parent_type,
|
|
Packit |
bc1512 |
const gchar *type_name,
|
|
Packit |
bc1512 |
const GTypeInfo *type_info,
|
|
Packit |
bc1512 |
GTypeFlags flags);
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
gint gegl_operation_context_get_level (GeglOperationContext *self);
|
|
Packit |
bc1512 |
GeglBuffer *gegl_operation_context_get_source (GeglOperationContext *self,
|
|
Packit |
bc1512 |
const gchar *padname);
|
|
Packit |
bc1512 |
GeglBuffer *gegl_operation_context_get_target (GeglOperationContext *self,
|
|
Packit |
bc1512 |
const gchar *padname);
|
|
Packit |
bc1512 |
void gegl_operation_context_set_object (GeglOperationContext *context,
|
|
Packit |
bc1512 |
const gchar *padname,
|
|
Packit |
bc1512 |
GObject *data);
|
|
Packit |
bc1512 |
void gegl_operation_context_take_object(GeglOperationContext *context,
|
|
Packit |
bc1512 |
const gchar *padname,
|
|
Packit |
bc1512 |
GObject *data);
|
|
Packit |
bc1512 |
GObject *gegl_operation_context_get_object (GeglOperationContext *context,
|
|
Packit |
bc1512 |
const gchar *padname);
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
void gegl_extension_handler_register (const gchar *extension,
|
|
Packit |
bc1512 |
const gchar *handler);
|
|
Packit |
bc1512 |
void gegl_extension_handler_register_saver
|
|
Packit |
bc1512 |
(const gchar *extension,
|
|
Packit |
bc1512 |
const gchar *handler);
|
|
Packit |
bc1512 |
const gchar * gegl_extension_handler_get (const gchar *extension);
|
|
Packit |
bc1512 |
const gchar * gegl_extension_handler_get_saver (const gchar *extension);
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
/* code template utility, updates the jacobian matrix using
|
|
Packit |
bc1512 |
* a user defined mapping function for displacement, example
|
|
Packit |
bc1512 |
* with an identity transform (note that for the identity
|
|
Packit |
bc1512 |
* transform this is massive computational overhead that can
|
|
Packit |
bc1512 |
* be skipped by passing NULL to the sampler.
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* #define gegl_unmap(x,y,dx,dy) { dx=x; dy=y; }
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* gegl_sampler_compute_scale (scale, x, y);
|
|
Packit |
bc1512 |
* gegl_unmap(x,y,sample_x,sample_y);
|
|
Packit |
bc1512 |
* gegl_buffer_sample (buffer, sample_x, sample_y, scale, dest, format,
|
|
Packit |
bc1512 |
* GEGL_SAMPLER_LOHALO);
|
|
Packit |
bc1512 |
*
|
|
Packit |
bc1512 |
* #undef gegl_unmap // IMPORTANT undefine map macro
|
|
Packit |
bc1512 |
*/
|
|
Packit |
bc1512 |
#define gegl_sampler_compute_scale(matrix, x, y) \
|
|
Packit |
bc1512 |
{ \
|
|
Packit |
bc1512 |
float ax, ay, bx, by; \
|
|
Packit |
bc1512 |
gegl_unmap(x + 0.5, y, ax, ay); \
|
|
Packit |
bc1512 |
gegl_unmap(x - 0.5, y, bx, by); \
|
|
Packit |
bc1512 |
matrix.coeff[0][0] = ax - bx; \
|
|
Packit |
bc1512 |
matrix.coeff[1][0] = ay - by; \
|
|
Packit |
bc1512 |
gegl_unmap(x, y + 0.5, ax, ay); \
|
|
Packit |
bc1512 |
gegl_unmap(x, y - 0.5, bx, by); \
|
|
Packit |
bc1512 |
matrix.coeff[0][1] = ax - bx; \
|
|
Packit |
bc1512 |
matrix.coeff[1][1] = ay - by; \
|
|
Packit |
bc1512 |
}
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
typedef struct
|
|
Packit |
bc1512 |
{
|
|
Packit |
bc1512 |
GObject parent_instance;
|
|
Packit |
bc1512 |
void (* get) (GeglSampler *self,
|
|
Packit |
bc1512 |
gdouble x,
|
|
Packit |
bc1512 |
gdouble y,
|
|
Packit |
bc1512 |
GeglMatrix2 *scale,
|
|
Packit |
bc1512 |
void *output);
|
|
Packit |
bc1512 |
} SamplerMock;
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#define gegl_sampler_get(sampler,x,y,scale,dest) \
|
|
Packit |
bc1512 |
((SamplerMock*)(sampler))->get((sampler),(x),(y),(scale),(dest))
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#include <glib-object.h>
|
|
Packit |
bc1512 |
#include <babl/babl.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-filter.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-area-filter.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-point-filter.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-composer.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-composer3.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-point-composer.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-point-composer3.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-point-render.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-temporal.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-source.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-sink.h>
|
|
Packit |
bc1512 |
#include <operation/gegl-operation-meta.h>
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
#include <gegl-lookup.h>
|
|
Packit |
bc1512 |
|
|
Packit |
bc1512 |
G_END_DECLS
|
|
Packit |
bc1512 |
#endif /* __GEGL_PLUGIN_H__ */
|