2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-07-14 07:04:05 +08:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimppickable.h
|
|
|
|
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2004-07-14 07:04:05 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-07-14 07:04:05 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2004-07-14 07:04:05 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_PICKABLE_H__
|
|
|
|
#define __GIMP_PICKABLE_H__
|
|
|
|
|
|
|
|
|
|
|
|
#define GIMP_TYPE_PICKABLE (gimp_pickable_interface_get_type ())
|
|
|
|
#define GIMP_IS_PICKABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PICKABLE))
|
|
|
|
#define GIMP_PICKABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PICKABLE, GimpPickable))
|
|
|
|
#define GIMP_PICKABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_PICKABLE, GimpPickableInterface))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpPickableInterface GimpPickableInterface;
|
|
|
|
|
|
|
|
struct _GimpPickableInterface
|
|
|
|
{
|
|
|
|
GTypeInterface base_iface;
|
|
|
|
|
|
|
|
/* virtual functions */
|
2012-03-18 23:20:01 +08:00
|
|
|
void (* flush) (GimpPickable *pickable);
|
|
|
|
GimpImage * (* get_image) (GimpPickable *pickable);
|
|
|
|
const Babl * (* get_format) (GimpPickable *pickable);
|
|
|
|
const Babl * (* get_format_with_alpha) (GimpPickable *pickable);
|
|
|
|
GeglBuffer * (* get_buffer) (GimpPickable *pickable);
|
|
|
|
gboolean (* get_pixel_at) (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2012-04-21 16:03:32 +08:00
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel);
|
2012-04-21 22:05:49 +08:00
|
|
|
gdouble (* get_opacity_at) (GimpPickable *pickable,
|
2012-03-18 23:20:01 +08:00
|
|
|
gint x,
|
|
|
|
gint y);
|
2004-07-14 07:04:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-03-18 23:20:01 +08:00
|
|
|
GType gimp_pickable_interface_get_type (void) G_GNUC_CONST;
|
2004-07-14 07:04:05 +08:00
|
|
|
|
2012-03-18 23:20:01 +08:00
|
|
|
void gimp_pickable_flush (GimpPickable *pickable);
|
|
|
|
GimpImage * gimp_pickable_get_image (GimpPickable *pickable);
|
|
|
|
const Babl * gimp_pickable_get_format (GimpPickable *pickable);
|
|
|
|
const Babl * gimp_pickable_get_format_with_alpha (GimpPickable *pickable);
|
|
|
|
GeglBuffer * gimp_pickable_get_buffer (GimpPickable *pickable);
|
|
|
|
gboolean gimp_pickable_get_pixel_at (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2012-04-21 16:03:32 +08:00
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel);
|
2012-03-18 23:20:01 +08:00
|
|
|
gboolean gimp_pickable_get_color_at (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GimpRGB *color);
|
2012-04-21 22:05:49 +08:00
|
|
|
gdouble gimp_pickable_get_opacity_at (GimpPickable *pickable,
|
2012-03-18 23:20:01 +08:00
|
|
|
gint x,
|
|
|
|
gint y);
|
2004-07-14 07:04:05 +08:00
|
|
|
|
2012-03-18 23:20:01 +08:00
|
|
|
gboolean gimp_pickable_pick_color (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gboolean sample_average,
|
|
|
|
gdouble average_radius,
|
|
|
|
GimpRGB *color,
|
|
|
|
gint *color_index);
|
2004-07-14 07:04:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GIMP_PICKABLE_H__ */
|