Blame gegl/gegl-plugin.h

Packit Service 2781ba
/* This file is the public operation GEGL API, this API will change to much
Packit Service 2781ba
 * larger degrees than the api provided by gegl.h
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
 * 2000-2008 Øyvind Kolås.
Packit Service 2781ba
 */
Packit Service 2781ba
Packit Service 2781ba
#ifndef __GEGL_PLUGIN_H__
Packit Service 2781ba
#define __GEGL_PLUGIN_H__
Packit Service 2781ba
Packit Service 2781ba
#ifdef HAVE_CONFIG_H
Packit Service 2781ba
#include "config.h"
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#include <string.h>
Packit Service 2781ba
#include <glib-object.h>
Packit Service 2781ba
#include <gegl.h>
Packit Service 2781ba
Packit Service 2781ba
G_BEGIN_DECLS
Packit Service 2781ba
Packit Service 2781ba
/* Extra types needed when coding operations */
Packit Service 2781ba
typedef struct _GeglOperation        GeglOperation;
Packit Service 2781ba
typedef struct _GeglOperationContext GeglOperationContext;
Packit Service 2781ba
typedef struct _GeglPad              GeglPad;
Packit Service 2781ba
typedef struct _GeglConnection       GeglConnection;
Packit Service 2781ba
Packit Service 2781ba
#include <gegl-matrix.h>
Packit Service 2781ba
#include <gegl-utils.h>
Packit Service 2781ba
#include <gegl-buffer.h>
Packit Service 2781ba
#include <gegl-paramspecs.h>
Packit Service 2781ba
#include <gmodule.h>
Packit Service 2781ba
Packit Service 2781ba
typedef struct _GeglModule     GeglModule;
Packit Service 2781ba
typedef struct _GeglModuleInfo GeglModuleInfo;
Packit Service 2781ba
typedef struct _GeglModuleDB   GeglModuleDB;
Packit Service 2781ba
Packit Service 2781ba
/***
Packit Service 2781ba
 * Writing GEGL operations
Packit Service 2781ba
 *
Packit Service 2781ba
 */
Packit Service 2781ba
Packit Service 2781ba
/*#include <geglmodule.h>*/
Packit Service 2781ba
Packit Service 2781ba
/*  increment the ABI version each time one of the following changes:
Packit Service 2781ba
 *
Packit Service 2781ba
 *  - the libgeglmodule implementation (if the change affects modules).
Packit Service 2781ba
 *  - GeglOperation or one of it's base classes changes. (XXX:-
Packit Service 2781ba
 *    should be extended so a range of abi versions are accepted.
Packit Service 2781ba
 */
