2012-05-26 18:36:00 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpapplicator.h
|
2013-04-15 04:44:21 +08:00
|
|
|
* Copyright (C) 2012-2013 Michael Natterer <mitch@gimp.org>
|
2012-05-26 18:36:00 +08:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2012-05-26 18:36:00 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_APPLICATOR_H__
|
|
|
|
#define __GIMP_APPLICATOR_H__
|
|
|
|
|
|
|
|
|
|
|
|
#define GIMP_TYPE_APPLICATOR (gimp_applicator_get_type ())
|
|
|
|
#define GIMP_APPLICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_APPLICATOR, GimpApplicator))
|
|
|
|
#define GIMP_APPLICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_APPLICATOR, GimpApplicatorClass))
|
|
|
|
#define GIMP_IS_APPLICATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_APPLICATOR))
|
|
|
|
#define GIMP_IS_APPLICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_APPLICATOR))
|
|
|
|
#define GIMP_APPLICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_APPLICATOR, GimpApplicatorClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpApplicatorClass GimpApplicatorClass;
|
|
|
|
|
|
|
|
struct _GimpApplicator
|
|
|
|
{
|
2017-02-02 07:38:25 +08:00
|
|
|
GObject parent_instance;
|
2012-12-09 02:31:05 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
GeglNode *node;
|
|
|
|
GeglNode *input_node;
|
|
|
|
GeglNode *aux_node;
|
|
|
|
GeglNode *output_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2020-04-02 23:46:41 +08:00
|
|
|
gboolean active;
|
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
GeglBuffer *apply_buffer;
|
|
|
|
GeglNode *apply_src_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
gint apply_offset_x;
|
|
|
|
gint apply_offset_y;
|
|
|
|
GeglNode *apply_offset_node;
|
2012-12-09 02:31:05 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
gdouble opacity;
|
|
|
|
GimpLayerMode paint_mode;
|
2017-02-13 06:49:26 +08:00
|
|
|
GimpLayerColorSpace blend_space;
|
|
|
|
GimpLayerColorSpace composite_space;
|
2017-02-02 07:38:25 +08:00
|
|
|
GimpLayerCompositeMode composite_mode;
|
|
|
|
GeglNode *mode_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
GimpComponentMask affect;
|
|
|
|
GeglNode *affect_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2018-12-28 15:09:11 +08:00
|
|
|
const Babl *output_format;
|
2018-12-30 03:12:51 +08:00
|
|
|
GeglNode *convert_format_node;
|
2018-12-28 15:09:11 +08:00
|
|
|
|
2018-12-30 03:12:51 +08:00
|
|
|
gboolean cache_enabled;
|
|
|
|
GeglNode *cache_node;
|
|
|
|
|
2018-12-30 16:33:56 +08:00
|
|
|
gboolean crop_enabled;
|
|
|
|
GeglRectangle crop_rect;
|
|
|
|
GeglNode *crop_node;
|
2014-06-19 00:50:53 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
GeglBuffer *src_buffer;
|
|
|
|
GeglNode *src_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
GeglBuffer *dest_buffer;
|
|
|
|
GeglNode *dest_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
GeglBuffer *mask_buffer;
|
|
|
|
GeglNode *mask_node;
|
2013-04-15 04:44:21 +08:00
|
|
|
|
2017-02-02 07:38:25 +08:00
|
|
|
gint mask_offset_x;
|
|
|
|
gint mask_offset_y;
|
|
|
|
GeglNode *mask_offset_node;
|
2012-05-26 18:36:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpApplicatorClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-12-28 15:09:11 +08:00
|
|
|
GType gimp_applicator_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2018-12-30 03:12:51 +08:00
|
|
|
GimpApplicator * gimp_applicator_new (GeglNode *parent);
|
2018-12-28 15:09:11 +08:00
|
|
|
|
2020-04-02 23:46:41 +08:00
|
|
|
void gimp_applicator_set_active (GimpApplicator *applicator,
|
|
|
|
gboolean active);
|
|
|
|
|
2018-12-28 15:09:11 +08:00
|
|
|
void gimp_applicator_set_src_buffer (GimpApplicator *applicator,
|
|
|
|
GeglBuffer *dest_buffer);
|
|
|
|
void gimp_applicator_set_dest_buffer (GimpApplicator *applicator,
|
|
|
|
GeglBuffer *dest_buffer);
|
|
|
|
|
|
|
|
void gimp_applicator_set_mask_buffer (GimpApplicator *applicator,
|
|
|
|
GeglBuffer *mask_buffer);
|
|
|
|
void gimp_applicator_set_mask_offset (GimpApplicator *applicator,
|
|
|
|
gint mask_offset_x,
|
|
|
|
gint mask_offset_y);
|
|
|
|
|
|
|
|
void gimp_applicator_set_apply_buffer (GimpApplicator *applicator,
|
|
|
|
GeglBuffer *apply_buffer);
|
|
|
|
void gimp_applicator_set_apply_offset (GimpApplicator *applicator,
|
|
|
|
gint apply_offset_x,
|
|
|
|
gint apply_offset_y);
|
|
|
|
|
|
|
|
void gimp_applicator_set_opacity (GimpApplicator *applicator,
|
|
|
|
gdouble opacity);
|
|
|
|
void gimp_applicator_set_mode (GimpApplicator *applicator,
|
|
|
|
GimpLayerMode paint_mode,
|
|
|
|
GimpLayerColorSpace blend_space,
|
|
|
|
GimpLayerColorSpace composite_space,
|
|
|
|
GimpLayerCompositeMode composite_mode);
|
|
|
|
void gimp_applicator_set_affect (GimpApplicator *applicator,
|
|
|
|
GimpComponentMask affect);
|
|
|
|
|
|
|
|
void gimp_applicator_set_output_format (GimpApplicator *applicator,
|
|
|
|
const Babl *format);
|
2019-03-25 20:58:03 +08:00
|
|
|
const Babl * gimp_applicator_get_output_format (GimpApplicator *applicator);
|
2018-12-28 15:09:11 +08:00
|
|
|
|
2018-12-30 03:12:51 +08:00
|
|
|
void gimp_applicator_set_cache (GimpApplicator *applicator,
|
|
|
|
gboolean enable);
|
2019-03-25 20:58:03 +08:00
|
|
|
gboolean gimp_applicator_get_cache (GimpApplicator *applicator);
|
2018-12-30 03:12:51 +08:00
|
|
|
GeglBuffer * gimp_applicator_get_cache_buffer (GimpApplicator *applicator,
|
|
|
|
GeglRectangle **rectangles,
|
|
|
|
gint *n_rectangles);
|
|
|
|
|
2018-12-30 16:33:56 +08:00
|
|
|
void gimp_applicator_set_crop (GimpApplicator *applicator,
|
2018-12-28 15:09:11 +08:00
|
|
|
const GeglRectangle *rect);
|
2018-12-30 16:33:56 +08:00
|
|
|
const GeglRectangle * gimp_applicator_get_crop (GimpApplicator *applicator);
|
2018-12-28 15:09:11 +08:00
|
|
|
|
|
|
|
void gimp_applicator_blit (GimpApplicator *applicator,
|
|
|
|
const GeglRectangle *rect);
|
|
|
|
|
2012-05-26 18:36:00 +08:00
|
|
|
|
|
|
|
#endif /* __GIMP_APPLICATOR_H__ */
|