From: Carlos Eduardo Rodrigues Diogenes
Date: Thu, 31 Aug 2006 22:02:09 -0300
Hi,
Where is the real contrast manipulation code in gimp?
I look at the gimp_brightness_contrast, but I'm too lazy to see where
that wire code goes.
This is definitely a reasonable question, because the structure of
the code is not very easy to figure out, but you should avoid using
the word "lazy", because people will feel like fools if they do your
work for you while you are being lazy.
The Brightness-Contrast tool is one of the "Image Map" tools, along
with Hue-Saturation, Levels, Curves, etc. For all of these tools,
much of the relevant code is in app/tools/gimpimagemaptool.c, and
only the things that distinguish the individual tools from each other
are in different files.
You should also know that GIMP keeps a hard distinction between gui
code, and code that acts directly on images. For the image map tools,
the gui code is in the app/tools directory, and the code that actually
performs the actions for the tools is in app/base.
Several of the image map tools work by using a "look up table", or lut.
When you alter settings for the tool, the "map" method for the tool
is executed, in this case gimp_brightness_contrast_tool_map() in
app/tools/gimpbrightnesscontrasttool.c. This function, as you
can see by looking at it, calls brightness_contrast_lut_setup(),
which is located in the file app/base/lut-funcs.c, and then
gimp_image_map_apply(), which applies the altered lut to the image.
-- Bill
______________ ______________ ______________ ______________
Sent via the CNPRC Email system at primate.ucdavis.edu