Packit Service 2781ba
Packit Service 2781ba
#define GEGL_MODULE_ABI_VERSION 0x000A
Packit Service 2781ba
Packit Service 2781ba
struct _GeglModuleInfo
Packit Service 2781ba
{
Packit Service 2781ba
  guint32  abi_version;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
GType gegl_module_register_type (GTypeModule     *module,
Packit Service 2781ba
                                 GType            parent_type,
Packit Service 2781ba
                                 const gchar     *type_name,
Packit Service 2781ba
                                 const GTypeInfo *type_info,
Packit Service 2781ba
                                 GTypeFlags       flags);
Packit Service 2781ba
Packit Service 2781ba
gint            gegl_operation_context_get_level  (GeglOperationContext *self);
Packit Service 2781ba
GeglBuffer     *gegl_operation_context_get_source (GeglOperationContext *self,
Packit Service 2781ba
                                                   const gchar          *padname);
Packit Service 2781ba
GeglBuffer     *gegl_operation_context_get_target (GeglOperationContext *self,
Packit Service 2781ba
                                                   const gchar          *padname);
Packit Service 2781ba
void            gegl_operation_context_set_object (GeglOperationContext *context,
Packit Service 2781ba
                                                   const gchar          *padname,
Packit Service 2781ba
                                                   GObject              *data);
Packit Service 2781ba
void            gegl_operation_context_take_object(GeglOperationContext *context,
Packit Service 2781ba
                                                   const gchar          *padname,
Packit Service 2781ba
                                                   GObject              *data);
Packit Service 2781ba
GObject        *gegl_operation_context_get_object (GeglOperationContext *context,
Packit Service 2781ba
                                                   const gchar          *padname);
Packit Service 2781ba
Packit Service 2781ba
void            gegl_extension_handler_register    (const gchar         *extension,
Packit Service 2781ba
                                                    const gchar         *handler);
Packit Service 2781ba
void            gegl_extension_handler_register_saver
Packit Service 2781ba
                                                   (const gchar         *extension,
Packit Service 2781ba
                                                    const gchar         *handler);
Packit Service 2781ba
const gchar   * gegl_extension_handler_get         (const gchar         *extension);
Packit Service 2781ba
const gchar   * gegl_extension_handler_get_saver   (const gchar         *extension);
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
/* code template utility, updates the jacobian matrix using
Packit Service 2781ba
 * a user defined mapping function for displacement, example
Packit Service 2781ba
 * with an identity transform (note that for the identity
Packit Service 2781ba
 * transform this is massive computational overhead that can
Packit Service 2781ba
 * be skipped by passing NULL to the sampler.
Packit Service 2781ba
 *
Packit Service 2781ba
 * #define gegl_unmap(x,y,dx,dy) { dx=x; dy=y; }
Packit Service 2781ba
 *
Packit Service 2781ba
 * gegl_sampler_compute_scale (scale, x, y);
Packit Service 2781ba
 * gegl_unmap(x,y,sample_x,sample_y);
Packit Service 2781ba
 * gegl_buffer_sample (buffer, sample_x, sample_y, scale, dest, format,
Packit Service 2781ba
 *                     GEGL_SAMPLER_LOHALO);
Packit Service 2781ba
 *
Packit Service 2781ba
 * #undef gegl_unmap      // IMPORTANT undefine map macro
Packit Service 2781ba
 */
Packit Service 2781ba
#define gegl_sampler_compute_scale(matrix, x, y) \
Packit Service 2781ba
{                                       \
Packit Service 2781ba
  float ax, ay, bx, by;                 \
Packit Service 2781ba
  gegl_unmap(x + 0.5, y, ax, ay);       \
Packit Service 2781ba
  gegl_unmap(x - 0.5, y, bx, by);       \
Packit Service 2781ba
  matrix.coeff[0][0] = ax - bx;         \
Packit Service 2781ba
  matrix.coeff[1][0] = ay - by;         \
Packit Service 2781ba
  gegl_unmap(x, y + 0.5, ax, ay);       \
Packit Service 2781ba
  gegl_unmap(x, y - 0.5, bx, by);       \
Packit Service 2781ba
  matrix.coeff[0][1] = ax - bx;         \
Packit Service 2781ba
  matrix.coeff[1][1] = ay - by;         \
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GObject       parent_instance;
Packit Service 2781ba
  void (* get) (GeglSampler *self,
Packit Service 2781ba
                gdouble      x,
Packit Service 2781ba
                gdouble      y,
Packit Service 2781ba
                GeglMatrix2 *scale,
Packit Service 2781ba
                void        *output);
Packit Service 2781ba
} SamplerMock;
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#define gegl_sampler_get(sampler,x,y,scale,dest) \
Packit Service 2781ba
  ((SamplerMock*)(sampler))->get((sampler),(x),(y),(scale),(dest))
Packit Service 2781ba
Packit Service 2781ba
#include <glib-object.h>
Packit Service 2781ba
#include <babl/babl.h>
Packit Service 2781ba
#include <operation/gegl-operation.h>
Packit Service 2781ba
#include <operation/gegl-operation-filter.h>
Packit Service 2781ba
#include <operation/gegl-operation-area-filter.h>
Packit Service 2781ba
#include <operation/gegl-operation-point-filter.h>
Packit Service 2781ba
#include <operation/gegl-operation-composer.h>
Packit Service 2781ba
#include <operation/gegl-operation-composer3.h>
Packit Service 2781ba
#include <operation/gegl-operation-point-composer.h>
Packit Service 2781ba
#include <operation/gegl-operation-point-composer3.h>
Packit Service 2781ba
#include <operation/gegl-operation-point-render.h>
Packit Service 2781ba
#include <operation/gegl-operation-temporal.h>
Packit Service 2781ba
#include <operation/gegl-operation-source.h>
Packit Service 2781ba
#include <operation/gegl-operation-sink.h>
Packit Service 2781ba
#include <operation/gegl-operation-meta.h>
Packit Service 2781ba
Packit Service 2781ba
#include <gegl-lookup.h>
Packit Service 2781ba
Packit Service 2781ba
G_END_DECLS
Packit Service 2781ba
#endif  /* __GEGL_PLUGIN_H__ */