home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / libgimp / gimpchannelops_pdb.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-25  |  3.2 KB  |  103 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpchannelops_pdb.c
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. /* NOTE: This file is autogenerated by pdbgen.pl */
  23.  
  24. #include "gimp.h"
  25.  
  26. /**
  27.  * gimp_channel_ops_offset:
  28.  * @drawable_ID: The drawable to offset.
  29.  * @wrap_around: wrap image around or fill vacated regions.
  30.  * @fill_type: fill vacated regions of drawable with background or transparent.
  31.  * @offset_x: offset by this amount in X direction.
  32.  * @offset_y: offset by this amount in Y direction.
  33.  *
  34.  * Offset the drawable by the specified amounts in the X and Y
  35.  * directions
  36.  *
  37.  * This procedure offsets the specified drawable by the amounts
  38.  * specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
  39.  * TRUE, then portions of the drawable which are offset out of bounds
  40.  * are wrapped around. Alternatively, the undefined regions of the
  41.  * drawable can be filled with transparency or the background color, as
  42.  * specified by the 'fill_type' parameter.
  43.  *
  44.  * Returns: TRUE on success.
  45.  */
  46. gboolean
  47. gimp_channel_ops_offset (gint32                drawable_ID,
  48.              gboolean              wrap_around,
  49.              GimpChannelOffsetType fill_type,
  50.              gint                  offset_x,
  51.              gint                  offset_y)
  52. {
  53.   GimpParam *return_vals;
  54.   gint nreturn_vals;
  55.   gboolean success = TRUE;
  56.  
  57.   return_vals = gimp_run_procedure ("gimp_channel_ops_offset",
  58.                     &nreturn_vals,
  59.                     GIMP_PDB_DRAWABLE, drawable_ID,
  60.                     GIMP_PDB_INT32, wrap_around,
  61.                     GIMP_PDB_INT32, fill_type,
  62.                     GIMP_PDB_INT32, offset_x,
  63.                     GIMP_PDB_INT32, offset_y,
  64.                     GIMP_PDB_END);
  65.  
  66.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  67.  
  68.   gimp_destroy_params (return_vals, nreturn_vals);
  69.  
  70.   return success;
  71. }
  72.  
  73. /**
  74.  * gimp_channel_ops_duplicate:
  75.  * @image_ID: The image.
  76.  *
  77.  * Duplicate the specified image
  78.  *
  79.  * This procedure duplicates the specified image, copying all layers,
  80.  * channels, and image information.
  81.  *
  82.  * Returns: The new, duplicated image.
  83.  */
  84. gint32
  85. gimp_channel_ops_duplicate (gint32 image_ID)
  86. {
  87.   GimpParam *return_vals;
  88.   gint nreturn_vals;
  89.   gint32 new_image_ID = -1;
  90.  
  91.   return_vals = gimp_run_procedure ("gimp_channel_ops_duplicate",
  92.                     &nreturn_vals,
  93.                     GIMP_PDB_IMAGE, image_ID,
  94.                     GIMP_PDB_END);
  95.  
  96.   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  97.     new_image_ID = return_vals[1].data.d_image;
  98.  
  99.   gimp_destroy_params (return_vals, nreturn_vals);
  100.  
  101.   return new_image_ID;
  102. }
  103.