2006-12-10 05:33:38 +08:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 08:47:26 +08:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1999-03-28 14:55:29 +08:00
*
2009-01-18 06:28:01 +08:00
* This program is free software : you can redistribute it and / or modify
1999-03-28 14:55:29 +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
1999-03-28 14:55:29 +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
2018-07-12 05:27:07 +08:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
1999-03-28 14:55:29 +08:00
*/
2007-01-09 18:52:47 +08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1999-03-28 14:55:29 +08:00
2000-12-29 23:22:01 +08:00
# include "config.h"
1999-03-28 14:55:29 +08:00
2008-10-10 04:24:04 +08:00
# include <gegl.h>
2000-12-29 23:22:01 +08:00
2012-05-03 09:36:22 +08:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2012-05-04 06:50:23 +08:00
# include "libgimpbase/gimpbase.h"
2001-08-17 22:27:31 +08:00
# include "pdb-types.h"
2000-12-29 23:22:01 +08:00
2012-04-26 02:39:23 +08:00
# include "core/gimp.h"
2016-04-29 16:34:03 +08:00
# include "core/gimpimage-convert-indexed.h"
2012-04-29 22:22:20 +08:00
# include "core/gimpimage-convert-precision.h"
2012-06-26 20:38:33 +08:00
# include "core/gimpimage-convert-type.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpimage.h"
2009-09-08 03:09:24 +08:00
# include "core/gimpitemstack.h"
2008-04-03 16:36:44 +08:00
# include "core/gimppalette.h"
2008-02-08 01:08:54 +08:00
# include "core/gimpparamspecs.h"
2018-07-07 01:43:26 +08:00
# include "gegl/gimp-babl.h"
1999-03-28 14:55:29 +08:00
2008-02-08 01:08:54 +08:00
# include "gimppdb.h"
2008-04-03 16:36:44 +08:00
# include "gimppdberror.h"
2008-02-08 01:08:54 +08:00
# include "gimppdb-utils.h"
# include "gimpprocedure.h"
2008-04-04 19:15:55 +08:00
# include "internal-procs.h"
2006-11-01 03:02:56 +08:00
2008-04-03 16:36:44 +08:00
# include "gimp-intl.h"
1999-03-28 14:55:29 +08:00
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
image_convert_rgb_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-03-28 14:55:29 +08:00
{
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
1999-03-28 14:55:29 +08:00
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1999-03-28 14:55:29 +08:00
if ( success )
2004-02-01 00:23:25 +08:00
{
2018-07-07 01:43:26 +08:00
if ( gimp_pdb_image_is_not_base_type ( image , GIMP_RGB , error ) & &
gimp_babl_is_valid ( GIMP_RGB , gimp_image_get_precision ( image ) ) )
2008-04-04 14:57:42 +08:00
{
2016-04-30 23:48:07 +08:00
success = gimp_image_convert_type ( image , GIMP_RGB , NULL , NULL , error ) ;
2008-04-04 14:57:42 +08:00
}
2004-02-01 00:23:25 +08:00
else
2008-04-04 14:57:42 +08:00
{
success = FALSE ;
}
2004-02-01 00:23:25 +08:00
}
1999-03-28 14:55:29 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-28 14:55:29 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
image_convert_grayscale_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-03-28 14:55:29 +08:00
{
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
1999-03-28 14:55:29 +08:00
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1999-03-28 14:55:29 +08:00
if ( success )
2004-02-01 00:23:25 +08:00
{
2018-07-07 01:43:26 +08:00
if ( gimp_pdb_image_is_not_base_type ( image , GIMP_GRAY , error ) & &
gimp_babl_is_valid ( GIMP_GRAY , gimp_image_get_precision ( image ) ) )
2008-04-04 14:57:42 +08:00
{
2016-04-30 23:48:07 +08:00
success = gimp_image_convert_type ( image , GIMP_GRAY , NULL , NULL , error ) ;
2008-04-04 14:57:42 +08:00
}
2004-02-01 00:23:25 +08:00
else
2008-04-04 14:57:42 +08:00
{
success = FALSE ;
}
2004-02-01 00:23:25 +08:00
}
1999-03-28 14:55:29 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-28 14:55:29 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
image_convert_indexed_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-09-01 05:26:34 +08:00
{
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2019-08-15 20:04:56 +08:00
gint dither_type ;
gint palette_type ;
gint num_cols ;
1999-09-01 05:26:34 +08:00
gboolean alpha_dither ;
gboolean remove_unused ;
2006-04-03 00:03:32 +08:00
const gchar * palette ;
1999-09-01 05:26:34 +08:00
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
dither_type = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
palette_type = g_value_get_enum ( gimp_value_array_index ( args , 2 ) ) ;
num_cols = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
alpha_dither = g_value_get_boolean ( gimp_value_array_index ( args , 4 ) ) ;
remove_unused = g_value_get_boolean ( gimp_value_array_index ( args , 5 ) ) ;
palette = g_value_get_string ( gimp_value_array_index ( args , 6 ) ) ;
1999-09-01 05:26:34 +08:00
if ( success )
{
2008-04-04 14:57:42 +08:00
GimpPalette * pal = NULL ;
2004-03-27 00:38:44 +08:00
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
if ( gimp_pdb_image_is_not_base_type ( image , GIMP_INDEXED , error ) & &
gimp_pdb_image_is_precision ( image , GIMP_PRECISION_U8_NON_LINEAR , error ) & &
gimp_babl_is_valid ( GIMP_INDEXED , gimp_image_get_precision ( image ) ) & &
2009-09-08 03:09:24 +08:00
gimp_item_stack_is_flat ( GIMP_ITEM_STACK ( gimp_image_get_layers ( image ) ) ) )
2004-03-27 00:49:18 +08:00
{
switch ( palette_type )
{
2017-02-27 03:55:00 +08:00
case GIMP_CONVERT_PALETTE_GENERATE :
2004-03-27 00:49:18 +08:00
if ( num_cols < 1 | | num_cols > MAXNUMCOLORS )
success = FALSE ;
break ;
2017-02-27 03:55:00 +08:00
case GIMP_CONVERT_PALETTE_CUSTOM :
2008-04-04 14:57:42 +08:00
pal = gimp_pdb_get_palette ( gimp , palette , FALSE , error ) ;
if ( ! pal )
2008-04-03 16:36:44 +08:00
{
success = FALSE ;
}
2008-04-04 14:57:42 +08:00
else if ( pal - > n_colors > MAXNUMCOLORS )
2008-04-03 16:36:44 +08:00
{
2008-11-04 20:33:09 +08:00
g_set_error_literal ( error ,
2012-03-06 02:36:59 +08:00
GIMP_PDB_ERROR ,
GIMP_PDB_ERROR_INVALID_ARGUMENT ,
2008-11-04 20:33:09 +08:00
_ ( " Cannot convert to a palette "
" with more than 256 colors. " ) ) ;
2008-04-03 16:36:44 +08:00
success = FALSE ;
}
2004-03-27 00:49:18 +08:00
break ;
default :
break ;
}
}
2004-02-01 00:23:25 +08:00
else
2008-04-04 14:29:35 +08:00
{
success = FALSE ;
}
2004-03-27 00:38:44 +08:00
1999-09-01 05:26:34 +08:00
if ( success )
2016-04-29 16:34:03 +08:00
success = gimp_image_convert_indexed ( image ,
2016-09-28 05:51:33 +08:00
palette_type , num_cols , remove_unused ,
dither_type , alpha_dither , FALSE ,
pal ,
2016-04-29 16:34:03 +08:00
NULL , error ) ;
1999-09-01 05:26:34 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-09-01 05:26:34 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
image_convert_set_dither_matrix_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-08-05 01:54:26 +08:00
{
gboolean success = TRUE ;
2019-08-15 20:04:56 +08:00
gint width ;
gint height ;
gint matrix_length ;
2006-08-05 01:54:26 +08:00
const guint8 * matrix ;
2012-05-04 06:50:23 +08:00
width = g_value_get_int ( gimp_value_array_index ( args , 0 ) ) ;
height = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
matrix_length = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
2019-08-15 21:04:34 +08:00
matrix = gimp_value_get_uint8_array ( gimp_value_array_index ( args , 3 ) ) ;
2006-08-05 01:54:26 +08:00
if ( success )
{
2011-10-09 02:28:38 +08:00
if ( width = = 0 | | height = = 0 | | matrix_length = = width * height )
2011-10-08 22:30:07 +08:00
{
2016-04-29 16:34:03 +08:00
gimp_image_convert_indexed_set_dither_matrix ( matrix , width , height ) ;
2011-10-08 22:30:07 +08:00
}
else
{
2012-03-06 02:36:59 +08:00
g_set_error_literal ( error , GIMP_PDB_ERROR ,
GIMP_PDB_ERROR_INVALID_ARGUMENT ,
2011-10-08 22:30:07 +08:00
" Dither matrix length must be width * height " ) ;
success = FALSE ;
}
2006-08-05 01:54:26 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-08-05 01:54:26 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
image_convert_precision_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2012-04-26 02:16:29 +08:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 20:04:56 +08:00
gint precision ;
2012-04-26 02:16:29 +08:00
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
precision = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2012-04-26 02:16:29 +08:00
if ( success )
{
if ( gimp_pdb_image_is_not_base_type ( image , GIMP_INDEXED , error ) & &
2018-07-07 01:43:26 +08:00
gimp_pdb_image_is_not_precision ( image , precision , error ) & &
gimp_babl_is_valid ( gimp_image_get_base_type ( image ) , precision ) )
2012-04-26 02:16:29 +08:00
{
2016-11-08 03:41:39 +08:00
gimp_image_convert_precision ( image , precision ,
GEGL_DITHER_NONE ,
GEGL_DITHER_NONE ,
GEGL_DITHER_NONE ,
progress ) ;
2012-04-26 02:16:29 +08:00
}
else
{
success = FALSE ;
}
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2006-04-05 05:11:45 +08:00
void
2015-05-30 21:09:57 +08:00
register_image_convert_procs ( GimpPDB * pdb )
1999-09-01 05:26:34 +08:00
{
2006-04-05 05:11:45 +08:00
GimpProcedure * procedure ;
/*
* gimp - image - convert - rgb
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( image_convert_rgb_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-convert-rgb " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Convert specified image to RGB color " ,
" This procedure converts the specified image to RGB color. This process requires an image in Grayscale or Indexed color mode. No image content is lost in this process aside from the colormap for an indexed image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - image - convert - grayscale
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( image_convert_grayscale_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-convert-grayscale " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Convert specified image to grayscale " ,
" This procedure converts the specified image to grayscale. This process requires an image in RGB or Indexed color mode. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - image - convert - indexed
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( image_convert_indexed_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-convert-indexed " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Convert specified image to and Indexed image " ,
" This procedure converts the specified image to 'indexed' color. This process requires an image in RGB or Grayscale mode. The 'palette_type' specifies what kind of palette to use, A type of '0' means to use an optimal palette of 'num_cols' generated from the colors in the image. A type of '1' means to re-use the previous palette (not currently implemented). A type of '2' means to use the so-called WWW-optimized palette. Type '3' means to use only black and white colors. A type of '4' means to use a palette from the gimp palettes directories. The 'dither type' specifies what kind of dithering to use. '0' means no dithering, '1' means standard Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error diffusion with reduced bleeding, '3' means dithering based on pixel location ('Fixed' dithering). " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " dither-type " ,
" dither type " ,
2006-05-19 01:25:15 +08:00
" The dither type to use " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_CONVERT_DITHER_TYPE ,
2017-02-27 03:10:54 +08:00
GIMP_CONVERT_DITHER_NONE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " palette-type " ,
" palette type " ,
2006-05-19 01:25:15 +08:00
" The type of palette to use " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_CONVERT_PALETTE_TYPE ,
2017-02-27 03:55:00 +08:00
GIMP_CONVERT_PALETTE_GENERATE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " num-cols " ,
" num cols " ,
" The number of colors to quantize to, ignored unless (palette_type == GIMP_CONVERT_PALETTE_GENERATE) " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " alpha-dither " ,
" alpha dither " ,
" Dither transparency to fake partial opacity " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " remove-unused " ,
" remove unused " ,
2017-02-27 03:55:00 +08:00
" Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_CONVERT_PALETTE_GENERATE) " ,
2006-04-05 05:11:45 +08:00
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " palette " ,
" palette " ,
2017-02-27 03:55:00 +08:00
" The name of the custom palette to use, ignored unless (palette_type == GIMP_CONVERT_PALETTE_CUSTOM) " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-08-05 01:54:26 +08:00
/*
* gimp - image - convert - set - dither - matrix
*/
procedure = gimp_procedure_new ( image_convert_set_dither_matrix_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-convert-set-dither-matrix " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set dither matrix for conversion to indexed " ,
" This procedure sets the dither matrix used when converting images to INDEXED mode with positional dithering. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" David Gowers " ,
" David Gowers " ,
" 2006 " ) ;
2006-08-05 01:54:26 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " width " ,
" width " ,
" Width of the matrix (0 to reset to default matrix) " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-08-05 01:54:26 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " height " ,
" height " ,
" Height of the matrix (0 to reset to default matrix) " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-08-05 01:54:26 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " matrix-length " ,
" matrix length " ,
" The length of 'matrix' " ,
1 , 1024 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-08-05 01:54:26 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 21:04:34 +08:00
gimp_param_spec_uint8_array ( " matrix " ,
" matrix " ,
" The matrix -- all values must be >= 1 " ,
GIMP_PARAM_READWRITE ) ) ;
2006-08-05 01:54:26 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2012-04-26 02:16:29 +08:00
/*
* gimp - image - convert - precision
*/
procedure = gimp_procedure_new ( image_convert_precision_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-convert-precision " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Convert the image to the specified precision " ,
" This procedure converts the image to the specified precision. Note that indexed images cannot be converted and are always in GIMP_PRECISION_U8. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2012 " ) ;
2012-04-26 02:16:29 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2012-04-26 02:16:29 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " precision " ,
" precision " ,
" The new precision " ,
GIMP_TYPE_PRECISION ,
2013-06-23 22:51:24 +08:00
GIMP_PRECISION_U8_LINEAR ,
2012-04-26 02:16:29 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
}