Blame gegl/buffer/gegl-tile-handler.h

Packit Service 2781ba
/* This file is part of GEGL.
Packit Service 2781ba
 *
Packit Service 2781ba
 * This library 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
 * This library 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 this library; if not, see <http://www.gnu.org/licenses/>.
Packit Service 2781ba
 *
Packit Service 2781ba
 * Copyright 2006,2007 Øyvind Kolås <pippin@gimp.org>
Packit Service 2781ba
 */
Packit Service 2781ba
Packit Service 2781ba
#ifndef __GEGL_TILE_HANDLER_H__
Packit Service 2781ba
#define __GEGL_TILE_HANDLER_H__
Packit Service 2781ba
Packit Service 2781ba
#include "gegl-tile-source.h"
Packit Service 2781ba
Packit Service 2781ba
/***
Packit Service 2781ba
 * GeglTileHandler define the chain pattern that allow to stack GeglTileSource classes on
Packit Service 2781ba
 * top of each others, each doing different task in response to command given (see GeglTileSource).
Packit Service 2781ba
 *
Packit Service 2781ba
 * A classical GeglBuffer is a stack of subclasses of GeglTileHandler with a GeglTileBackend on
Packit Service 2781ba
 * the bottom. This architecture is designed to be modular and flexible on purpose, even allowing
Packit Service 2781ba
 * to use a GeglBuffer as a source for another GeglBuffer.
Packit Service 2781ba
 */
Packit Service 2781ba
Packit Service 2781ba
G_BEGIN_DECLS
Packit Service 2781ba
Packit Service 2781ba
#define GEGL_TYPE_TILE_HANDLER            (gegl_tile_handler_get_type ())
Packit Service 2781ba
#define GEGL_TILE_HANDLER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_TILE_HANDLER, GeglTileHandler))
Packit Service 2781ba
#define GEGL_TILE_HANDLER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_TILE_HANDLER, GeglTileHandlerClass))
Packit Service 2781ba
#define GEGL_IS_TILE_HANDLER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_TILE_HANDLER))
Packit Service 2781ba
#define GEGL_IS_TILE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_TILE_HANDLER))
Packit Service 2781ba
#define GEGL_TILE_HANDLER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_TILE_HANDLER, GeglTileHandlerClass))
Packit Service 2781ba
Packit Service 2781ba
struct _GeglTileHandler
Packit Service 2781ba
{
Packit Service 2781ba
  GeglTileSource  parent_instance;
Packit Service 2781ba
  GeglTileSource *source; /* The source of the data, which we can rely on if
Packit Service 2781ba
                             our command handler doesn't handle a command, this
Packit Service 2781ba
                             is typically done with gegl_tile_handler_source_command
Packit Service 2781ba
                             passing ourself as the first parameter. */
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
struct _GeglTileHandlerClass
Packit Service 2781ba
{
Packit Service 2781ba
  GeglTileSourceClass parent_class;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
GType gegl_tile_handler_get_type (void) G_GNUC_CONST;
Packit Service 2781ba
Packit Service 2781ba
void
Packit Service 2781ba
gegl_tile_handler_set_source (GeglTileHandler *handler,
Packit Service 2781ba
                              GeglTileSource  *source);
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#define gegl_tile_handler_get_source(handler)  (((GeglTileHandler*)handler)->source)
Packit Service 2781ba
Packit Service 2781ba
#define gegl_tile_handler_source_command(handler,command,x,y,z,data) (gegl_tile_handler_get_source(handler)?gegl_tile_source_command(gegl_tile_handler_get_source(handler), command, x, y, z, data):NULL)
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
G_END_DECLS
Packit Service 2781ba
Packit Service 2781ba
#endif