2006-12-09 21:33:38 +00:00
|
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-02-04 17:34:30 +00:00
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-02-04 17:34:30 +00:00
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-02-04 17:34:30 +00: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
|
2018-07-11 23:27:07 +02:00
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-02-04 17:34:30 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2013-10-15 01:58:39 +02:00
|
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2012-03-17 21:59:10 +01:00
|
|
|
|
#include <gegl.h>
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
2003-10-16 12:24:58 +00:00
|
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
|
2001-05-09 22:34:59 +00:00
|
|
|
|
#include "core-types.h"
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
2018-05-24 10:21:21 -04:00
|
|
|
|
#include "gegl/gimp-gegl-loops.h"
|
|
|
|
|
|
2001-02-04 17:34:30 +00:00
|
|
|
|
#include "gimppattern.h"
|
2006-10-03 11:37:37 +00:00
|
|
|
|
#include "gimppattern-load.h"
|
2019-02-11 20:56:07 +01:00
|
|
|
|
#include "gimppattern-save.h"
|
2008-12-13 11:58:24 +00:00
|
|
|
|
#include "gimptagged.h"
|
2012-04-09 00:59:20 +02:00
|
|
|
|
#include "gimptempbuf.h"
|
2001-05-09 22:34:59 +00:00
|
|
|
|
|
2003-03-25 16:38:19 +00:00
|
|
|
|
#include "gimp-intl.h"
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static void gimp_pattern_tagged_iface_init (GimpTaggedInterface *iface);
|
|
|
|
|
static void gimp_pattern_finalize (GObject *object);
|
2001-08-11 14:39:19 +00:00
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static gint64 gimp_pattern_get_memsize (GimpObject *object,
|
|
|
|
|
gint64 *gui_size);
|
2001-08-11 14:39:19 +00:00
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static gboolean gimp_pattern_get_size (GimpViewable *viewable,
|
|
|
|
|
gint *width,
|
|
|
|
|
gint *height);
|
2012-04-08 20:25:49 +02:00
|
|
|
|
static GimpTempBuf * gimp_pattern_get_new_preview (GimpViewable *viewable,
|
2008-12-13 11:58:24 +00:00
|
|
|
|
GimpContext *context,
|
|
|
|
|
gint width,
|
2025-04-22 20:33:49 +02:00
|
|
|
|
gint height,
|
2025-08-18 08:08:12 +02:00
|
|
|
|
GeglColor *fg_color);
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static gchar * gimp_pattern_get_description (GimpViewable *viewable,
|
|
|
|
|
gchar **tooltip);
|
2008-09-12 10:35:35 +00:00
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static const gchar * gimp_pattern_get_extension (GimpData *data);
|
2017-11-04 21:21:12 -04:00
|
|
|
|
static void gimp_pattern_copy (GimpData *data,
|
|
|
|
|
GimpData *src_data);
|
2002-01-30 16:14:26 +00:00
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static gchar * gimp_pattern_get_checksum (GimpTagged *tagged);
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GimpPattern, gimp_pattern, GIMP_TYPE_DATA,
|
|
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_TAGGED,
|
|
|
|
|
gimp_pattern_tagged_iface_init))
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
2005-12-10 19:24:36 +00:00
|
|
|
|
#define parent_class gimp_pattern_parent_class
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gimp_pattern_class_init (GimpPatternClass *klass)
|
|
|
|
|
{
|
2005-07-23 22:22:45 +00:00
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
|
|
|
|
|
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
|
|
|
|
|
GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
|
2001-02-05 15:22:20 +00:00
|
|
|
|
|
2014-05-07 01:01:56 +02:00
|
|
|
|
object_class->finalize = gimp_pattern_finalize;
|
2001-02-05 15:22:20 +00:00
|
|
|
|
|
2014-05-07 01:01:56 +02:00
|
|
|
|
gimp_object_class->get_memsize = gimp_pattern_get_memsize;
|
2002-01-30 16:14:26 +00:00
|
|
|
|
|
2014-05-07 01:01:56 +02:00
|
|
|
|
viewable_class->default_icon_name = "gimp-tool-bucket-fill";
|
2025-07-16 17:22:11 +02:00
|
|
|
|
viewable_class->default_name = _("Pattern");
|
2014-05-07 01:01:56 +02:00
|
|
|
|
viewable_class->get_size = gimp_pattern_get_size;
|
|
|
|
|
viewable_class->get_new_preview = gimp_pattern_get_new_preview;
|
|
|
|
|
viewable_class->get_description = gimp_pattern_get_description;
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
2019-02-11 20:56:07 +01:00
|
|
|
|
data_class->save = gimp_pattern_save;
|
2014-05-07 01:01:56 +02:00
|
|
|
|
data_class->get_extension = gimp_pattern_get_extension;
|
2017-11-04 21:21:12 -04:00
|
|
|
|
data_class->copy = gimp_pattern_copy;
|
2001-02-04 17:34:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static void
|
|
|
|
|
gimp_pattern_tagged_iface_init (GimpTaggedInterface *iface)
|
|
|
|
|
{
|
|
|
|
|
iface->get_checksum = gimp_pattern_get_checksum;
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-04 17:34:30 +00:00
|
|
|
|
static void
|
|
|
|
|
gimp_pattern_init (GimpPattern *pattern)
|
|
|
|
|
{
|
2001-02-11 01:39:24 +00:00
|
|
|
|
pattern->mask = NULL;
|
2001-02-04 17:34:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-08-11 14:39:19 +00:00
|
|
|
|
gimp_pattern_finalize (GObject *object)
|
2001-02-04 17:34:30 +00:00
|
|
|
|
{
|
2003-11-16 17:51:36 +00:00
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (object);
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
2017-07-15 18:38:01 +02:00
|
|
|
|
g_clear_pointer (&pattern->mask, gimp_temp_buf_unref);
|
2001-02-04 17:34:30 +00:00
|
|
|
|
|
2001-08-11 14:39:19 +00:00
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-02-04 17:34:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-11-16 17:51:36 +00:00
|
|
|
|
static gint64
|
2003-08-25 10:49:33 +00:00
|
|
|
|
gimp_pattern_get_memsize (GimpObject *object,
|
2003-11-16 17:51:36 +00:00
|
|
|
|
gint64 *gui_size)
|
2002-01-30 16:14:26 +00:00
|
|
|
|
{
|
2004-01-29 16:19:57 +00:00
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (object);
|
2003-11-16 17:51:36 +00:00
|
|
|
|
gint64 memsize = 0;
|
2002-01-30 16:14:26 +00:00
|
|
|
|
|
2012-04-08 23:56:52 +02:00
|
|
|
|
memsize += gimp_temp_buf_get_memsize (pattern->mask);
|
2002-01-30 16:14:26 +00:00
|
|
|
|
|
2003-08-25 10:49:33 +00:00
|
|
|
|
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
|
|
|
|
|
gui_size);
|
2002-01-30 16:14:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-02-27 13:59:41 +00:00
|
|
|
|
static gboolean
|
2005-05-25 10:05:17 +00:00
|
|
|
|
gimp_pattern_get_size (GimpViewable *viewable,
|
|
|
|
|
gint *width,
|
|
|
|
|
gint *height)
|
2003-02-27 13:59:41 +00:00
|
|
|
|
{
|
2003-11-16 17:51:36 +00:00
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (viewable);
|
2003-02-27 13:59:41 +00:00
|
|
|
|
|
2012-04-23 09:40:56 +02:00
|
|
|
|
*width = gimp_temp_buf_get_width (pattern->mask);
|
|
|
|
|
*height = gimp_temp_buf_get_height (pattern->mask);
|
2003-02-27 13:59:41 +00:00
|
|
|
|
|
2005-05-25 10:05:17 +00:00
|
|
|
|
return TRUE;
|
2003-02-27 13:59:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-04-08 20:25:49 +02:00
|
|
|
|
static GimpTempBuf *
|
2001-02-07 00:06:58 +00:00
|
|
|
|
gimp_pattern_get_new_preview (GimpViewable *viewable,
|
2006-08-29 21:44:51 +00:00
|
|
|
|
GimpContext *context,
|
2005-07-23 22:22:45 +00:00
|
|
|
|
gint width,
|
2025-04-22 20:33:49 +02:00
|
|
|
|
gint height,
|
2025-08-18 08:08:12 +02:00
|
|
|
|
GeglColor *fg_color G_GNUC_UNUSED)
|
2001-02-05 15:22:20 +00:00
|
|
|
|
{
|
2024-01-13 13:15:56 +00:00
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (viewable);
|
2012-04-08 20:25:49 +02:00
|
|
|
|
GimpTempBuf *temp_buf;
|
2012-04-08 00:46:33 +02:00
|
|
|
|
GeglBuffer *src_buffer;
|
2023-05-17 03:38:29 +00:00
|
|
|
|
gint true_width;
|
|
|
|
|
gint true_height;
|
2001-02-05 21:52:57 +00:00
|
|
|
|
gint copy_width;
|
|
|
|
|
gint copy_height;
|
2024-01-13 13:15:56 +00:00
|
|
|
|
gboolean has_temp_buf = FALSE;
|
2001-02-05 15:22:20 +00:00
|
|
|
|
|
2023-05-17 03:38:29 +00:00
|
|
|
|
true_width = gimp_temp_buf_get_width (pattern->mask);
|
|
|
|
|
true_height = gimp_temp_buf_get_height (pattern->mask);
|
|
|
|
|
copy_width = MIN (width, true_width);
|
|
|
|
|
copy_height = MIN (height, true_height);
|
2001-02-05 21:52:57 +00:00
|
|
|
|
|
2023-05-17 03:38:29 +00:00
|
|
|
|
src_buffer = gimp_temp_buf_create_buffer (pattern->mask);
|
2001-02-05 21:52:57 +00:00
|
|
|
|
|
2023-05-17 03:38:29 +00:00
|
|
|
|
if (true_width > width || true_height > height)
|
|
|
|
|
{
|
|
|
|
|
gdouble ratio_x = (gdouble) width / (gdouble) true_width;
|
|
|
|
|
gdouble ratio_y = (gdouble) height / (gdouble) true_height;
|
|
|
|
|
gdouble scale = MIN (ratio_x, ratio_y);
|
|
|
|
|
gdouble aspect = (gdouble) true_width / (gdouble) true_height;
|
2012-04-08 00:46:33 +02:00
|
|
|
|
|
2023-05-17 03:38:29 +00:00
|
|
|
|
/* Adjusting dimensions for non-square patterns */
|
|
|
|
|
if (true_width > true_height)
|
|
|
|
|
copy_height = copy_width / aspect;
|
|
|
|
|
else if (true_width < true_height)
|
|
|
|
|
copy_width = copy_height * aspect;
|
|
|
|
|
|
2024-11-24 16:56:55 +01:00
|
|
|
|
copy_width = MAX (1, copy_width);
|
|
|
|
|
copy_height = MAX (1, copy_height);
|
|
|
|
|
|
2023-05-17 03:38:29 +00:00
|
|
|
|
temp_buf = gimp_temp_buf_new (copy_width, copy_height,
|
|
|
|
|
gimp_temp_buf_get_format (pattern->mask));
|
|
|
|
|
|
2024-01-13 13:15:56 +00:00
|
|
|
|
if (temp_buf)
|
|
|
|
|
{
|
|
|
|
|
gegl_buffer_get (src_buffer,
|
|
|
|
|
GEGL_RECTANGLE (0, 0, copy_width, copy_height),
|
|
|
|
|
scale, gimp_temp_buf_get_format (temp_buf),
|
|
|
|
|
gimp_temp_buf_get_data (temp_buf),
|
|
|
|
|
GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_CLAMP);
|
|
|
|
|
|
|
|
|
|
has_temp_buf = TRUE;
|
|
|
|
|
}
|
2023-05-17 03:38:29 +00:00
|
|
|
|
}
|
2024-01-13 13:15:56 +00:00
|
|
|
|
|
|
|
|
|
/* If scaled image pattern could not be loaded,
|
|
|
|
|
* use the default pattern */
|
|
|
|
|
if (! has_temp_buf)
|
2023-05-17 03:38:29 +00:00
|
|
|
|
{
|
|
|
|
|
GeglBuffer *dest_buffer;
|
|
|
|
|
|
|
|
|
|
temp_buf = gimp_temp_buf_new (copy_width, copy_height,
|
|
|
|
|
gimp_temp_buf_get_format (pattern->mask));
|
|
|
|
|
|
|
|
|
|
dest_buffer = gimp_temp_buf_create_buffer (temp_buf);
|
|
|
|
|
|
|
|
|
|
gimp_gegl_buffer_copy (src_buffer,
|
|
|
|
|
GEGL_RECTANGLE (0, 0, copy_width, copy_height),
|
|
|
|
|
GEGL_ABYSS_NONE, dest_buffer,
|
|
|
|
|
GEGL_RECTANGLE (0, 0, 0, 0));
|
|
|
|
|
|
|
|
|
|
g_object_unref (dest_buffer);
|
|
|
|
|
}
|
2012-04-08 00:46:33 +02:00
|
|
|
|
|
|
|
|
|
g_object_unref (src_buffer);
|
2003-03-01 03:53:41 +00:00
|
|
|
|
|
2001-02-05 21:52:57 +00:00
|
|
|
|
return temp_buf;
|
2001-02-05 15:22:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-04-08 16:01:01 +00:00
|
|
|
|
static gchar *
|
|
|
|
|
gimp_pattern_get_description (GimpViewable *viewable,
|
|
|
|
|
gchar **tooltip)
|
|
|
|
|
{
|
2003-11-16 17:51:36 +00:00
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (viewable);
|
2003-04-08 16:01:01 +00:00
|
|
|
|
|
2006-02-28 12:15:51 +00:00
|
|
|
|
return g_strdup_printf ("%s (%d × %d)",
|
2009-08-29 12:40:40 +02:00
|
|
|
|
gimp_object_get_name (pattern),
|
2012-04-23 09:40:56 +02:00
|
|
|
|
gimp_temp_buf_get_width (pattern->mask),
|
|
|
|
|
gimp_temp_buf_get_height (pattern->mask));
|
2003-04-08 16:01:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-09-12 10:35:35 +00:00
|
|
|
|
static const gchar *
|
2001-02-13 19:53:07 +00:00
|
|
|
|
gimp_pattern_get_extension (GimpData *data)
|
|
|
|
|
{
|
|
|
|
|
return GIMP_PATTERN_FILE_EXTENSION;
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-04 21:21:12 -04:00
|
|
|
|
static void
|
|
|
|
|
gimp_pattern_copy (GimpData *data,
|
|
|
|
|
GimpData *src_data)
|
2001-03-30 11:16:05 +00:00
|
|
|
|
{
|
2017-11-04 21:21:12 -04:00
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (data);
|
|
|
|
|
GimpPattern *src_pattern = GIMP_PATTERN (src_data);
|
|
|
|
|
|
2019-02-12 21:15:35 +01:00
|
|
|
|
g_clear_pointer (&pattern->mask, gimp_temp_buf_unref);
|
2017-11-04 21:21:12 -04:00
|
|
|
|
pattern->mask = gimp_temp_buf_copy (src_pattern->mask);
|
2001-03-30 11:16:05 +00:00
|
|
|
|
|
2017-11-04 21:21:12 -04:00
|
|
|
|
gimp_data_dirty (data);
|
2001-03-30 11:16:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-12-13 11:58:24 +00:00
|
|
|
|
static gchar *
|
|
|
|
|
gimp_pattern_get_checksum (GimpTagged *tagged)
|
|
|
|
|
{
|
|
|
|
|
GimpPattern *pattern = GIMP_PATTERN (tagged);
|
|
|
|
|
gchar *checksum_string = NULL;
|
|
|
|
|
|
|
|
|
|
if (pattern->mask)
|
|
|
|
|
{
|
|
|
|
|
GChecksum *checksum = g_checksum_new (G_CHECKSUM_MD5);
|
|
|
|
|
|
2012-04-08 23:56:52 +02:00
|
|
|
|
g_checksum_update (checksum, gimp_temp_buf_get_data (pattern->mask),
|
|
|
|
|
gimp_temp_buf_get_data_size (pattern->mask));
|
2008-12-13 11:58:24 +00:00
|
|
|
|
|
|
|
|
|
checksum_string = g_strdup (g_checksum_get_string (checksum));
|
|
|
|
|
|
|
|
|
|
g_checksum_free (checksum);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return checksum_string;
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-14 14:57:14 +00:00
|
|
|
|
GimpData *
|
2010-04-10 19:55:42 +02:00
|
|
|
|
gimp_pattern_new (GimpContext *context,
|
|
|
|
|
const gchar *name)
|
2001-02-13 19:53:07 +00:00
|
|
|
|
{
|
|
|
|
|
GimpPattern *pattern;
|
|
|
|
|
guchar *data;
|
|
|
|
|
gint row, col;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2010-04-10 19:55:42 +02:00
|
|
|
|
g_return_val_if_fail (name[0] != '\n', NULL);
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
2004-01-29 16:19:57 +00:00
|
|
|
|
pattern = g_object_new (GIMP_TYPE_PATTERN,
|
|
|
|
|
"name", name,
|
|
|
|
|
NULL);
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
2012-04-08 23:56:52 +02:00
|
|
|
|
pattern->mask = gimp_temp_buf_new (32, 32, babl_format ("R'G'B' u8"));
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
2012-04-08 23:56:52 +02:00
|
|
|
|
data = gimp_temp_buf_get_data (pattern->mask);
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
2012-04-23 09:40:56 +02:00
|
|
|
|
for (row = 0; row < gimp_temp_buf_get_height (pattern->mask); row++)
|
|
|
|
|
for (col = 0; col < gimp_temp_buf_get_width (pattern->mask); col++)
|
2001-02-13 19:53:07 +00:00
|
|
|
|
{
|
2005-07-23 22:22:45 +00:00
|
|
|
|
memset (data, (col % 2) && (row % 2) ? 255 : 0, 3);
|
|
|
|
|
data += 3;
|
2001-02-13 19:53:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-14 14:57:14 +00:00
|
|
|
|
return GIMP_DATA (pattern);
|
2001-02-13 19:53:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-14 14:57:14 +00:00
|
|
|
|
GimpData *
|
2010-04-05 13:24:54 +02:00
|
|
|
|
gimp_pattern_get_standard (GimpContext *context)
|
2001-02-13 19:53:07 +00:00
|
|
|
|
{
|
2004-01-29 16:19:57 +00:00
|
|
|
|
static GimpData *standard_pattern = NULL;
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
|
|
|
|
if (! standard_pattern)
|
|
|
|
|
{
|
2023-05-22 18:13:44 +02:00
|
|
|
|
g_set_weak_pointer (&standard_pattern,
|
|
|
|
|
gimp_pattern_new (context, "Standard"));
|
2001-02-13 19:53:07 +00:00
|
|
|
|
|
2009-10-31 18:48:38 +01:00
|
|
|
|
gimp_data_clean (standard_pattern);
|
|
|
|
|
gimp_data_make_internal (standard_pattern, "gimp-pattern-standard");
|
2001-02-13 19:53:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-01-29 16:19:57 +00:00
|
|
|
|
return standard_pattern;
|
2001-02-13 19:53:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-04-08 20:25:49 +02:00
|
|
|
|
GimpTempBuf *
|
2016-05-19 23:51:44 +02:00
|
|
|
|
gimp_pattern_get_mask (GimpPattern *pattern)
|
2001-02-04 17:34:30 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_PATTERN (pattern), NULL);
|
|
|
|
|
|
|
|
|
|
return pattern->mask;
|
|
|
|
|
}
|
2012-03-17 21:59:10 +01:00
|
|
|
|
|
|
|
|
|
GeglBuffer *
|
2016-05-19 23:51:44 +02:00
|
|
|
|
gimp_pattern_create_buffer (GimpPattern *pattern)
|
2012-03-17 21:59:10 +01:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_PATTERN (pattern), NULL);
|
|
|
|
|
|
2012-04-09 00:16:46 +02:00
|
|
|
|
return gimp_temp_buf_create_buffer (pattern->mask);
|
2012-03-17 21:59:10 +01:00
|
|
|
|
}
|