Commit 4ef3c918 authored by Michael Natterer's avatar Michael Natterer 😴

pdb, app, libgimp: move the image transform procedures to their own PDB group

because image.pdb is way too large.
parent 431959df
......@@ -61,6 +61,7 @@ libappinternal_procs_a_SOURCES = \
image-convert-cmds.c \
image-grid-cmds.c \
image-guides-cmds.c \
image-transform-cmds.c \
image-select-cmds.c \
image-undo-cmds.c \
item-cmds.c \
......
This diff is collapsed.
This diff is collapsed.
......@@ -63,6 +63,7 @@ internal_procs_init (GimpPDB *pdb)
register_image_grid_procs (pdb);
register_image_guides_procs (pdb);
register_image_select_procs (pdb);
register_image_transform_procs (pdb);
register_image_undo_procs (pdb);
register_item_procs (pdb);
register_item_transform_procs (pdb);
......
......@@ -52,6 +52,7 @@ void register_image_convert_procs (GimpPDB *pdb);
void register_image_grid_procs (GimpPDB *pdb);
void register_image_guides_procs (GimpPDB *pdb);
void register_image_select_procs (GimpPDB *pdb);
void register_image_transform_procs (GimpPDB *pdb);
void register_image_undo_procs (GimpPDB *pdb);
void register_item_procs (GimpPDB *pdb);
void register_item_transform_procs (GimpPDB *pdb);
......
......@@ -103,6 +103,7 @@ PDB_WRAPPERS_C = \
gimpimagegrid_pdb.c \
gimpimageguides_pdb.c \
gimpimageselect_pdb.c \
gimpimagetransform_pdb.c \
gimpimageundo_pdb.c \
gimpitem_pdb.c \
gimpitemtransform_pdb.c \
......@@ -157,6 +158,7 @@ PDB_WRAPPERS_H = \
gimpimagegrid_pdb.h \
gimpimageguides_pdb.h \
gimpimageselect_pdb.h \
gimpimagetransform_pdb.h \
gimpimageundo_pdb.h \
gimpitem_pdb.h \
gimpitemtransform_pdb.h \
......
......@@ -55,6 +55,7 @@
#include <libgimp/gimpimagegrid_pdb.h>
#include <libgimp/gimpimageguides_pdb.h>
#include <libgimp/gimpimageselect_pdb.h>
#include <libgimp/gimpimagetransform_pdb.h>
#include <libgimp/gimpimageundo_pdb.h>
#include <libgimp/gimpitem_pdb.h>
#include <libgimp/gimpitemtransform_pdb.h>
......
......@@ -415,274 +415,6 @@ gimp_image_free_shadow (gint32 image_ID)
return success;
}
/**
* gimp_image_resize:
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
* @offx: x offset between upper left corner of old and new images: (new - old).
* @offy: y offset between upper left corner of old and new images: (new - old).
*
* Resize the image to the specified extents.
*
* This procedure resizes the image so that it's new width and height
* are equal to the supplied parameters. Offsets are also provided
* which describe the position of the previous image's content. All
* channels within the image are resized according to the specified
* parameters; this includes the image selection mask. All layers
* within the image are repositioned according to the specified
* offsets.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_resize (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-resize",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_INT32, offx,
GIMP_PDB_INT32, offy,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_resize_to_layers:
* @image_ID: The image.
*
* Resize the image to fit all layers.
*
* This procedure resizes the image to the bounding box of all layers
* of the image. All channels within the image are resized to the new
* size; this includes the image selection mask. All layers within the
* image are repositioned to the new image area.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.2
**/
gboolean
gimp_image_resize_to_layers (gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-resize-to-layers",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_scale:
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
*
* Scale the image using the default interpolation method.
*
* This procedure scales the image so that its new width and height are
* equal to the supplied parameters. All layers and channels within the
* image are scaled according to the specified parameters; this
* includes the image selection mask. The interpolation method used can
* be set with gimp_context_set_interpolation().
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_scale (gint32 image_ID,
gint new_width,
gint new_height)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-scale",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_scale_full:
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
* @interpolation: Type of interpolation.
*
* Deprecated: Use gimp_image_scale() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.6
**/
gboolean
gimp_image_scale_full (gint32 image_ID,
gint new_width,
gint new_height,
GimpInterpolationType interpolation)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-scale-full",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_INT32, interpolation,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_crop:
* @image_ID: The image.
* @new_width: New image width: (0 < new_width <= width).
* @new_height: New image height: (0 < new_height <= height).
* @offx: X offset: (0 <= offx <= (width - new_width)).
* @offy: Y offset: (0 <= offy <= (height - new_height)).
*
* Crop the image to the specified extents.
*
* This procedure crops the image so that it's new width and height are
* equal to the supplied parameters. Offsets are also provided which
* describe the position of the previous image's content. All channels
* and layers within the image are cropped to the new image extents;
* this includes the image selection mask. If any parameters are out of
* range, an error is returned.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_crop (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-crop",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_INT32, offx,
GIMP_PDB_INT32, offy,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_flip:
* @image_ID: The image.
* @flip_type: Type of flip.
*
* Flips the image horizontally or vertically.
*
* This procedure flips (mirrors) the image.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_flip (gint32 image_ID,
GimpOrientationType flip_type)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-flip",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, flip_type,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_rotate:
* @image_ID: The image.
* @rotate_type: Angle of rotation.
*
* Rotates the image by the specified degrees.
*
* This procedure rotates the image.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_rotate (gint32 image_ID,
GimpRotationType rotate_type)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-rotate",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, rotate_type,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_get_layers:
* @image_ID: The image.
......
This diff is collapsed.
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpimagetransform_pdb.c
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl */
#include "config.h"
#include "gimp.h"
/**
* SECTION: gimpimagetransform
* @title: gimpimagetransform
* @short_description: Transformations onm images.
*
* Operations to scale, resize, crop, flip and rotate images.
**/
/**
* gimp_image_resize:
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
* @offx: x offset between upper left corner of old and new images: (new - old).
* @offy: y offset between upper left corner of old and new images: (new - old).
*
* Resize the image to the specified extents.
*
* This procedure resizes the image so that it's new width and height
* are equal to the supplied parameters. Offsets are also provided
* which describe the position of the previous image's content. All
* channels within the image are resized according to the specified
* parameters; this includes the image selection mask. All layers
* within the image are repositioned according to the specified
* offsets.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_resize (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-resize",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_INT32, offx,
GIMP_PDB_INT32, offy,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_resize_to_layers:
* @image_ID: The image.
*
* Resize the image to fit all layers.
*
* This procedure resizes the image to the bounding box of all layers
* of the image. All channels within the image are resized to the new
* size; this includes the image selection mask. All layers within the
* image are repositioned to the new image area.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.2
**/
gboolean
gimp_image_resize_to_layers (gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-resize-to-layers",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_scale:
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
*
* Scale the image using the default interpolation method.
*
* This procedure scales the image so that its new width and height are
* equal to the supplied parameters. All layers and channels within the
* image are scaled according to the specified parameters; this
* includes the image selection mask. The interpolation method used can
* be set with gimp_context_set_interpolation().
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_scale (gint32 image_ID,
gint new_width,
gint new_height)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-scale",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_scale_full:
* @image_ID: The image.
* @new_width: New image width.
* @new_height: New image height.
* @interpolation: Type of interpolation.
*
* Deprecated: Use gimp_image_scale() instead.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.6
**/
gboolean
gimp_image_scale_full (gint32 image_ID,
gint new_width,
gint new_height,
GimpInterpolationType interpolation)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-scale-full",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_INT32, interpolation,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_crop:
* @image_ID: The image.
* @new_width: New image width: (0 < new_width <= width).
* @new_height: New image height: (0 < new_height <= height).
* @offx: X offset: (0 <= offx <= (width - new_width)).
* @offy: Y offset: (0 <= offy <= (height - new_height)).
*
* Crop the image to the specified extents.
*
* This procedure crops the image so that it's new width and height are
* equal to the supplied parameters. Offsets are also provided which
* describe the position of the previous image's content. All channels
* and layers within the image are cropped to the new image extents;
* this includes the image selection mask. If any parameters are out of
* range, an error is returned.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_crop (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-crop",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, new_width,
GIMP_PDB_INT32, new_height,
GIMP_PDB_INT32, offx,
GIMP_PDB_INT32, offy,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_flip:
* @image_ID: The image.
* @flip_type: Type of flip.
*
* Flips the image horizontally or vertically.
*
* This procedure flips (mirrors) the image.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_flip (gint32 image_ID,
GimpOrientationType flip_type)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-flip",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, flip_type,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_rotate:
* @image_ID: The image.
* @rotate_type: Angle of rotation.
*
* Rotates the image by the specified degrees.
*
* This procedure rotates the image.
*
* Returns: TRUE on success.
**/
gboolean
gimp_image_rotate (gint32 image_ID,
GimpRotationType rotate_type)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-rotate",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_INT32, rotate_type,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpimagetransform_pdb.h
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl */
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
#error "Only <libgimp/gimp.h> can be included directly."
#endif
#ifndef __GIMP_IMAGE_TRANSFORM_PDB_H__
#define __GIMP_IMAGE_TRANSFORM_PDB_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_image_resize (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy);
gboolean gimp_image_resize_to_layers (gint32 image_ID);
gboolean gimp_image_scale (gint32 image_ID,
gint new_width,
gint new_height);
GIMP_DEPRECATED_FOR(gimp_image_scale)
gboolean gimp_image_scale_full (gint32 image_ID,
gint new_width,
gint new_height,
GimpInterpolationType interpolation);
gboolean gimp_image_crop (gint32 image_ID,
gint new_width,
gint new_height,
gint offx,
gint offy);
gboolean gimp_image_flip (gint32 image_ID,
GimpOrientationType flip_type);
gboolean gimp_image_rotate (gint32 image_ID,
GimpRotationType rotate_type);
G_END_DECLS
#endif /* __GIMP_IMAGE_TRANSFORM_PDB_H__ */
......@@ -299,6 +299,7 @@ app/pdb/image-cmds.c
app/pdb/image-convert-cmds.c
app/pdb/image-guides-cmds.c
app/pdb/image-select-cmds.c
app/pdb/image-transform-cmds.c
app/pdb/image-undo-cmds.c
app/pdb/item-transform-cmds.c
app/pdb/layer-cmds.c
......
......@@ -30,6 +30,7 @@ pdb_sources = \
pdb/image_grid.pdb \
pdb/image_guides.pdb \
pdb/image_select.pdb \
pdb/image_transform.pdb \
pdb/image_undo.pdb \
pdb/item.pdb \
pdb/item_transform.pdb \
......
......@@ -28,6 +28,7 @@
image_grid
image_guides
image_select
image_transform
image_undo
item
item_transform
......
......@@ -239,248 +239,6 @@ CODE
);
}
sub image_resize {
$blurb = 'Resize the image to the specified extents.';
$help = <<'HELP';
This procedure resizes the image so that it's new width and height are
equal to the supplied parameters. Offsets are also provided which
describe the position of the previous image's content. All channels
within the image are resized according to the specified parameters;
this includes the image selection mask. All layers within the image
are repositioned according to the specified offsets.
HELP
&std_pdb_misc;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image width' },
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image height' },
{ name => 'offx', type => 'int32',
desc => 'x offset between upper left corner of old and
new images: (new - old)' },
{ name => 'offy', type => 'int32',