win32 purification, rgb<->hsv remove

This commit is contained in:
Stanislav Brabec 2000-02-07 15:49:54 +00:00
parent 55e9881d6d
commit ce6050ad5f
23 changed files with 77 additions and 86 deletions

View File

@ -1,3 +1,21 @@
Mon Feb 7 13:41:08 CET 2000 Stanislav Brabec <utx@penguin.cz>
* plug-ins/gflare/gflare.c: Typo fix.
Mon Feb 7 12:57:16 CET 2000 Stanislav Brabec <utx@penguin.cz>
* plug-ins/common/sparkle.c, plug-ins/common/bumpmap.c,
* plug-ins/common/gz.c, plug-ins/common/tileit.c,
* plug-ins/common/oilify.c, plug-ins/maze/handy.c,
* plug-ins/print/print-util.c, plug-ins/sinus/sinus.c,
* app/channels_dialog.c, app/fileops_cmds.c,
* app/nav_window.c, app/path_tool.c, app/scan_convert.c,
* app/xinput_airbrush.c, app/airbrush_blob.c:
On request of Martin Weber <martweb@gmx.net>.
Remove obsoletted rgb<->hsv routines, purifications.
* plug-ins/AlienMap2/AlienMap2.c: e-mail update.
2000-02-07 Kelly Lynn Martin <kelly@poverty.bloomington.in.us>
* app/interface.c: restructured toolbox to use a single

View File

@ -32,8 +32,6 @@
#include "airbrush_blob.h"
#define ROUND(A) floor((A)+0.5)
#define SUBSAMPLE 8.0
#define SU 8.0

View File

