home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / gimplut.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-17  |  2.5 KB  |  67 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3.  *
  4.  * gimplut.h: Copyright (C) 1999 Jay Cox <jaycox@earthlink.net>
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * This program 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
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  */
  20.  
  21. #ifndef __GIMP_LUT_H__
  22. #define __GIMP_LUT_H__
  23.  
  24. #include "pixel_region.h"
  25.  
  26.  
  27. /* TODO: the GimpLutFunc should really be passed the ColorModel of the region,
  28.    not just the number of channels */
  29. /* GimpLutFuncs should assume that the input and output gamma are 1.0
  30.    and do no correction as this will be handled by gimp_lut_setup */ 
  31. typedef float (*GimpLutFunc)(void *user_data, int nchannels,
  32.                  int channel, float value);
  33.  
  34. GimpLut * gimp_lut_new         ();
  35. void      gimp_lut_free        (GimpLut *lut);
  36.  
  37. void      gimp_lut_setup       (GimpLut *, GimpLutFunc,
  38.                 void *user_data,
  39.                 int nchannels);
  40.  
  41. /* gimp_lut_setup_exact is currently identical to gimp_lut_setup.  It
  42.    however is guaranteed to never perform any interpolation or gamma
  43.    correction on the lut */
  44. void      gimp_lut_setup_exact (GimpLut *, GimpLutFunc,
  45.                 void *user_data,
  46.                 int nchannels);
  47.  
  48. void      gimp_lut_process     (GimpLut *lut,
  49.                 PixelRegion *srcPR,
  50.                 PixelRegion *destPR);
  51.  
  52. /* gimp_lut_process_inline is like gimp_lut_process except it uses a
  53.    single PixelRegion as both the source and destination */
  54. void      gimp_lut_process_inline(GimpLut *lut,
  55.                   PixelRegion *src_destPR);
  56.  
  57. /* gimp_lut_process_2 is the same as gimp_lut_process but the lut
  58.    perameter is last instead of first.  this is necesary because
  59.    pixel_region_process_paralell sends the user_data as the 1st
  60.    parameter, and the image_map functions send user_data as the last
  61.    parameter */
  62. void      gimp_lut_process_2  (PixelRegion *srcPR,
  63.                    PixelRegion *destPR,
  64.                    GimpLut *lut);
  65.  
  66. #endif /* __GIMP_LUT_H__ */
  67.