1 /* GIMP - The GNU Image Manipulation Program 2 * Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis 3 * 4 * gimptemplate.h 5 * Copyright (C) 2003 Michael Natterer <mitch@gimp.org> 6 * 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <https://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef __GIMP_TEMPLATE_H__ 22 #define __GIMP_TEMPLATE_H__ 23 24 25 #include "gimpviewable.h" 26 27 28 #define GIMP_TEMPLATE_PARAM_COPY_FIRST (1 << (8 + G_PARAM_USER_SHIFT)) 29 30 #ifdef GIMP_UNSTABLE 31 /* Uncommon ratio, with at least one odd value, to encourage testing 32 * GIMP with unusual numbers. 33 * It also has to be a higher resolution, to push GIMP a little further 34 * in tests. */ 35 #define GIMP_DEFAULT_IMAGE_WIDTH 2001 36 #define GIMP_DEFAULT_IMAGE_HEIGHT 1984 37 #else 38 /* 1366x768 is the most common screen resolution in 2016. 39 * 1920x1080 is the second most common. 40 * Since GIMP targets advanced graphics artists, let's go for the 41 * highest common dimension. 42 */ 43 #define GIMP_DEFAULT_IMAGE_WIDTH 1920 44 #define GIMP_DEFAULT_IMAGE_HEIGHT 1080 45 #endif 46 47 48 #define GIMP_TYPE_TEMPLATE (gimp_template_get_type ()) 49 #define GIMP_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TEMPLATE, GimpTemplate)) 50 #define GIMP_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TEMPLATE, GimpTemplateClass)) 51 #define GIMP_IS_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TEMPLATE)) 52 #define GIMP_IS_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TEMPLATE)) 53 #define GIMP_TEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TEMPLATE, GimpTemplateClass)) 54 55 56 typedef struct _GimpTemplateClass GimpTemplateClass; 57 58 struct _GimpTemplate 59 { 60 GimpViewable parent_instance; 61 }; 62 63 struct _GimpTemplateClass 64 { 65 GimpViewableClass parent_instance; 66 }; 67 68 69 GType gimp_template_get_type (void) G_GNUC_CONST; 70 71 GimpTemplate * gimp_template_new (const gchar *name); 72 73 void gimp_template_set_from_image (GimpTemplate *template, 74 GimpImage *image); 75 76 gint gimp_template_get_width (GimpTemplate *template); 77 gint gimp_template_get_height (GimpTemplate *template); 78 GimpUnit gimp_template_get_unit (GimpTemplate *template); 79 80 gdouble gimp_template_get_resolution_x (GimpTemplate *template); 81 gdouble gimp_template_get_resolution_y (GimpTemplate *template); 82 GimpUnit gimp_template_get_resolution_unit (GimpTemplate *template); 83 84 GimpImageBaseType gimp_template_get_base_type (GimpTemplate *template); 85 GimpPrecision gimp_template_get_precision (GimpTemplate *template); 86 87 gboolean gimp_template_get_color_managed (GimpTemplate *template); 88 GimpColorProfile * gimp_template_get_color_profile (GimpTemplate *template); 89 90 GimpFillType gimp_template_get_fill_type (GimpTemplate *template); 91 92 const gchar * gimp_template_get_comment (GimpTemplate *template); 93 94 guint64 gimp_template_get_initial_size (GimpTemplate *template); 95 96 97 #endif /* __GIMP_TEMPLATE__ */ 98