@ -656,27 +656,6 @@ channels_dialog_set_menu_sensitivity (void)
#undef SET_SENSITIVE
}
static void
channels_dialog_scroll_index (gint index)
{
GtkAdjustment *adj;
gint item_height;
item_height = 6 + (preview_size ? preview_size : channel_height);
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (channelsD->scrolled_win));
if (index * item_height < adj->value)
{
adj->value = index * item_height;
gtk_adjustment_value_changed (adj);
}
else if ((index + 1) * item_height > adj->value + adj->page_size)
{
adj->value = (index + 1) * item_height - adj->page_size;
gtk_adjustment_value_changed (adj);
}
}
static void
channels_dialog_set_channel (ChannelWidget *channel_widget)
{

View File

@ -21,6 +21,7 @@
#include "scan_convert.h"
#include "libgimp/gimpmath.h"
#include <string.h>
#ifdef DEBUG
#define TRC(x) printf x

View File

@ -390,10 +390,7 @@ update_real_view (NavWinData *iwd,
ypnt = (gint)(((gdouble)(ty)*yratio)/iwd->ratio+0.5);
if (!gdisp->dot_for_dot) /* here */
{
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
xpnt = ((gdouble)xpnt * gdisp->gimage->xresolution) / gdisp->gimage->yresolution + 0.5;
}
xoffset = xpnt - gdisp->offset_x;
yoffset = ypnt - gdisp->offset_y;

View File

@ -390,10 +390,7 @@ update_real_view (NavWinData *iwd,
ypnt = (gint)(((gdouble)(ty)*yratio)/iwd->ratio+0.5);
if (!gdisp->dot_for_dot) /* here */
{
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
xpnt = ((gdouble)xpnt * gdisp->gimage->xresolution) / gdisp->gimage->yresolution + 0.5;
}
xoffset = xpnt - gdisp->offset_x;
yoffset = ypnt - gdisp->offset_y;

View File

@ -656,27 +656,6 @@ channels_dialog_set_menu_sensitivity (void)
#undef SET_SENSITIVE
}
static void
channels_dialog_scroll_index (gint index)
{
GtkAdjustment *adj;
gint item_height;
item_height = 6 + (preview_size ? preview_size : channel_height);
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (channelsD->scrolled_win));
if (index * item_height < adj->value)
{
adj->value = index * item_height;
gtk_adjustment_value_changed (adj);
}
else if ((index + 1) * item_height > adj->value + adj->page_size)
{
adj->value = (index + 1) * item_height - adj->page_size;
gtk_adjustment_value_changed (adj);
}
}
static void
channels_dialog_set_channel (ChannelWidget *channel_widget)
{

View File

@ -390,10 +390,7 @@ update_real_view (NavWinData *iwd,
ypnt = (gint)(((gdouble)(ty)*yratio)/iwd->ratio+0.5);
if (!gdisp->dot_for_dot) /* here */
{
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
xpnt = ((gdouble)xpnt * gdisp->gimage->xresolution) / gdisp->gimage->yresolution + 0.5;
}
xoffset = xpnt - gdisp->offset_x;
yoffset = ypnt - gdisp->offset_y;

View File

@ -965,7 +965,6 @@ path_tool_button_press_handle (Tool *tool,
PathTool *path_tool = tool->private;
Path * cur_path = path_tool->cur_path;
PathSegment *p_sas;
gint grab_pointer;
#ifdef PATH_TOOL_DEBUG

View File

@ -21,6 +21,7 @@
#include "scan_convert.h"
#include "libgimp/gimpmath.h"
#include <string.h>
#ifdef DEBUG
#define TRC(x) printf x

View File

@ -32,8 +32,6 @@
#include "airbrush_blob.h"
#define ROUND(A) floor((A)+0.5)
#define SUBSAMPLE 8.0
#define SU 8.0

View File

@ -965,7 +965,6 @@ path_tool_button_press_handle (Tool *tool,
PathTool *path_tool = tool->private;
Path * cur_path = path_tool->cur_path;
PathSegment *p_sas;
gint grab_pointer;
#ifdef PATH_TOOL_DEBUG

View File

@ -849,10 +849,11 @@ static void
gboolean turn_around;
/*test*/
#ifdef GTK_HAVE_SIX_VALUATORS
double min_height;
double max_height;
double inter_height;
#endif /* GTK_HAVE_SIX_VALUATORS */
double height;
gdisp = (GDisplay *) gdisp_ptr;

View File

@ -849,10 +849,11 @@ static void
gboolean turn_around;
/*test*/
#ifdef GTK_HAVE_SIX_VALUATORS
double min_height;
double max_height;
double inter_height;
#endif /* GTK_HAVE_SIX_VALUATORS */
double height;
gdisp = (GDisplay *) gdisp_ptr;

View File

@ -1,6 +1,6 @@
/**********************************************************************
* AlienMap2 (Co-)sine color transformation plug-in (Version 1.01)
* Martin Weber (martin.weber@usa.net)
* Martin Weber (martweb@gmx.net)
**********************************************************************
* Official Homepage: http://diverse.freepage.de/martin.weber
**********************************************************************
@ -199,8 +199,8 @@ query (void)
gimp_install_procedure ("plug_in_alienmap2",
"AlienMap2 Color Transformation Plug-In",
"No help yet. Just try it and you'll see!",
"Martin Weber (martin.weber@usa.net, http://diverse.freepage.de/martin.weber)",
"Martin Weber (martin.weber@usa.net, http://diverse.freepage.de/martin.weber",
"Martin Weber (martweb@gmx.net, http://diverse.freepage.de/martin.weber)",
"Martin Weber (martweb@gmx.net, http://diverse.freepage.de/martin.weber",
"24th April 1998",
N_("<Image>/Filters/Colors/Map/Alien Map 2..."),
"RGB*",
@ -966,7 +966,7 @@ alienmap2_logo_dialog (void)
xhbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start (GTK_BOX (xvbox), xhbox, TRUE, TRUE, 0);
text = ("\nMartin Weber\n"
"martin.weber@usa.net\n"
"martweb@gmx.net\n"
"http://diverse.freepage.de/martin.weber\n\n"
"AlienMap2 Plug-In for the GIMP\n"
"Version 1.0\n");

View File

@ -58,9 +58,8 @@
#include "config.h"
#include <glib.h> /* For G_OS_WIN32 */
#ifdef G_OS_WIN32
#include <glib.h> /* For G_OS_WIN32 */
#define STRICT
#define WinMain WinMain_foo
#include <windows.h>

View File

@ -58,9 +58,8 @@
#include "config.h"
#include <glib.h> /* For G_OS_WIN32 */
#ifdef G_OS_WIN32
#include <glib.h> /* For G_OS_WIN32 */
#define STRICT
#define WinMain WinMain_foo
#include <windows.h>

View File

@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>

View File

@ -41,6 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <gtk/gtk.h>

View File

@ -3929,7 +3929,7 @@ ed_make_page_rays (GFlareEditor *ed,
NULL);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
_("Spike Thikness:"), SCALE_WIDTH, 0,
_("Spike Thickness:"), SCALE_WIDTH, 0,
gflare->rays_thickness, 1.0, 100.0, 1.0, 10.0, 1,
FALSE, 0, GIMP_MAX_IMAGE_SIZE,
NULL, NULL);

View File

@ -50,10 +50,6 @@ get_colors (GDrawable *drawable,
guint8 *fg,
guint8 *bg)
{
GParam *return_vals;
gint nreturn_vals;
switch ( gimp_drawable_type (drawable->id) )
{
case RGBA_IMAGE: /* ASSUMPTION: Assuming the user wants entire */

View File

@ -44,6 +44,8 @@
#include "print.h"
#include <libgimp/gimp.h>
#include "libgimp/gimpcolorspace.h"
#include <math.h>
/*
@ -1329,15 +1331,22 @@ indexed_to_rgb(unsigned char *indexed, /* I - Indexed pixels */
while (width > 0)
{
double h, s, v;
rgb[0] = lut->red[cmap[*indexed * 3 + 0]];
rgb[1] = lut->green[cmap[*indexed * 3 + 1]];
rgb[2] = lut->blue[cmap[*indexed * 3 + 2]];
if (vars->saturation != 1.0)
{
gimp_rgb_to_hsv4 (rgb, &h, &s, &v);
double h, s, v;
unsigned char rgb1[3];
rgb1[0] = rgb[0];
rgb1[1] = rgb[1];
rgb1[2] = rgb[2];
gimp_rgb_to_hsv4 (rgb1, &h, &s, &v);
s = pow(s, 1.0 / vars->saturation);
gimp_hsv_to_rgb (rgb, h, s, v);
gimp_hsv_to_rgb4 (rgb1, h, s, v);
rgb[0] = rgb1[0];
rgb[1] = rgb1[1];
rgb[2] = rgb1[2];
}
rgb += 3;
indexed ++;
@ -1352,7 +1361,6 @@ indexed_to_rgb(unsigned char *indexed, /* I - Indexed pixels */
while (width > 0)
{
double h, s, v;
rgb[0] = lut->red[cmap[indexed[0] * 3 + 0] * indexed[1] / 255 +
255 - indexed[1]];
rgb[1] = lut->green[cmap[indexed[0] * 3 + 1] * indexed[1] / 255 +
@ -1361,9 +1369,17 @@ indexed_to_rgb(unsigned char *indexed, /* I - Indexed pixels */
255 - indexed[1]];
if (vars->saturation != 1.0)
{
gimp_rgb_to_hsv4 (rgb, &h, &s, &v);
double h, s, v;
unsigned char rgb1[3];
rgb1[0] = rgb[0];
rgb1[1] = rgb[1];
rgb1[2] = rgb[2];
gimp_rgb_to_hsv4 (rgb1, &h, &s, &v);
s = pow(s, 1.0 / vars->saturation);
gimp_hsv_to_rgb4 (rgb, h, s, v);
gimp_hsv_to_rgb4 (rgb1, h, s, v);
rgb[0] = rgb1[0];
rgb[1] = rgb1[1];
rgb[2] = rgb1[2];
}
rgb += 3;
indexed += bpp;
@ -1445,13 +1461,17 @@ rgb_to_rgb(unsigned char *rgbin, /* I - RGB pixels */
while (width > 0)
{
double h, s, v;
rgbout[0] = lut->red[rgbin[0]];
rgbout[1] = lut->green[rgbin[1]];
rgbout[2] = lut->blue[rgbin[2]];
if (vars->saturation != 1.0 || vars->contrast != 100)
{
gimp_rgb_to_hsv4 (rgbout, &h, &s, &v);
double h, s, v;
unsigned char rgb1[3];
rgb1[0] = rgbout[0];
rgb1[1] = rgbout[1];
rgb1[2] = rgbout[2];
gimp_rgb_to_hsv4 (rgb1, &h, &s, &v);
if (vars->saturation != 1.0)
s = pow(s, 1.0 / vars->saturation);
#if 0
@ -1465,7 +1485,10 @@ rgb_to_rgb(unsigned char *rgbin, /* I - RGB pixels */
v = (tv / 2.0) + .5;
}
#endif
gimp_hsv_to_rgb4 (rgbout, h, s, v);
gimp_hsv_to_rgb4 (rgb1, h, s, v);
rgbout[0] = rgb1[0];
rgbout[1] = rgb1[1];
rgbout[2] = rgb1[2];
}
if (vars->density != 1.0)
{
@ -1493,14 +1516,18 @@ rgb_to_rgb(unsigned char *rgbin, /* I - RGB pixels */
while (width > 0)
{
double h, s, v;
rgbout[0] = lut->red[rgbin[0] * rgbin[3] / 255 + 255 - rgbin[3]];
rgbout[1] = lut->green[rgbin[1] * rgbin[3] / 255 + 255 - rgbin[3]];
rgbout[2] = lut->blue[rgbin[2] * rgbin[3] / 255 + 255 - rgbin[3]];
if (vars->saturation != 1.0 || vars->contrast != 100 ||
vars->density != 1.0)
{
gimp_rgb_to_hsv4 (rgbout, &h, &s, &v);
double h, s, v;
unsigned char rgb1[3];
rgb1[0] = rgbout[0];
rgb1[1] = rgbout[1];
rgb1[2] = rgbout[2];
gimp_rgb_to_hsv4 (rgb1, &h, &s, &v);
if (vars->saturation != 1.0)
s = pow(s, 1.0 / vars->saturation);
#if 0
@ -1514,7 +1541,10 @@ rgb_to_rgb(unsigned char *rgbin, /* I - RGB pixels */
v = (tv / 2.0) + .5;
}
#endif
gimp_hsv_to_rgb4 (rgbout, h, s, v);
gimp_hsv_to_rgb4 (rgb1, h, s, v);
rgbout[0] = rgb1[0];
rgbout[1] = rgb1[1];
rgbout[2] = rgb1[2];
}
if (vars->density != 1.0)
{

View File

@ -864,8 +864,8 @@ sinus_dialog (void)
gtk_widget_show (label);
spinbutton = gimp_spin_button_new (&adj, svals.seed,
-10000000000, 1000000000, 1, 10,
0, 0, 0);
-10000000000.0, 1000000000.0, 1.0, 10.0,
0.0, 0.0, 0);
gtk_widget_set_usize (spinbutton, 100, -1);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",