Commit 69d92241 authored by jaycox's avatar jaycox
Browse files

----------------------------------------------------------------------

```-------------------------------------------------------------------
 Modified Files:
 	ChangeLog app/Makefile.am app/brush_select.c app/gimpbrush.c
 	app/gimpbrush.h app/gimpbrushgenerated.c app/gimpbrushlist.c
 	app/gimplist.c app/paint_core.c app/paint_core.h
    added axis to brushes.  paint_core now references a brush instead
    of a mask.  cleaned up some [brush]list removal stuff.


 Added Files:
 	app/vector2d.c app/vector2d.h
    very basic vector math struct/functions.
```

-------------------------------------------------------------------
parent cb8a1d02
Fri Jul 24 01:33:13 PDT 1998 Jay Cox <jaycox@earthlink.net>
* app/vector2d.[ch] Makefile.am: new files for vector math.
Very minimal.
* gimpbrush.[ch]: added support for brush axis.
* paint_core.[ch]: replaced the mask field with a brush field.
modified paint_core_interpolate to use brush axis.
* gimpbrushlist.c: modified gimp_list_destroy.
* gimpbrushlist.c: fixed some broken brush removal stuff.
Thu Jul 23 21:57:25 CDT 1998 Shawn T. Amundson <amundson@gimp.org> Thu Jul 23 21:57:25 CDT 1998 Shawn T. Amundson <amundson@gimp.org>
* app/interface.c: usize statusbar to 1 width * app/interface.c: usize statusbar to 1 width
......
...@@ -293,6 +293,8 @@ gimp_SOURCES = \ ...@@ -293,6 +293,8 @@ gimp_SOURCES = \
undo_cmds.c \ undo_cmds.c \
undo_cmds.h \ undo_cmds.h \
wilber.h \ wilber.h \
vector2d.c \
vector2d.h \
xcf.c \ xcf.c \
xcf.h xcf.h
......
...@@ -353,7 +353,8 @@ brush_select_select (BrushSelectP bsp, ...@@ -353,7 +353,8 @@ brush_select_select (BrushSelectP bsp,
int index) int index)
{ {
int row, col; int row, col;
if (index < 0)
return;
update_active_brush_field (bsp); update_active_brush_field (bsp);
row = index / NUM_BRUSH_COLUMNS; row = index / NUM_BRUSH_COLUMNS;
col = index - row * NUM_BRUSH_COLUMNS; col = index - row * NUM_BRUSH_COLUMNS;
...@@ -950,6 +951,8 @@ preview_scroll_update (GtkAdjustment *adjustment, ...@@ -950,6 +951,8 @@ preview_scroll_update (GtkAdjustment *adjustment,
if (active) if (active)
{ {
index = gimp_brush_list_get_brush_index(brush_list, active); index = gimp_brush_list_get_brush_index(brush_list, active);
if (index < 0)
return;
row = index / NUM_BRUSH_COLUMNS; row = index / NUM_BRUSH_COLUMNS;
col = index - row * NUM_BRUSH_COLUMNS; col = index - row * NUM_BRUSH_COLUMNS;
brush_select_show_selected (bsp, row, col); brush_select_show_selected (bsp, row, col);
......
...@@ -78,6 +78,10 @@ gimp_brush_init(GimpBrush *brush) ...@@ -78,6 +78,10 @@ gimp_brush_init(GimpBrush *brush)
brush->name = NULL; brush->name = NULL;
brush->spacing = 20; brush->spacing = 20;
brush->mask = NULL; brush->mask = NULL;
brush->x_axis.x = 15.0;
brush->x_axis.y = 0.0;
brush->y_axis.x = 0.0;
brush->y_axis.y = 15.0;
} }
GtkType gimp_brush_get_type(void) GtkType gimp_brush_get_type(void)
...@@ -208,7 +212,11 @@ gimp_brush_load(GimpBrush *brush, char *filename) ...@@ -208,7 +212,11 @@ gimp_brush_load(GimpBrush *brush, char *filename)
brush->mask = temp_buf_new (header.width, header.height, header.bytes, brush->mask = temp_buf_new (header.width, header.height, header.bytes,
0, 0, NULL); 0, 0, NULL);
brush->spacing = header.spacing; brush->spacing = header.spacing;
/* set up spacing axis */
brush->x_axis.x = header.width / 2.0;
brush->x_axis.y = 0.0;
brush->y_axis.x = 0.0;
brush->y_axis.y = header.height / 2.0;
/* Read the brush mask data */ /* Read the brush mask data */
if ((fread (temp_buf_data (brush->mask), 1, header.width * header.height, if ((fread (temp_buf_data (brush->mask), 1, header.width * header.height,
fp)) < header.width * header.height) fp)) < header.width * header.height)
......
...@@ -78,6 +78,10 @@ gimp_brush_init(GimpBrush *brush) ...@@ -78,6 +78,10 @@ gimp_brush_init(GimpBrush *brush)
brush->name = NULL; brush->name = NULL;
brush->spacing = 20; brush->spacing = 20;
brush->mask = NULL; brush->mask = NULL;
brush->x_axis.x = 15.0;
brush->x_axis.y = 0.0;
brush->y_axis.x = 0.0;
brush->y_axis.y = 15.0;
} }
GtkType gimp_brush_get_type(void) GtkType gimp_brush_get_type(void)
...@@ -208,7 +212,11 @@ gimp_brush_load(GimpBrush *brush, char *filename) ...@@ -208,7 +212,11 @@ gimp_brush_load(GimpBrush *brush, char *filename)
brush->mask = temp_buf_new (header.width, header.height, header.bytes, brush->mask = temp_buf_new (header.width, header.height, header.bytes,
0, 0, NULL); 0, 0, NULL);
brush->spacing = header.spacing; brush->spacing = header.spacing;
/* set up spacing axis */
brush->x_axis.x = header.width / 2.0;
brush->x_axis.y = 0.0;
brush->y_axis.x = 0.0;
brush->y_axis.y = header.height / 2.0;
/* Read the brush mask data */ /* Read the brush mask data */
if ((fread (temp_buf_data (brush->mask), 1, header.width * header.height, if ((fread (temp_buf_data (brush->mask), 1, header.width * header.height,
fp)) < header.width * header.height) fp)) < header.width * header.height)
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "gimpobjectP.h" #include "gimpobjectP.h"
#include "temp_buf.h" #include "temp_buf.h"
#include "vector2d.h"
typedef struct _GimpBrush GimpBrush, * GimpBrushP; typedef struct _GimpBrush GimpBrush, * GimpBrushP;
...@@ -30,6 +31,8 @@ struct _GimpBrush ...@@ -30,6 +31,8 @@ struct _GimpBrush
char * filename; /* actual filename--brush's location on disk */ char * filename; /* actual filename--brush's location on disk */
char * name; /* brush's name--for brush selection dialog */ char * name; /* brush's name--for brush selection dialog */
int spacing; /* brush's spacing */ int spacing; /* brush's spacing */
vector2d x_axis; /* for calculating brush spacing */
vector2d y_axis; /* for calculating brush spacing */
TempBuf * mask; /* the actual mask... */ TempBuf * mask; /* the actual mask... */
}; };
......
...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush) ...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush)
if (brush->freeze == 0) if (brush->freeze == 0)
gimp_brush_generated_generate(brush); gimp_brush_generated_generate(brush);
} }
static
double gauss(double f)
{ /* this aint' a real gauss function */
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
f = 1.0 -f;
return (2.0*f*f);
}
void void
gimp_brush_generated_generate(GimpBrushGenerated *brush) gimp_brush_generated_generate(GimpBrushGenerated *brush)
...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
height = ceil(ty); height = ceil(ty);
else else
height = ceil(brush->radius); height = ceil(brush->radius);
/* compute the axis for spacing */
GIMP_BRUSH(brush)->x_axis.x = c*brush->radius;
GIMP_BRUSH(brush)->x_axis.y = -1.0*s*brush->radius;
GIMP_BRUSH(brush)->y_axis.x = (s*brush->radius / brush->aspect_ratio);
GIMP_BRUSH(brush)->y_axis.y = (c*brush->radius / brush->aspect_ratio);
gbrush->mask = temp_buf_new(width*2 + 1, gbrush->mask = temp_buf_new(width*2 + 1,
height*2 + 1, height*2 + 1,
1, width, height, 0); 1, width, height, 0);
...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x] = 0.0; buffer[x] = 0.0;
else else
buffer[x] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x]; sum += buffer[x];
} }
for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING) for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING)
...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x%OVERSAMPLING] = 0.0; buffer[x%OVERSAMPLING] = 0.0;
else else
buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x%OVERSAMPLING] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING]; sum += buffer[x%OVERSAMPLING];
lookup[x++] = rint(sum*(255.0/OVERSAMPLING)); lookup[x++] = rint(sum*(255.0/OVERSAMPLING));
} }
......
...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush) ...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush)
if (brush->freeze == 0) if (brush->freeze == 0)
gimp_brush_generated_generate(brush); gimp_brush_generated_generate(brush);
} }
static
double gauss(double f)
{ /* this aint' a real gauss function */
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
f = 1.0 -f;
return (2.0*f*f);
}
void void
gimp_brush_generated_generate(GimpBrushGenerated *brush) gimp_brush_generated_generate(GimpBrushGenerated *brush)
...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
height = ceil(ty); height = ceil(ty);
else else
height = ceil(brush->radius); height = ceil(brush->radius);
/* compute the axis for spacing */
GIMP_BRUSH(brush)->x_axis.x = c*brush->radius;
GIMP_BRUSH(brush)->x_axis.y = -1.0*s*brush->radius;
GIMP_BRUSH(brush)->y_axis.x = (s*brush->radius / brush->aspect_ratio);
GIMP_BRUSH(brush)->y_axis.y = (c*brush->radius / brush->aspect_ratio);
gbrush->mask = temp_buf_new(width*2 + 1, gbrush->mask = temp_buf_new(width*2 + 1,
height*2 + 1, height*2 + 1,
1, width, height, 0); 1, width, height, 0);
...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x] = 0.0; buffer[x] = 0.0;
else else
buffer[x] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x]; sum += buffer[x];
} }
for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING) for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING)
...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x%OVERSAMPLING] = 0.0; buffer[x%OVERSAMPLING] = 0.0;
else else
buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x%OVERSAMPLING] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING]; sum += buffer[x%OVERSAMPLING];
lookup[x++] = rint(sum*(255.0/OVERSAMPLING)); lookup[x++] = rint(sum*(255.0/OVERSAMPLING));
} }
......
...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush) ...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush)
if (brush->freeze == 0) if (brush->freeze == 0)
gimp_brush_generated_generate(brush); gimp_brush_generated_generate(brush);
} }
static
double gauss(double f)
{ /* this aint' a real gauss function */
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
f = 1.0 -f;
return (2.0*f*f);
}
void void
gimp_brush_generated_generate(GimpBrushGenerated *brush) gimp_brush_generated_generate(GimpBrushGenerated *brush)
...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
height = ceil(ty); height = ceil(ty);
else else
height = ceil(brush->radius); height = ceil(brush->radius);
/* compute the axis for spacing */
GIMP_BRUSH(brush)->x_axis.x = c*brush->radius;
GIMP_BRUSH(brush)->x_axis.y = -1.0*s*brush->radius;
GIMP_BRUSH(brush)->y_axis.x = (s*brush->radius / brush->aspect_ratio);
GIMP_BRUSH(brush)->y_axis.y = (c*brush->radius / brush->aspect_ratio);
gbrush->mask = temp_buf_new(width*2 + 1, gbrush->mask = temp_buf_new(width*2 + 1,
height*2 + 1, height*2 + 1,
1, width, height, 0); 1, width, height, 0);
...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x] = 0.0; buffer[x] = 0.0;
else else
buffer[x] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x]; sum += buffer[x];
} }
for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING) for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING)
...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x%OVERSAMPLING] = 0.0; buffer[x%OVERSAMPLING] = 0.0;
else else
buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x%OVERSAMPLING] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING]; sum += buffer[x%OVERSAMPLING];
lookup[x++] = rint(sum*(255.0/OVERSAMPLING)); lookup[x++] = rint(sum*(255.0/OVERSAMPLING));
} }
......
...@@ -38,13 +38,9 @@ static void ...@@ -38,13 +38,9 @@ static void
gimp_list_destroy (GtkObject* ob) gimp_list_destroy (GtkObject* ob)
{ {
GimpList* list=GIMP_LIST(ob); GimpList* list=GIMP_LIST(ob);
GSList* node; while(list->list) /* ought to put a sanity check in here... */
for(node=list->list;node;node=node->next){ {
if(!list->weak) gimp_list_remove(list, list->list->data);
gtk_object_unref(GTK_OBJECT(node->data));
gtk_signal_emit (GTK_OBJECT(list),
gimp_list_signals[REMOVE],
node->data);
} }
g_slist_free(list->list); g_slist_free(list->list);
GTK_OBJECT_CLASS(parent_class)->destroy (ob); GTK_OBJECT_CLASS(parent_class)->destroy (ob);
...@@ -68,12 +64,10 @@ gimp_list_class_init (GimpListClass* klass) ...@@ -68,12 +64,10 @@ gimp_list_class_init (GimpListClass* klass)
object_class->destroy = gimp_list_destroy; object_class->destroy = gimp_list_destroy;
gimp_list_signals[ADD]= gimp_list_signals[ADD]=
gimp_signal_new ("add", GTK_RUN_FIRST, type, gimp_signal_new ("add", GTK_RUN_FIRST, type, 0,
GTK_SIGNAL_OFFSET (GimpListClass, add),
gimp_sigtype_pointer); gimp_sigtype_pointer);
gimp_list_signals[REMOVE]= gimp_list_signals[REMOVE]=
gimp_signal_new ("remove", GTK_RUN_FIRST, type, gimp_signal_new ("remove", GTK_RUN_FIRST, type, 0,
GTK_SIGNAL_OFFSET (GimpListClass, remove),
gimp_sigtype_pointer); gimp_sigtype_pointer);
gtk_object_class_add_signals (object_class, gtk_object_class_add_signals (object_class,
gimp_list_signals, gimp_list_signals,
...@@ -137,6 +131,8 @@ gimp_list_add (GimpList* list, gpointer val) ...@@ -137,6 +131,8 @@ gimp_list_add (GimpList* list, gpointer val)
else else
gtk_object_ref(GTK_OBJECT(val)); gtk_object_ref(GTK_OBJECT(val));
GIMP_LIST_CLASS(GTK_OBJECT(list)->klass)->add(list, val);
gtk_signal_emit (GTK_OBJECT(list), gimp_list_signals[ADD], val); gtk_signal_emit (GTK_OBJECT(list), gimp_list_signals[ADD], val);
return TRUE; return TRUE;
} }
...@@ -147,8 +143,11 @@ gimp_list_remove (GimpList* list, gpointer val) ...@@ -147,8 +143,11 @@ gimp_list_remove (GimpList* list, gpointer val)
g_return_val_if_fail(list, FALSE); g_return_val_if_fail(list, FALSE);
if(!g_slist_find(list->list, val)) if(!g_slist_find(list->list, val))
return FALSE; {
printf("can't find val\n");
return FALSE;
}
GIMP_LIST_CLASS(GTK_OBJECT(list)->klass)->remove(list, val);
gtk_signal_emit (GTK_OBJECT(list), gimp_list_signals[REMOVE], val); gtk_signal_emit (GTK_OBJECT(list), gimp_list_signals[REMOVE], val);
......
...@@ -78,6 +78,10 @@ gimp_brush_init(GimpBrush *brush) ...@@ -78,6 +78,10 @@ gimp_brush_init(GimpBrush *brush)
brush->name = NULL; brush->name = NULL;
brush->spacing = 20; brush->spacing = 20;
brush->mask = NULL; brush->mask = NULL;
brush->x_axis.x = 15.0;
brush->x_axis.y = 0.0;
brush->y_axis.x = 0.0;
brush->y_axis.y = 15.0;
} }
GtkType gimp_brush_get_type(void) GtkType gimp_brush_get_type(void)
...@@ -208,7 +212,11 @@ gimp_brush_load(GimpBrush *brush, char *filename) ...@@ -208,7 +212,11 @@ gimp_brush_load(GimpBrush *brush, char *filename)
brush->mask = temp_buf_new (header.width, header.height, header.bytes, brush->mask = temp_buf_new (header.width, header.height, header.bytes,
0, 0, NULL); 0, 0, NULL);
brush->spacing = header.spacing; brush->spacing = header.spacing;
/* set up spacing axis */
brush->x_axis.x = header.width / 2.0;
brush->x_axis.y = 0.0;
brush->y_axis.x = 0.0;
brush->y_axis.y = header.height / 2.0;
/* Read the brush mask data */ /* Read the brush mask data */
if ((fread (temp_buf_data (brush->mask), 1, header.width * header.height, if ((fread (temp_buf_data (brush->mask), 1, header.width * header.height,
fp)) < header.width * header.height) fp)) < header.width * header.height)
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "gimpobjectP.h" #include "gimpobjectP.h"
#include "temp_buf.h" #include "temp_buf.h"
#include "vector2d.h"
typedef struct _GimpBrush GimpBrush, * GimpBrushP; typedef struct _GimpBrush GimpBrush, * GimpBrushP;
...@@ -30,6 +31,8 @@ struct _GimpBrush ...@@ -30,6 +31,8 @@ struct _GimpBrush
char * filename; /* actual filename--brush's location on disk */ char * filename; /* actual filename--brush's location on disk */
char * name; /* brush's name--for brush selection dialog */ char * name; /* brush's name--for brush selection dialog */
int spacing; /* brush's spacing */ int spacing; /* brush's spacing */
vector2d x_axis; /* for calculating brush spacing */
vector2d y_axis; /* for calculating brush spacing */
TempBuf * mask; /* the actual mask... */ TempBuf * mask; /* the actual mask... */
}; };
......
...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush) ...@@ -199,6 +199,19 @@ gimp_brush_generated_thaw(GimpBrushGenerated *brush)
if (brush->freeze == 0) if (brush->freeze == 0)
gimp_brush_generated_generate(brush); gimp_brush_generated_generate(brush);
} }
static
double gauss(double f)
{ /* this aint' a real gauss function */
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
f = 1.0 -f;
return (2.0*f*f);
}
void void
gimp_brush_generated_generate(GimpBrushGenerated *brush) gimp_brush_generated_generate(GimpBrushGenerated *brush)
...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -243,7 +256,13 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
height = ceil(ty); height = ceil(ty);
else else
height = ceil(brush->radius); height = ceil(brush->radius);
/* compute the axis for spacing */
GIMP_BRUSH(brush)->x_axis.x = c*brush->radius;
GIMP_BRUSH(brush)->x_axis.y = -1.0*s*brush->radius;
GIMP_BRUSH(brush)->y_axis.x = (s*brush->radius / brush->aspect_ratio);
GIMP_BRUSH(brush)->y_axis.y = (c*brush->radius / brush->aspect_ratio);
gbrush->mask = temp_buf_new(width*2 + 1, gbrush->mask = temp_buf_new(width*2 + 1,
height*2 + 1, height*2 + 1,
1, width, height, 0); 1, width, height, 0);
...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -262,7 +281,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x] = 0.0; buffer[x] = 0.0;
else else
buffer[x] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x]; sum += buffer[x];
} }
for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING) for (x = 0; d < brush->radius || sum > .00001; d += 1.0/OVERSAMPLING)
...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush) ...@@ -271,7 +291,8 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
if (d > brush->radius) if (d > brush->radius)
buffer[x%OVERSAMPLING] = 0.0; buffer[x%OVERSAMPLING] = 0.0;
else else
buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent)); /* buffer[x%OVERSAMPLING] = (1.0 - pow(d/brush->radius, exponent));*/
buffer[x%OVERSAMPLING] = gauss(pow(d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING]; sum += buffer[x%OVERSAMPLING];
lookup[x++] = rint(sum*(255.0/OVERSAMPLING)); lookup[x++] = rint(sum*(255.0/OVERSAMPLING));
} }
......
...@@ -76,7 +76,7 @@ gimp_brush_list_add_func(GimpList* list, gpointer val) ...@@ -76,7 +76,7 @@ gimp_brush_list_add_func(GimpList* list, gpointer val)
} }