added "gboolean reverse" to gimp_gradient_get_color_at() so all gradients

2003-07-22  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpgradient.[ch]: added "gboolean reverse" to
	gimp_gradient_get_color_at() so all gradients can be used
	reversed.

	* app/core/gimpdrawable-blend.[ch] (gimp_drawable_blend)
	* app/core/gimppalette-import.[ch] (gimp_palette_import_from_gradient):
	added "gboolean reverse".

	* app/paint/paint-enums.[ch]: removed enum GimpGradientRepeatMode
	since it is identical to GimpRepeatMode, except for the now
	obsolete ONCE_BACKWARD value.

	* app/paint/gimppaintcore.[ch]: removed
	gimp_paint_core_get_color_from_gradient()...

	* app/paint/gimppaintoptions.[ch]: ...and added
	gimp_paint_options_get_gradient_color(), which is much more
	general. Added a "reverse" property to GimpGradientOptions and
	changed the type of the "repeat" property to GimpRepeatMode.

	* app/paint/gimppaintbrush.c: use
	gimp_paint_options_get_gradient_color().

	* app/tools/gimpblendoptions.[ch]: removed the "repeat" property
	since it is in the parent class now.

	* app/gui/gradient-select.c
	* app/gui/palette-import-dialog.c
	* app/widgets/gimpgradienteditor.c
	* app/tools/gimpblendtool.c
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/misc_tools.pdb: changed accordingly.

	* app/tools/gimppaintoptions-gui.c: added a "Reverse" toggle right
	of the gradient preview.

	* app/widgets/gimppreviewrenderergradient.[ch]: added "gboolean
	reverse" member and gimp_preview_renderer_gradient_set_reverse()
	API.

	* tools/pdbgen/pdb/paint_tools.pdb: fixed the paintbrush invoker
	to set GimpPaintOption's "use-fade" and "use-gradient" properties
	correctly.

	* app/pdb/gradients_cmds.c
	* app/pdb/misc_tools_cmds.c
	* app/pdb/paint_tools_cmds.c
	* libgimp/gimpenums.h
	* libgimp/gimpmisctools_pdb.[ch]
	* plug-ins/pygimp/gimpenums.py
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.

	* libgimp/gimpcompat.h
	* plug-ins/script-fu/siod-wrapper.c: removed GimpGradientPaintMode
	here too since it was only exported accidentially (it's not used
	by any external API).

	* plug-ins/script-fu/scripts/3dTruchet.scm
	* plug-ins/script-fu/scripts/alien-glow-arrow.scm
	* plug-ins/script-fu/scripts/alien-glow-bar.scm
	* plug-ins/script-fu/scripts/alien-glow-bullet.scm
	* plug-ins/script-fu/scripts/alien-glow-button.scm
	* plug-ins/script-fu/scripts/alien-glow-logo.scm
	* plug-ins/script-fu/scripts/basic1-logo.scm
	* plug-ins/script-fu/scripts/basic2-logo.scm
	* plug-ins/script-fu/scripts/beveled-button.scm
	* plug-ins/script-fu/scripts/blended-logo.scm
	* plug-ins/script-fu/scripts/burn-in-anim.scm
	* plug-ins/script-fu/scripts/coffee.scm
	* plug-ins/script-fu/scripts/comic-logo.scm
	* plug-ins/script-fu/scripts/coolmetal-logo.scm
	* plug-ins/script-fu/scripts/glossy.scm
	* plug-ins/script-fu/scripts/gradient-bevel-logo.scm
	* plug-ins/script-fu/scripts/gradient-example.scm
	* plug-ins/script-fu/scripts/pupi-button.scm
	* plug-ins/script-fu/scripts/rendermap.scm
	* plug-ins/script-fu/scripts/sphere.scm
	* plug-ins/script-fu/scripts/starscape-logo.scm
	* plug-ins/script-fu/scripts/test-sphere.scm
	* plug-ins/script-fu/scripts/textured-logo.scm
	* plug-ins/script-fu/scripts/title-header.scm
	* plug-ins/script-fu/scripts/weave.scm: pass "reverse" to
	gimp_blend(). Pass FALSE in most cases and added script
	parameters were it makes sense.
This commit is contained in:
Michael Natterer 2003-07-22 14:24:11 +00:00 committed by Michael Natterer
parent a1d33d15c4
commit 075195d16b
63 changed files with 1451 additions and 1126 deletions

View File

@ -1,3 +1,91 @@
2003-07-22 Michael Natterer <mitch@gimp.org>
* app/core/gimpgradient.[ch]: added "gboolean reverse" to
gimp_gradient_get_color_at() so all gradients can be used
reversed.
* app/core/gimpdrawable-blend.[ch] (gimp_drawable_blend)
* app/core/gimppalette-import.[ch] (gimp_palette_import_from_gradient):
added "gboolean reverse".
* app/paint/paint-enums.[ch]: removed enum GimpGradientRepeatMode
since it is identical to GimpRepeatMode, except for the now
obsolete ONCE_BACKWARD value.
* app/paint/gimppaintcore.[ch]: removed
gimp_paint_core_get_color_from_gradient()...
* app/paint/gimppaintoptions.[ch]: ...and added
gimp_paint_options_get_gradient_color(), which is much more
general. Added a "reverse" property to GimpGradientOptions and
changed the type of the "repeat" property to GimpRepeatMode.
* app/paint/gimppaintbrush.c: use
gimp_paint_options_get_gradient_color().
* app/tools/gimpblendoptions.[ch]: removed the "repeat" property
since it is in the parent class now.
* app/gui/gradient-select.c
* app/gui/palette-import-dialog.c
* app/widgets/gimpgradienteditor.c
* app/tools/gimpblendtool.c
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/misc_tools.pdb: changed accordingly.
* app/tools/gimppaintoptions-gui.c: added a "Reverse" toggle right
of the gradient preview.
* app/widgets/gimppreviewrenderergradient.[ch]: added "gboolean
reverse" member and gimp_preview_renderer_gradient_set_reverse()
API.
* tools/pdbgen/pdb/paint_tools.pdb: fixed the paintbrush invoker
to set GimpPaintOption's "use-fade" and "use-gradient" properties
correctly.
* app/pdb/gradients_cmds.c
* app/pdb/misc_tools_cmds.c
* app/pdb/paint_tools_cmds.c
* libgimp/gimpenums.h
* libgimp/gimpmisctools_pdb.[ch]
* plug-ins/pygimp/gimpenums.py
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
* libgimp/gimpcompat.h
* plug-ins/script-fu/siod-wrapper.c: removed GimpGradientPaintMode
here too since it was only exported accidentially (it's not used
by any external API).
* plug-ins/script-fu/scripts/3dTruchet.scm
* plug-ins/script-fu/scripts/alien-glow-arrow.scm
* plug-ins/script-fu/scripts/alien-glow-bar.scm
* plug-ins/script-fu/scripts/alien-glow-bullet.scm
* plug-ins/script-fu/scripts/alien-glow-button.scm
* plug-ins/script-fu/scripts/alien-glow-logo.scm
* plug-ins/script-fu/scripts/basic1-logo.scm
* plug-ins/script-fu/scripts/basic2-logo.scm
* plug-ins/script-fu/scripts/beveled-button.scm
* plug-ins/script-fu/scripts/blended-logo.scm
* plug-ins/script-fu/scripts/burn-in-anim.scm
* plug-ins/script-fu/scripts/coffee.scm
* plug-ins/script-fu/scripts/comic-logo.scm
* plug-ins/script-fu/scripts/coolmetal-logo.scm
* plug-ins/script-fu/scripts/glossy.scm
* plug-ins/script-fu/scripts/gradient-bevel-logo.scm
* plug-ins/script-fu/scripts/gradient-example.scm
* plug-ins/script-fu/scripts/pupi-button.scm
* plug-ins/script-fu/scripts/rendermap.scm
* plug-ins/script-fu/scripts/sphere.scm
* plug-ins/script-fu/scripts/starscape-logo.scm
* plug-ins/script-fu/scripts/test-sphere.scm
* plug-ins/script-fu/scripts/textured-logo.scm
* plug-ins/script-fu/scripts/title-header.scm
* plug-ins/script-fu/scripts/weave.scm: pass "reverse" to
gimp_blend(). Pass FALSE in most cases and added script
parameters were it makes sense.
2003-07-22 Jakub Steiner <jimmac@ximian.com>
* data/images/gimp_splash.png: special Gimpcon splash

View File

@ -50,6 +50,7 @@ typedef gdouble (* BlendRepeatFunc) (gdouble);
typedef struct
{
GimpGradient *gradient;
gboolean reverse;
gdouble offset;
gdouble sx, sy;
GimpBlendMode blend_mode;
@ -120,7 +121,7 @@ static gdouble gradient_repeat_sawtooth (gdouble val);
static gdouble gradient_repeat_triangular (gdouble val);
static void gradient_precalc_shapeburst (GimpImage *gimage,
GimpDrawable *drawable,
GimpDrawable *drawable,
PixelRegion *PR,
gdouble dist);
@ -142,7 +143,8 @@ static void gradient_fill_region (GimpImage *gimage,
GimpGradientType gradient_type,
gdouble offset,
GimpRepeatMode repeat,
gint supersample,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
@ -171,23 +173,24 @@ static PixelRegion distR =
/* public functions */
void
gimp_drawable_blend (GimpDrawable *drawable,
GimpBlendMode blend_mode,
int paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gint supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble startx,
gdouble starty,
gdouble endx,
gdouble endy,
GimpProgressFunc progress_callback,
gpointer progress_data)
gimp_drawable_blend (GimpDrawable *drawable,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble startx,
gdouble starty,
gdouble endx,
gdouble endy,
GimpProgressFunc progress_callback,
gpointer progress_data)
{
GimpImage *gimage;
TileManager *buf_tiles;
@ -222,7 +225,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
gradient_fill_region (gimage, drawable,
&bufPR, (x2 - x1), (y2 - y1),
blend_mode, gradient_type, offset, repeat,
blend_mode, gradient_type, offset, repeat, reverse,
supersample, max_depth, threshold, dither,
(startx - x1), (starty - y1),
(endx - x1), (endy - y1),
@ -684,9 +687,9 @@ gradient_precalc_shapeburst (GimpImage *gimage,
static void
gradient_render_pixel (double x,
double y,
GimpRGB *color,
gradient_render_pixel (double x,
double y,
GimpRGB *color,
gpointer render_data)
{
RenderBlendData *rbd;
@ -763,12 +766,15 @@ gradient_render_pixel (double x,
if (rbd->blend_mode == GIMP_CUSTOM_MODE)
{
gimp_gradient_get_color_at (rbd->gradient, factor, color);
gimp_gradient_get_color_at (rbd->gradient, factor, rbd->reverse, color);
}
else
{
/* Blend values */
if (rbd->reverse)
factor = 1.0 - factor;
color->r = rbd->fg.r + (rbd->bg.r - rbd->fg.r) * factor;
color->g = rbd->fg.g + (rbd->bg.g - rbd->fg.g) * factor;
color->b = rbd->fg.b + (rbd->bg.b - rbd->fg.b) * factor;
@ -786,9 +792,9 @@ gradient_render_pixel (double x,
}
static void
gradient_put_pixel (int x,
int y,
GimpRGB *color,
gradient_put_pixel (int x,
int y,
GimpRGB *color,
void *put_pixel_data)
{
PutPixelData *ppd;
@ -823,13 +829,13 @@ gradient_put_pixel (int x,
ftmp = color->b * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
if(g_rand_double (ppd->dither_rand) < dither_prob)
if (g_rand_double (ppd->dither_rand) < dither_prob)
color->b += (1.0 / 255.0);
ftmp = color->a * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
if(g_rand_double (ppd->dither_rand) < dither_prob)
if (g_rand_double (ppd->dither_rand) < dither_prob)
color->a += (1.0 / 255.0);
if (color->r > 1.0) color->r = 1.0;
@ -847,25 +853,25 @@ gradient_put_pixel (int x,
{
/* Convert to grayscale */
gdouble gray = INTENSITY (color->r, color->g, color->b);
if (ppd->dither)
{
gdouble dither_prob;
gdouble ftmp;
gint itmp;
ftmp = gray * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
if (g_rand_double (ppd->dither_rand) < dither_prob)
gray += (1.0 / 255.0);
ftmp = color->a * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
if (g_rand_double (ppd->dither_rand) < dither_prob)
color->a += (1.0 / 255.0);
if (color->a > 1.0) color->a = 1.0;
}
@ -889,7 +895,8 @@ gradient_fill_region (GimpImage *gimage,
GimpGradientType gradient_type,
gdouble offset,
GimpRepeatMode repeat,
gint supersample,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
@ -913,6 +920,7 @@ gradient_fill_region (GimpImage *gimage,
context = gimp_get_current_context (gimage->gimp);
rbd.gradient = gimp_context_get_gradient (context);
rbd.reverse = reverse;
/* Get foreground and background colors, normalized */
@ -1080,7 +1088,7 @@ gradient_fill_region (GimpImage *gimage,
gdouble dither_prob;
gdouble ftmp;
gint itmp;
ftmp = color.r * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
@ -1104,7 +1112,7 @@ gradient_fill_region (GimpImage *gimage,
dither_prob = ftmp - itmp;
if (g_rand_double (dither_rand) < dither_prob)
color.a += (1.0 / 255.0);
if (color.r > 1.0) color.r = 1.0;
if (color.g > 1.0) color.g = 1.0;
if (color.b > 1.0) color.b = 1.0;
@ -1120,25 +1128,25 @@ gradient_fill_region (GimpImage *gimage,
{
/* Convert to grayscale */
gdouble gray = INTENSITY (color.r, color.g, color.b);
if (dither)
{
gdouble dither_prob;
gdouble ftmp;
gint itmp;
ftmp = gray * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
if (g_rand_double (dither_rand) < dither_prob)
gray += (1.0 / 255.0);
ftmp = color.a * 255.0;
itmp = ftmp;
dither_prob = ftmp - itmp;
if (g_rand_double (dither_rand) < dither_prob)
color.a += (1.0 / 255.0);
if (color.a > 1.0) color.a = 1.0;
}

View File

@ -20,23 +20,24 @@
#define __GIMP_DRAWABLE_BLEND_H__
void gimp_drawable_blend (GimpDrawable *drawable,
GimpBlendMode blend_mode,
gint paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gint supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble startx,
gdouble starty,
gdouble endx,
gdouble endy,
GimpProgressFunc progress_callback,
gpointer progress_data);
void gimp_drawable_blend (GimpDrawable *drawable,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble startx,
gdouble starty,
gdouble endx,
gdouble endy,
GimpProgressFunc progress_callback,
gpointer progress_data);
#endif /* __GIMP_DRAWABLE_BLEND_H__ */

View File

@ -238,7 +238,7 @@ gimp_gradient_get_new_preview (GimpViewable *viewable,
for (x = 0; x < width; x++)
{
gimp_gradient_get_color_at (gradient, cur_x, &color);
gimp_gradient_get_color_at (gradient, cur_x, FALSE, &color);
*p++ = color.r * 255.0;
*p++ = color.g * 255.0;
@ -253,7 +253,7 @@ gimp_gradient_get_new_preview (GimpViewable *viewable,
buf = temp_buf_data (temp_buf);
for (y = 0; y < height; y++)
memcpy (buf + (width * y * 4), row, width * 4);
memcpy (buf + (width * y * 4), row, width * 4);
g_free (row);
@ -380,7 +380,7 @@ gimp_gradient_load (const gchar *filename,
}
else
{
g_message (_("Invalid UTF-8 string in gradient file '%s'."),
g_message (_("Invalid UTF-8 string in gradient file '%s'."),
filename);
gimp_object_set_name (GIMP_OBJECT (gradient), _("Unnamed"));
}
@ -440,7 +440,7 @@ gimp_gradient_load (const gchar *filename,
seg->left_color.b = g_ascii_strtod (end, &end);
if (end && errno != ERANGE)
seg->left_color.a = g_ascii_strtod (end, &end);
if (end && errno != ERANGE)
seg->right_color.r = g_ascii_strtod (end, &end);
if (end && errno != ERANGE)
@ -601,13 +601,13 @@ gimp_gradient_save_as_pov (GimpGradient *gradient,
/* Left */
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->left);
g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->left_color.r);
g_ascii_formatd (color_buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->left_color.g);
g_ascii_formatd (color_buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->left_color.b);
g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
1.0 - seg->left_color.a);
fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n",
@ -617,13 +617,13 @@ gimp_gradient_save_as_pov (GimpGradient *gradient,
/* Middle */
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->middle);
g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
(seg->left_color.r + seg->right_color.r) / 2.0);
g_ascii_formatd (color_buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
(seg->left_color.g + seg->right_color.g) / 2.0);
g_ascii_formatd (color_buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
(seg->left_color.b + seg->right_color.b) / 2.0);
g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
1.0 - (seg->left_color.a + seg->right_color.a) / 2.0);
fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n",
@ -633,13 +633,13 @@ gimp_gradient_save_as_pov (GimpGradient *gradient,
/* Right */
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->right);
g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->right_color.r);
g_ascii_formatd (color_buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->right_color.g);
g_ascii_formatd (color_buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
seg->right_color.b);
g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
g_ascii_formatd (color_buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
1.0 - seg->right_color.a);
fprintf (file, "\t[%s color rgbt <%s, %s, %s, %s>]\n",
@ -657,6 +657,7 @@ gimp_gradient_save_as_pov (GimpGradient *gradient,
void
gimp_gradient_get_color_at (GimpGradient *gradient,
gdouble pos,
gboolean reverse,
GimpRGB *color)
{
gdouble factor = 0.0;
@ -668,17 +669,10 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
g_return_if_fail (GIMP_IS_GRADIENT (gradient));
g_return_if_fail (color != NULL);
/* if there is no gradient return a totally transparent black */
if (gradient == NULL)
{
gimp_rgba_set (color, 0.0, 0.0, 0.0, 0.0);
return;
}
pos = CLAMP (pos, 0.0, 1.0);
if (pos < 0.0)
pos = 0.0;
else if (pos > 1.0)
pos = 1.0;
if (reverse)
pos = 1.0 - pos;
seg = gimp_gradient_get_segment_at (gradient, pos);
@ -718,7 +712,7 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
break;
default:
g_warning ("%s: Unknown gradient type %d.",
g_warning ("%s: Unknown gradient type %d.",
G_GNUC_PRETTY_FUNCTION, seg->type);
break;
}
@ -727,7 +721,7 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
if (seg->color == GIMP_GRAD_RGB)
{
rgb.r =
rgb.r =
seg->left_color.r + (seg->right_color.r - seg->left_color.r) * factor;
rgb.g =
@ -985,7 +979,7 @@ gimp_gradient_segment_split_midpoint (GimpGradient *gradient,
g_return_if_fail (newr != NULL);
/* Get color at original segment's midpoint */
gimp_gradient_get_color_at (gradient, lseg->middle, &color);
gimp_gradient_get_color_at (gradient, lseg->middle, FALSE, &color);
/* Create a new segment and insert it in the list */
@ -1063,8 +1057,8 @@ gimp_gradient_segment_split_uniform (GimpGradient *gradient,
seg->right = lseg->left + (i + 1) * seg_len;
seg->middle = (seg->left + seg->right) / 2.0;
gimp_gradient_get_color_at (gradient, seg->left, &seg->left_color);
gimp_gradient_get_color_at (gradient, seg->right, &seg->right_color);
gimp_gradient_get_color_at (gradient, seg->left, FALSE, &seg->left_color);
gimp_gradient_get_color_at (gradient, seg->right, FALSE, &seg->right_color);
seg->type = lseg->type;
seg->color = lseg->color;

View File

@ -82,6 +82,7 @@ gboolean gimp_gradient_save_as_pov (GimpGradient *gradient,
void gimp_gradient_get_color_at (GimpGradient *gradient,
gdouble pos,
gboolean reverse,
GimpRGB *color);
GimpGradientSegment * gimp_gradient_get_segment_at (GimpGradient *grad,
gdouble pos);

View File

@ -44,6 +44,7 @@
GimpPalette *
gimp_palette_import_from_gradient (GimpGradient *gradient,
gboolean reverse,
const gchar *palette_name,
gint n_colors)
{
@ -62,7 +63,7 @@ gimp_palette_import_from_gradient (GimpGradient *gradient,
for (loop = 0, cur_x = 0; loop < n_colors; loop++, cur_x += dx)
{
gimp_gradient_get_color_at (gradient, cur_x, &color);
gimp_gradient_get_color_at (gradient, cur_x, reverse, &color);
gimp_palette_add_entry (palette, NULL, &color);
}
@ -88,9 +89,9 @@ struct _ImgColors
static gint count_color_entries = 0;
static GHashTable *
gimp_palette_import_store_colors (GHashTable *h_array,
gimp_palette_import_store_colors (GHashTable *h_array,
guchar *colors,
guchar *colors_real,
guchar *colors_real,
gint n_colors)
{
gpointer found_color = NULL;
@ -206,8 +207,8 @@ gimp_palette_import_create_image_palette (gpointer data,
/* Adjust the colors to the mean of the the sample */
gimp_rgba_set_uchar
(&color,
(guchar) color_tab->r + (color_tab->r_adj / color_tab->count),
(guchar) color_tab->g + (color_tab->g_adj / color_tab->count),
(guchar) color_tab->r + (color_tab->r_adj / color_tab->count),
(guchar) color_tab->g + (color_tab->g_adj / color_tab->count),
(guchar) color_tab->b + (color_tab->b_adj / color_tab->count),
255);

View File

@ -21,6 +21,7 @@
GimpPalette * gimp_palette_import_from_gradient (GimpGradient *gradient,
gboolean reverse,
const gchar *palette_name,
gint n_colors);
GimpPalette * gimp_palette_import_from_image (GimpImage *gimage,

View File

@ -599,6 +599,7 @@ palette_import_make_palette (ImportDialog *import_dialog)
{
case GRADIENT_IMPORT:
palette = gimp_palette_import_from_gradient (gradient,
FALSE,
palette_name,
n_colors);
break;
@ -606,7 +607,7 @@ palette_import_make_palette (ImportDialog *import_dialog)
case IMAGE_IMPORT:
if (gimp_image_base_type (gimage) == GIMP_INDEXED)
{
palette =
palette =
gimp_palette_import_from_indexed_image (gimage,
palette_name);
}

View File

@ -161,7 +161,7 @@ gradient_select_free (GradientSelect *gsp)
if (gsp->context)
g_object_unref (gsp->context);
g_free (gsp);
}
@ -199,7 +199,7 @@ gradient_select_dialogs_check (void)
if (gsp->callback_name)
{
if (! procedural_db_lookup (gsp->context->gimp, gsp->callback_name))
gradient_select_close_callback (NULL, gsp);
gradient_select_close_callback (NULL, gsp);
}
}
}
@ -228,7 +228,7 @@ gradient_select_change_callbacks (GradientSelect *gsp,
if (proc && gradient)
{
Argument *return_vals;
Argument *return_vals;
gint nreturn_vals;
gdouble *values, *pv;
double pos, delta;
@ -238,13 +238,13 @@ gradient_select_change_callbacks (GradientSelect *gsp,
i = gsp->sample_size;
pos = 0.0;
delta = 1.0 / (i - 1);
values = g_new (gdouble, 4 * i);
pv = values;
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, &color);
gimp_gradient_get_color_at (gradient, pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;
@ -263,7 +263,7 @@ gradient_select_change_callbacks (GradientSelect *gsp,
GIMP_PDB_FLOATARRAY, values,
GIMP_PDB_INT32, (gint) closing,
GIMP_PDB_END);
if (!return_vals || return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
g_message (_("Unable to run gradient callback.\n"
"The corresponding plug-in may have crashed."));

View File

@ -599,6 +599,7 @@ palette_import_make_palette (ImportDialog *import_dialog)
{
case GRADIENT_IMPORT:
palette = gimp_palette_import_from_gradient (gradient,
FALSE,
palette_name,
n_colors);
break;
@ -606,7 +607,7 @@ palette_import_make_palette (ImportDialog *import_dialog)
case IMAGE_IMPORT:
if (gimp_image_base_type (gimage) == GIMP_INDEXED)
{
palette =
palette =
gimp_palette_import_from_indexed_image (gimage,
palette_name);
}

View File

@ -143,8 +143,8 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
GimpGradientOptions *gradient_options;
GimpContext *context;
GimpImage *gimage;
GimpRGB gradient_color;
TempBuf *area;
gdouble gradient_length;
guchar col[MAX_CHANNELS];
gdouble scale;
GimpPaintApplicationMode paint_appl_mode;
@ -166,35 +166,6 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
paint_appl_mode = paint_options->application_mode;
if (gradient_options->use_gradient)
{
gdouble unit_factor;
switch (gradient_options->gradient_unit)
{
case GIMP_UNIT_PIXEL:
gradient_length = gradient_options->gradient_length;
break;
case GIMP_UNIT_PERCENT:
gradient_length = (MAX (gimage->width, gimage->height) *
gradient_options->gradient_length / 100);
break;
default:
unit_factor = gimp_unit_get_factor (gradient_options->gradient_unit);
gradient_length = (gradient_options->gradient_length *
MAX (gimage->xresolution,
gimage->yresolution) / unit_factor);
break;
}
}
else
{
gradient_length = 0.0;
}
if (pressure_options->color)
gradient_length = 1.0; /* not really used, only for if cases */
if (pressure_options->size)
scale = paint_core->cur_coords.pressure;
else
@ -204,27 +175,14 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
if (! (area = gimp_paint_core_get_paint_area (paint_core, drawable, scale)))
return;
if (gradient_length)
if (gimp_paint_options_get_gradient_color (paint_options, gimage,
paint_core->cur_coords.pressure,
paint_core->pixel_dist,
&gradient_color))
{
GimpGradient *gradient;
GimpRGB color;
opacity *= gradient_color.a;
gradient = gimp_context_get_gradient (context);
if (pressure_options->color)
gimp_gradient_get_color_at (gradient,
paint_core->cur_coords.pressure,
&color);
else
gimp_paint_core_get_color_from_gradient (paint_core,
gradient,
gradient_length,
&color,
gradient_options->gradient_type);
opacity *= color.a;
gimp_rgb_get_uchar (&color,
gimp_rgb_get_uchar (&gradient_color,
&col[RED_PIX],
&col[GREEN_PIX],
&col[BLUE_PIX]);

View File

@ -822,34 +822,6 @@ gimp_paint_core_interpolate (GimpPaintCore *core,
/* protected functions */
void
gimp_paint_core_get_color_from_gradient (GimpPaintCore *core,
GimpGradient *gradient,
gdouble gradient_length,
GimpRGB *color,
GimpGradientPaintMode mode)
{
gdouble pos;
if (gradient_length > 0.0)
pos = (gdouble) core->pixel_dist / gradient_length;
else
pos = 1.0;
/* for the once modes, set pos close to 1.0 after the first chunk */
if ((mode == GIMP_GRADIENT_ONCE_FORWARD ||
mode == GIMP_GRADIENT_ONCE_BACKWARD) && pos >= 1.0)
pos = 0.9999999;
if ((((gint) pos & 1) && mode != GIMP_GRADIENT_LOOP_SAWTOOTH) ||
mode == GIMP_GRADIENT_ONCE_BACKWARD)
pos = 1.0 - (pos - (gint) pos);
else
pos = pos - (gint) pos;
gimp_gradient_get_color_at (gradient, pos, color);
}
TempBuf *
gimp_paint_core_get_paint_area (GimpPaintCore *core,
GimpDrawable *drawable,

View File

@ -163,13 +163,6 @@ void gimp_paint_core_interpolate (GimpPaintCore *core,
/* protected functions */
void gimp_paint_core_get_color_from_gradient
(GimpPaintCore *core,
GimpGradient *gradient,
gdouble gradient_length,
GimpRGB *color,
GimpGradientPaintMode mode);
TempBuf * gimp_paint_core_get_paint_area (GimpPaintCore *core,
GimpDrawable *drawable,
gdouble scale);

View File

@ -29,6 +29,7 @@
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "core/gimpgradient.h"
#include "gimppaintoptions.h"
@ -45,10 +46,12 @@
#define DEFAULT_USE_FADE FALSE
#define DEFAULT_FADE_LENGTH 100.0
#define DEFAULT_FADE_UNIT GIMP_UNIT_PIXEL
#define DEFAULT_USE_GRADIENT FALSE
#define DEFAULT_GRADIENT_REVERSE FALSE
#define DEFAULT_GRADIENT_REPEAT GIMP_REPEAT_TRIANGULAR
#define DEFAULT_GRADIENT_LENGTH 100.0
#define DEFAULT_GRADIENT_UNIT GIMP_UNIT_PIXEL
#define DEFAULT_GRADIENT_TYPE GIMP_GRADIENT_LOOP_TRIANGLE
enum
@ -65,9 +68,10 @@ enum
PROP_FADE_LENGTH,
PROP_FADE_UNIT,
PROP_USE_GRADIENT,
PROP_GRADIENT_REVERSE,
PROP_GRADIENT_REPEAT,
PROP_GRADIENT_LENGTH,
PROP_GRADIENT_UNIT,
PROP_GRADIENT_TYPE
PROP_GRADIENT_UNIT
};
@ -179,6 +183,14 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_GRADIENT,
"use-gradient", NULL,
DEFAULT_USE_GRADIENT, 0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_GRADIENT_REVERSE,
"gradient-reverse", NULL,
DEFAULT_GRADIENT_REVERSE, 0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRADIENT_REPEAT,
"gradient-repeat", NULL,
GIMP_TYPE_REPEAT_MODE,
DEFAULT_GRADIENT_REPEAT,
0);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_GRADIENT_LENGTH,
"gradient-length", NULL,
0.0, 32767.0, DEFAULT_GRADIENT_LENGTH,
@ -187,11 +199,6 @@ gimp_paint_options_class_init (GimpPaintOptionsClass *klass)
"gradient-unit", NULL,
TRUE, TRUE, DEFAULT_GRADIENT_UNIT,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRADIENT_TYPE,
"gradient-type", NULL,
GIMP_TYPE_GRADIENT_PAINT_MODE,
DEFAULT_GRADIENT_TYPE,
0);
}
static void
@ -271,15 +278,18 @@ gimp_paint_options_set_property (GObject *object,
case PROP_USE_GRADIENT:
gradient_options->use_gradient = g_value_get_boolean (value);
break;
case PROP_GRADIENT_REVERSE:
gradient_options->gradient_reverse = g_value_get_boolean (value);
break;
case PROP_GRADIENT_REPEAT:
gradient_options->gradient_repeat = g_value_get_enum (value);
break;
case PROP_GRADIENT_LENGTH:
gradient_options->gradient_length = g_value_get_double (value);
break;
case PROP_GRADIENT_UNIT:
gradient_options->gradient_unit = g_value_get_int (value);
break;
case PROP_GRADIENT_TYPE:
gradient_options->gradient_type = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -342,15 +352,18 @@ gimp_paint_options_get_property (GObject *object,
case PROP_USE_GRADIENT:
g_value_set_boolean (value, gradient_options->use_gradient);
break;
case PROP_GRADIENT_REVERSE:
g_value_set_boolean (value, gradient_options->gradient_reverse);
break;
case PROP_GRADIENT_REPEAT:
g_value_set_enum (value, gradient_options->gradient_repeat);
break;
case PROP_GRADIENT_LENGTH:
g_value_set_double (value, gradient_options->gradient_length);
break;
case PROP_GRADIENT_UNIT:
g_value_set_int (value, gradient_options->gradient_unit);
break;
case PROP_GRADIENT_TYPE:
g_value_set_enum (value, gradient_options->gradient_type);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -454,6 +467,82 @@ gimp_paint_options_get_fade (GimpPaintOptions *paint_options,
return GIMP_OPACITY_OPAQUE;
}
gboolean
gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
GimpImage *gimage,
gdouble pressure,
gdouble pixel_dist,
GimpRGB *color)
{
GimpPressureOptions *pressure_options;
GimpGradientOptions *gradient_options;
GimpGradient *gradient;
g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (color != NULL, FALSE);
pressure_options = paint_options->pressure_options;
gradient_options = paint_options->gradient_options;
gradient = gimp_context_get_gradient (GIMP_CONTEXT (paint_options));
if (pressure_options->color)
{
gimp_gradient_get_color_at (gradient, pressure,
gradient_options->gradient_reverse,
color);
return TRUE;
}
else if (gradient_options->use_gradient)
{
gdouble gradient_length = 0.0;
gdouble unit_factor;
gdouble pos;
switch (gradient_options->gradient_unit)
{
case GIMP_UNIT_PIXEL:
gradient_length = gradient_options->gradient_length;
break;
case GIMP_UNIT_PERCENT:
gradient_length = (MAX (gimage->width, gimage->height) *
gradient_options->gradient_length / 100);
break;
default:
unit_factor = gimp_unit_get_factor (gradient_options->gradient_unit);
gradient_length = (gradient_options->gradient_length *
MAX (gimage->xresolution,
gimage->yresolution) / unit_factor);
break;
}
if (gradient_length > 0.0)
pos = pixel_dist / gradient_length;
else
pos = 1.0;
/* for no repeat, set pos close to 1.0 after the first chunk */
if (gradient_options->gradient_repeat == GIMP_REPEAT_NONE && pos >= 1.0)
pos = 0.9999999;
if (((gint) pos & 1) &&
gradient_options->gradient_repeat != GIMP_REPEAT_SAWTOOTH)
pos = 1.0 - (pos - (gint) pos);
else
pos = pos - (gint) pos;
gimp_gradient_get_color_at (gradient, pos,
gradient_options->gradient_reverse,
color);
return TRUE;
}
return FALSE;
}
GimpBrushApplicationMode
gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options)
{

View File

@ -34,26 +34,27 @@ typedef struct _GimpGradientOptions GimpGradientOptions;
struct _GimpPressureOptions
{
gboolean opacity;
gboolean pressure;
gboolean rate;
gboolean size;
gboolean color;
gboolean opacity;
gboolean pressure;
gboolean rate;
gboolean size;
gboolean color;
};
struct _GimpFadeOptions
{
gboolean use_fade;
gdouble fade_length;
GimpUnit fade_unit;
gboolean use_fade;
gdouble fade_length;
GimpUnit fade_unit;
};
struct _GimpGradientOptions
{
gboolean use_gradient;
gdouble gradient_length;
GimpUnit gradient_unit;
gint gradient_type;
gboolean use_gradient;
gboolean gradient_reverse;
gdouble gradient_length;
GimpUnit gradient_unit;
GimpRepeatMode gradient_repeat;
};
@ -96,6 +97,12 @@ gdouble gimp_paint_options_get_fade (GimpPaintOptions *paint_options,
GimpImage *gimage,
gdouble pixel_dist);
gboolean gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
GimpImage *gimage,
gdouble pressure,
gdouble pixel_dist,
GimpRGB *color);
GimpBrushApplicationMode
gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options);

View File

@ -66,27 +66,6 @@ gimp_dodge_burn_type_get_type (void)
}
static const GEnumValue gimp_gradient_paint_mode_enum_values[] =
{
{ GIMP_GRADIENT_ONCE_FORWARD, N_("Once Forward"), "once-forward" },
{ GIMP_GRADIENT_ONCE_BACKWARD, N_("Once Backward"), "once-backward" },
{ GIMP_GRADIENT_LOOP_SAWTOOTH, N_("Loop Sawtooth"), "loop-sawtooth" },
{ GIMP_GRADIENT_LOOP_TRIANGLE, N_("Loop Triangle"), "loop-triangle" },
{ 0, NULL, NULL }
};
GType
gimp_gradient_paint_mode_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpGradientPaintMode", gimp_gradient_paint_mode_enum_values);
return enum_type;
}
static const GEnumValue gimp_convolve_type_enum_values[] =
{
{ GIMP_BLUR_CONVOLVE, N_("Blur"), "blur-convolve" },

View File

@ -70,19 +70,6 @@ typedef enum
} GimpDodgeBurnType;
#define GIMP_TYPE_GRADIENT_PAINT_MODE (gimp_gradient_paint_mode_get_type ())
GType gimp_gradient_paint_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_GRADIENT_ONCE_FORWARD, /*< desc="Once Forward" >*/
GIMP_GRADIENT_ONCE_BACKWARD, /*< desc="Once Backward" >*/
GIMP_GRADIENT_LOOP_SAWTOOTH, /*< desc="Loop Sawtooth" >*/
GIMP_GRADIENT_LOOP_TRIANGLE /*< desc="Loop Triangle" >*/
} GimpGradientPaintMode;
#define GIMP_TYPE_CONVOLVE_TYPE (gimp_convolve_type_get_type ())
GType gimp_convolve_type_get_type (void) G_GNUC_CONST;

View File

@ -271,7 +271,7 @@ gradients_sample_uniform_invoker (Gimp *gimp,
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, &color);
gimp_gradient_get_color_at (gradient, pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;
@ -362,7 +362,7 @@ gradients_sample_custom_invoker (Gimp *gimp,
while (i--)
{
gimp_gradient_get_color_at (gradient, *pos, &color);
gimp_gradient_get_color_at (gradient, *pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;
@ -456,12 +456,14 @@ gradients_get_gradient_data_invoker (Gimp *gimp,
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
name);
if (gradient)
success = TRUE;
}
else
success = (gradient = gimp_context_get_gradient (gimp_get_current_context (gimp))) != NULL;
{
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));;
}
if (gradient)
success = TRUE;
if (success)
{
@ -478,7 +480,7 @@ gradients_get_gradient_data_invoker (Gimp *gimp,
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, &color);
gimp_gradient_get_color_at (gradient, pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;

View File

@ -62,6 +62,7 @@ blend_invoker (Gimp *gimp,
gdouble opacity;
gdouble offset;
gint32 repeat;
gboolean reverse;
gboolean supersample;
gint32 max_depth;
gdouble threshold;
@ -99,25 +100,27 @@ blend_invoker (Gimp *gimp,
if (repeat < GIMP_REPEAT_NONE || repeat > GIMP_REPEAT_TRIANGULAR)
success = FALSE;
supersample = args[7].value.pdb_int ? TRUE : FALSE;
reverse = args[7].value.pdb_int ? TRUE : FALSE;
max_depth = args[8].value.pdb_int;
supersample = args[8].value.pdb_int ? TRUE : FALSE;
max_depth = args[9].value.pdb_int;
if (supersample && (max_depth < 1 || max_depth > 9))
success = FALSE;
threshold = args[9].value.pdb_float;
threshold = args[10].value.pdb_float;
if (supersample && (threshold < 0.0 || threshold > 4.0))
success = FALSE;
dither = args[10].value.pdb_int ? TRUE : FALSE;
dither = args[11].value.pdb_int ? TRUE : FALSE;
x1 = args[11].value.pdb_float;
x1 = args[12].value.pdb_float;
y1 = args[12].value.pdb_float;
y1 = args[13].value.pdb_float;
x2 = args[13].value.pdb_float;
x2 = args[14].value.pdb_float;
y2 = args[14].value.pdb_float;
y2 = args[15].value.pdb_float;
if (success)
{
@ -132,7 +135,7 @@ blend_invoker (Gimp *gimp,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat,
offset, repeat, reverse,
supersample, max_depth,
threshold, dither,
x1, y1, x2, y2,
@ -180,6 +183,11 @@ static ProcArg blend_inargs[] =
"repeat",
"Repeat mode: { GIMP_REPEAT_NONE (0), GIMP_REPEAT_SAWTOOTH (1), GIMP_REPEAT_TRIANGULAR (2) }"
},
{
GIMP_PDB_INT32,
"reverse",
"Use the reverse gradient (TRUE or FALSE)"
},
{
GIMP_PDB_INT32,
"supersample",
@ -231,7 +239,7 @@ static ProcRecord blend_proc =
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
15,
16,
blend_inargs,
0,
NULL,

View File

@ -1033,7 +1033,9 @@ paintbrush_invoker (Gimp *gimp,
g_object_set (options,
"application-mode", method,
"use-fade", fade_out > 0.0,
"fade-length", fade_out,
"use-gradient", gradient_length > 0.0,
"gradient-length", gradient_length,
NULL);

View File

@ -44,7 +44,6 @@ enum
PROP_0,
PROP_OFFSET,
PROP_GRADIENT_TYPE,
PROP_REPEAT,
PROP_SUPERSAMPLE,
PROP_SUPERSAMPLE_DEPTH,
PROP_SUPERSAMPLE_THRESHOLD,
@ -100,7 +99,7 @@ gimp_blend_options_get_type (void)
return type;
}
static void
static void
gimp_blend_options_class_init (GimpBlendOptionsClass *klass)
{
GObjectClass *object_class;
@ -121,11 +120,6 @@ gimp_blend_options_class_init (GimpBlendOptionsClass *klass)
GIMP_TYPE_GRADIENT_TYPE,
GIMP_LINEAR,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_REPEAT,
"repeat", NULL,
GIMP_TYPE_REPEAT_MODE,
GIMP_REPEAT_NONE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SUPERSAMPLE,
"supersample", NULL,
@ -169,9 +163,6 @@ gimp_blend_options_set_property (GObject *object,
case PROP_GRADIENT_TYPE:
options->gradient_type = g_value_get_enum (value);
break;
case PROP_REPEAT:
options->repeat = g_value_get_enum (value);
break;
case PROP_SUPERSAMPLE:
options->supersample = g_value_get_boolean (value);
@ -186,7 +177,7 @@ gimp_blend_options_set_property (GObject *object,
case PROP_DITHER:
options->dither = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -211,9 +202,6 @@ gimp_blend_options_get_property (GObject *object,
case PROP_GRADIENT_TYPE:
g_value_set_enum (value, options->gradient_type);
break;
case PROP_REPEAT:
g_value_set_enum (value, options->repeat);
break;
case PROP_SUPERSAMPLE:
g_value_set_boolean (value, options->supersample);
@ -228,7 +216,7 @@ gimp_blend_options_get_property (GObject *object,
case PROP_DITHER:
g_value_set_boolean (value, options->dither);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -267,7 +255,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
menu, 2, TRUE);
/* the repeat option */
menu = gimp_prop_enum_option_menu_new (config, "repeat", 0, 0);
menu = gimp_prop_enum_option_menu_new (config, "gradient-repeat", 0, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
_("Repeat:"), 1.0, 0.5,
menu, 2, TRUE);
@ -280,7 +268,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
_("Dithering"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
/* frame for supersampling options */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);

View File

@ -40,13 +40,12 @@ struct _GimpBlendOptions
gdouble offset;
GimpGradientType gradient_type;
GimpRepeatMode repeat;
gboolean dither;
gboolean supersample;
gint supersample_depth;
gdouble supersample_threshold;
gboolean dither;
};

View File

@ -122,7 +122,7 @@ gimp_blend_tool_get_type (void)
};
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
"GimpBlendTool",
"GimpBlendTool",
&tool_info, 0);
}
@ -159,7 +159,7 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
GimpTool *tool;
tool = GIMP_TOOL (blend_tool);
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_BLEND_TOOL_CURSOR);
@ -215,14 +215,16 @@ gimp_blend_tool_button_release (GimpTool *tool,
GimpDisplay *gdisp)
{
GimpBlendTool *blend_tool;
GimpPaintOptions *paint_options;
GimpBlendOptions *options;
GimpContext *context;
GimpImage *gimage;
GimpProgress *progress;
blend_tool = GIMP_BLEND_TOOL (tool);
options = GIMP_BLEND_OPTIONS (tool->tool_info->tool_options);
context = GIMP_CONTEXT (options);
blend_tool = GIMP_BLEND_TOOL (tool);
paint_options = GIMP_PAINT_OPTIONS (tool->tool_info->tool_options);
options = GIMP_BLEND_OPTIONS (paint_options);
context = GIMP_CONTEXT (options);
gimage = gdisp->gimage;
@ -246,7 +248,8 @@ gimp_blend_tool_button_release (GimpTool *tool,
options->gradient_type,
gimp_context_get_opacity (context),
options->offset,
options->repeat,
paint_options->gradient_options->gradient_repeat,
paint_options->gradient_options->gradient_reverse,
options->supersample,
options->supersample_depth,
options->supersample_threshold,
@ -255,7 +258,7 @@ gimp_blend_tool_button_release (GimpTool *tool,
blend_tool->starty,
blend_tool->endx,
blend_tool->endy,
progress ? gimp_progress_update_and_flush : NULL,
progress ? gimp_progress_update_and_flush : NULL,
progress);
if (progress)
@ -304,13 +307,13 @@ gimp_blend_tool_motion (GimpTool *tool,
for (i = 0; i < 6; i++)
{
if (frac < tangens2[i])
break;
break;
}
dx = dx > 0 ?
dx = dx > 0 ?
(cosinus[6-i] * radius) >> 8 : - ((cosinus[6-i] * radius) >> 8);
dy = dy > 0 ?
dy = dy > 0 ?
(cosinus[i] * radius) >> 8 : - ((cosinus[i] * radius) >> 8);
}

View File

@ -787,7 +787,7 @@ preview_set_hint (GimpGradientEditor *editor,
xpos = control_calc_g_pos (editor, x);
gimp_gradient_get_color_at (GIMP_GRADIENT (data_editor->data),
xpos, &rgb);
xpos, FALSE, &rgb);
gimp_rgb_to_hsv (&rgb, &hsv);
@ -823,7 +823,7 @@ preview_set_foreground (GimpGradientEditor *editor,
xpos = control_calc_g_pos (editor, x);
gimp_gradient_get_color_at (gradient, xpos, &color);
gimp_gradient_get_color_at (gradient, xpos, FALSE, &color);
gimp_context_set_foreground (user_context, &color);
@ -857,7 +857,7 @@ preview_set_background (GimpGradientEditor *editor,
xpos = control_calc_g_pos (editor, x);
gimp_gradient_get_color_at (gradient, xpos, &color);
gimp_gradient_get_color_at (gradient, xpos, FALSE, &color);
gimp_context_set_background (user_context, &color);

View File

@ -101,11 +101,12 @@ gimp_preview_renderer_gradient_class_init (GimpPreviewRendererGradientClass *kla
static void
gimp_preview_renderer_gradient_init (GimpPreviewRendererGradient *renderer)
{
renderer->even = NULL;
renderer->odd = NULL;
renderer->width = -1;
renderer->left = 0.0;
renderer->right = 1.0;
renderer->even = NULL;
renderer->odd = NULL;
renderer->width = -1;
renderer->left = 0.0;
renderer->right = 1.0;
renderer->reverse = FALSE;
}
static void
@ -173,7 +174,7 @@ gimp_preview_renderer_gradient_render (GimpPreviewRenderer *renderer,
{
guchar r, g, b;
gimp_gradient_get_color_at (gradient, cur_x, &color);
gimp_gradient_get_color_at (gradient, cur_x, rendergrad->reverse, &color);
cur_x += dx;
a = ((gint) (color.a * 255.0)) << 8;
@ -242,3 +243,18 @@ gimp_preview_renderer_gradient_set_offsets (GimpPreviewRendererGradient *rendere
gimp_preview_renderer_update (GIMP_PREVIEW_RENDERER (renderer));
}
}
void
gimp_preview_renderer_gradient_set_reverse (GimpPreviewRendererGradient *renderer,
gboolean reverse)
{
g_return_if_fail (GIMP_IS_PREVIEW_RENDERER_GRADIENT (renderer));
if (reverse != renderer->reverse)
{
renderer->reverse = reverse ? TRUE : FALSE;
gimp_preview_renderer_invalidate (GIMP_PREVIEW_RENDERER (renderer));
gimp_preview_renderer_update (GIMP_PREVIEW_RENDERER (renderer));
}
}

View File

@ -101,11 +101,12 @@ gimp_preview_renderer_gradient_class_init (GimpPreviewRendererGradientClass *kla
static void
gimp_preview_renderer_gradient_init (GimpPreviewRendererGradient *renderer)
{
renderer->even = NULL;
renderer->odd = NULL;
renderer->width = -1;
renderer->left = 0.0;
renderer->right = 1.0;
renderer->even = NULL;
renderer->odd = NULL;
renderer->width = -1;
renderer->left = 0.0;
renderer->right = 1.0;
renderer->reverse = FALSE;
}
static void
@ -173,7 +174,7 @@ gimp_preview_renderer_gradient_render (GimpPreviewRenderer *renderer,
{
guchar r, g, b;
gimp_gradient_get_color_at (gradient, cur_x, &color);
gimp_gradient_get_color_at (gradient, cur_x, rendergrad->reverse, &color);
cur_x += dx;
a = ((gint) (color.a * 255.0)) << 8;
@ -242,3 +243,18 @@ gimp_preview_renderer_gradient_set_offsets (GimpPreviewRendererGradient *rendere
gimp_preview_renderer_update (GIMP_PREVIEW_RENDERER (renderer));
}
}
void
gimp_preview_renderer_gradient_set_reverse (GimpPreviewRendererGradient *renderer,
gboolean reverse)
{
g_return_if_fail (GIMP_IS_PREVIEW_RENDERER_GRADIENT (renderer));
if (reverse != renderer->reverse)
{
renderer->reverse = reverse ? TRUE : FALSE;
gimp_preview_renderer_invalidate (GIMP_PREVIEW_RENDERER (renderer));
gimp_preview_renderer_update (GIMP_PREVIEW_RENDERER (renderer));
}
}

View File

@ -28,7 +28,7 @@ G_BEGIN_DECLS
/* This file contains aliases that are kept for historical
* reasons, because a wide code base depends on them.
*
* These defines will be removed in the next development cycle.
* These defines will be removed in the next development cycle.
*/
#define GimpRunModeType GimpRunMode
@ -107,14 +107,6 @@ enum
GIMP_DISCARD = GIMP_MASK_DISCARD
};
enum
{
GIMP_ONCE_FORWARD = GIMP_GRADIENT_ONCE_FORWARD,
GIMP_ONCE_BACKWARDS = GIMP_GRADIENT_ONCE_BACKWARD,
GIMP_LOOP_SAWTOOTH = GIMP_GRADIENT_LOOP_SAWTOOTH,
GIMP_LOOP_TRIANGLE = GIMP_GRADIENT_LOOP_TRIANGLE,
};
enum
{
GIMP_HARD = GIMP_BRUSH_HARD,

View File

@ -132,14 +132,6 @@ typedef enum
GIMP_NO_FILL
} GimpFillType;
typedef enum
{
GIMP_GRADIENT_ONCE_FORWARD,
GIMP_GRADIENT_ONCE_BACKWARD,
GIMP_GRADIENT_LOOP_SAWTOOTH,
GIMP_GRADIENT_LOOP_TRIANGLE
} GimpGradientPaintMode;
typedef enum
{
GIMP_LINEAR,

View File

@ -34,6 +34,7 @@
* @opacity: The opacity of the final blend.
* @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
* @repeat: Repeat mode.
* @reverse: Use the reverse gradient.
* @supersample: Do adaptive supersampling.
* @max_depth: Maximum recursion levels for supersampling.
* @threshold: Supersampling threshold.
@ -61,6 +62,7 @@ gimp_blend (gint32 drawable_ID,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
@ -83,6 +85,7 @@ gimp_blend (gint32 drawable_ID,
GIMP_PDB_FLOAT, opacity,
GIMP_PDB_FLOAT, offset,
GIMP_PDB_INT32, repeat,
GIMP_PDB_INT32, reverse,
GIMP_PDB_INT32, supersample,
GIMP_PDB_INT32, max_depth,
GIMP_PDB_FLOAT, threshold,

View File

@ -36,6 +36,7 @@ gboolean gimp_blend (gint32 drawable_ID,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,

View File

@ -113,12 +113,6 @@ WHITE_FILL = 2
TRANSPARENT_FILL = 3
NO_FILL = 4
# GimpGradientPaintMode
GRADIENT_ONCE_FORWARD = 0
GRADIENT_ONCE_BACKWARD = 1
GRADIENT_LOOP_SAWTOOTH = 2
GRADIENT_LOOP_TRIANGLE = 3
# GimpGradientType
LINEAR = 0
BILINEAR = 1

View File

@ -315,11 +315,6 @@ init_constants (void)
setvar (cintern ("HARD"), flocons (GIMP_BRUSH_HARD), NIL);
setvar (cintern ("SOFT"), flocons (GIMP_BRUSH_SOFT), NIL);
setvar (cintern ("ONCE-FORWARD"), flocons (GIMP_GRADIENT_ONCE_FORWARD), NIL);
setvar (cintern ("ONCE-BACKWARDS"), flocons (GIMP_GRADIENT_ONCE_BACKWARD), NIL);
setvar (cintern ("LOOP-SAWTOOTH"), flocons (GIMP_GRADIENT_LOOP_SAWTOOTH), NIL);
setvar (cintern ("LOOP-TRIANGLE"), flocons (GIMP_GRADIENT_LOOP_TRIANGLE), NIL);
setvar (cintern ("CONTINUOUS"), flocons (GIMP_PAINT_CONSTANT), NIL);
setvar (cintern ("INCREMENTAL"), flocons (GIMP_PAINT_INCREMENTAL), NIL);

View File

@ -89,11 +89,6 @@ init_generated_constants (void)
setvar (cintern ("TRANSPARENT-FILL"), flocons (3), NIL);
setvar (cintern ("NO-FILL"), flocons (4), NIL);
setvar (cintern ("GRADIENT-ONCE-FORWARD"), flocons (0), NIL);
setvar (cintern ("GRADIENT-ONCE-BACKWARD"), flocons (1), NIL);
setvar (cintern ("GRADIENT-LOOP-SAWTOOTH"), flocons (2), NIL);
setvar (cintern ("GRADIENT-LOOP-TRIANGLE"), flocons (3), NIL);
setvar (cintern ("LINEAR"), flocons (0), NIL);
setvar (cintern ("BILINEAR"), flocons (1), NIL);
setvar (cintern ("RADIAL"), flocons (2), NIL);

View File

@ -25,10 +25,26 @@
;
; The utility of this script is left as an exercise for the reader.
(define (center-ellipse img cx cy rx ry op aa feather frad)
(gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx ) (+ ry ry ) op aa feather frad))
(define (center-ellipse img
cx
cy
rx
ry
op
aa
feather
frad)
(gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
op aa feather frad))
(define (use-tile img drawable height width img2 drawable2 xoffset yoffset)
(define (use-tile img
drawable
height
width
img2
drawable2
xoffset
yoffset)
(gimp-edit-copy drawable2)
(let ((floating-sel (car (gimp-edit-paste drawable FALSE))))
(gimp-layer-set-offsets floating-sel xoffset yoffset)
@ -37,7 +53,15 @@
)
(define (create-tile img drawable1 drawable2 size thickness backcolor begincolor endcolor supersample)
(define (create-tile img
drawable1
drawable2
size
thickness
backcolor
begincolor
endcolor
supersample)
(let* (
(half-thickness (/ thickness 2))
(outer-radius (+ (/ size 2) half-thickness))
@ -51,8 +75,10 @@
(let* (
(tempSize (* size 3))
(temp-img (car (gimp-image-new tempSize tempSize RGB)))
(temp-draw (car (gimp-layer-new temp-img tempSize tempSize RGB_IMAGE "Jabar" 100 NORMAL)))
(temp-draw2 (car (gimp-layer-new temp-img tempSize tempSize RGB_IMAGE "Jabar" 100 NORMAL))))
(temp-draw (car (gimp-layer-new temp-img tempSize tempSize
RGB_IMAGE "Jabar" 100 NORMAL)))
(temp-draw2 (car (gimp-layer-new temp-img tempSize tempSize
RGB_IMAGE "Jabar" 100 NORMAL))))
(gimp-image-undo-disable temp-img)
(gimp-image-add-layer temp-img temp-draw 0)
@ -65,21 +91,38 @@
(gimp-palette-set-background begincolor)
(gimp-palette-set-foreground endcolor)
(center-ellipse temp-img size size outer-radius outer-radius REPLACE TRUE FALSE 0)
(center-ellipse temp-img size size inner-radius inner-radius SUB TRUE FALSE 0)
(center-ellipse temp-img size size outer-radius outer-radius
REPLACE TRUE FALSE 0)
(center-ellipse temp-img size size inner-radius inner-radius
SUB TRUE FALSE 0)
(center-ellipse temp-img (* size 2) (* size 2) outer-radius outer-radius ADD TRUE FALSE 0)
(center-ellipse temp-img (* size 2) (* size 2) inner-radius inner-radius SUB TRUE FALSE 0)
(gimp-blend temp-draw FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 FALSE supersample 3 .2 TRUE size size (* size 2) (/ size 2) )
(center-ellipse temp-img (* size 2) (* size 2) outer-radius outer-radius
ADD TRUE FALSE 0)
(center-ellipse temp-img (* size 2) (* size 2) inner-radius inner-radius
SUB TRUE FALSE 0)
(center-ellipse temp-img size (* size 2) outer-radius outer-radius REPLACE TRUE FALSE 0)
(center-ellipse temp-img size (* size 2) inner-radius inner-radius SUB TRUE FALSE 0)
(gimp-blend temp-draw FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
supersample 3 .2 TRUE
size size (* size 2) (/ size 2))
(center-ellipse temp-img size (* size 2) outer-radius outer-radius
REPLACE TRUE FALSE 0)
(center-ellipse temp-img size (* size 2) inner-radius inner-radius
SUB TRUE FALSE 0)
(center-ellipse temp-img (* size 2) size outer-radius outer-radius
ADD TRUE FALSE 0)
(center-ellipse temp-img (* size 2) size inner-radius inner-radius
SUB TRUE FALSE 0)
(center-ellipse temp-img (* size 2) size outer-radius outer-radius ADD TRUE FALSE 0)
(center-ellipse temp-img (* size 2) size inner-radius inner-radius SUB TRUE FALSE 0)
;(gimp-edit-fill temp-img temp-draw2 BG-IMAGE-FILL)
(gimp-blend temp-draw2 FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 FALSE supersample 3 .2 TRUE size size (* size 2) (* size 2) )
(gimp-blend temp-draw2 FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
supersample 3 .2 TRUE
size size (* size 2) (* size 2))
(gimp-selection-none temp-img)
(gimp-image-resize temp-img size size (- size) (- size))
@ -105,7 +148,14 @@
)
(define (script-fu-3dtruchet size thickness backcolor begincolor endcolor supersample xtiles ytiles)
(define (script-fu-3dtruchet size
thickness
backcolor
begincolor
endcolor
supersample
xtiles
ytiles)
(let* (
(width (* size xtiles))
(height (* size ytiles))
@ -122,11 +172,10 @@
(gimp-image-undo-disable img)
(gimp-image-undo-disable tile)
(gimp-image-add-layer img layer-one 0)
(gimp-image-add-layer tile tiledraw1 0)
(gimp-image-add-layer tile tiledraw2 0)
;just to look a little better
(gimp-selection-all img)
@ -134,22 +183,24 @@
(gimp-edit-fill layer-one BG-IMAGE-FILL)
(gimp-selection-none img)
(create-tile tile tiledraw1 tiledraw2 size thickness backcolor begincolor endcolor supersample)
(create-tile tile tiledraw1 tiledraw2 size thickness
backcolor begincolor endcolor supersample)
(while (<= Xindex xtiles)
(while (<= Yindex ytiles)
(if (= (rand 2) 0)
(use-tile img layer-one height width tile tiledraw1 (* Xindex size) (* Yindex size))
(use-tile img layer-one height width tile tiledraw2 (* Xindex size) (* Yindex size))
(use-tile img layer-one height width tile
tiledraw1 (* Xindex size) (* Yindex size))
(use-tile img layer-one height width tile
tiledraw2 (* Xindex size) (* Yindex size))
)
(set! Yindex (+ Yindex 1))
)
(set! Yindex 0)
(set! Xindex (+ Xindex 1))
)
(gimp-image-delete tile)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)
@ -165,12 +216,11 @@
"Adrian Likins"
"1997"
""
SF-ADJUSTMENT _"Block Size" '(64 5 1000 1 10 0 1)
SF-ADJUSTMENT _"Thickness" '(12 2 100 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Start Blend" '(0 0 0)
SF-COLOR _"End Blend" '(255 255 255)
SF-TOGGLE _"Supersample" TRUE
SF-ADJUSTMENT _"Block Size" '(64 5 1000 1 10 0 1)
SF-ADJUSTMENT _"Thickness" '(12 2 100 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Start Blend" '(0 0 0)
SF-COLOR _"End Blend" '(255 255 255)
SF-TOGGLE _"Supersample" TRUE
SF-ADJUSTMENT _"Number of X Tiles" '(5 1 1000 1 10 0 1)
SF-ADJUSTMENT _"Number of Y Tiles" '(5 1 1000 1 10 0 1)
)
SF-ADJUSTMENT _"Number of Y Tiles" '(5 1 1000 1 10 0 1))

View File

@ -1,5 +1,3 @@
; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
@ -26,11 +24,8 @@
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (make-point x y)
(define (make-point x
y)
(cons x y))
(define (point-x p)
@ -52,13 +47,16 @@
(convert point-list a 0)
a))
(define (make-arrow size offset)
(define (make-arrow size
offset)
(list (make-point offset offset)
(make-point (- size offset) (/ size 2))
(make-point offset (- size offset))))
(define (rotate-points points size orientation)
(define (rotate-points points
size
orientation)
(if (null? points)
'()
(let* ((p (car points))
@ -71,7 +69,11 @@
(rotate-points (cdr points) size orientation))
(define (script-fu-alien-glow-right-arrow size orientation glow-color bg-color flatten)
(define (script-fu-alien-glow-right-arrow size
orientation
glow-color
bg-color
flatten)
(let* ((img (car (gimp-image-new size size RGB)))
(grow-amount (/ size 12))
(blur-radius (/ size 3))
@ -82,8 +84,8 @@
(big-arrow (point-list->double-array (rotate-points (make-arrow size offset) size orientation)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-image-undo-disable img)
;(gimp-image-resize img (+ length height) (+ height height) 0 0)
(gimp-image-add-layer img bg-layer 1)
@ -93,12 +95,15 @@
(gimp-edit-clear glow-layer)
(gimp-edit-clear ruler-layer)
(gimp-free-select img 6 big-arrow REPLACE TRUE FALSE 0)
(gimp-palette-set-foreground '(103 103 103))
(gimp-palette-set-background '(0 0 0))
(gimp-blend ruler-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 size size)
(gimp-blend ruler-layer FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 size size)
(gimp-selection-grow img grow-amount)
(gimp-palette-set-foreground glow-color)
@ -127,11 +132,11 @@
"Adrian Likins"
"1997"
""
SF-ADJUSTMENT _"Size" '(32 5 150 1 10 0 1)
SF-OPTION _"Orientation" '(_"Right"
_"Left"
_"Up"
_"Down")
SF-COLOR _"Glow Color" '(63 252 0)
SF-ADJUSTMENT _"Size" '(32 5 150 1 10 0 1)
SF-OPTION _"Orientation" '(_"Right"
_"Left"
_"Up"
_"Down")
SF-COLOR _"Glow Color" '(63 252 0)
SF-COLOR _"Background Color" '(0 0 0)
SF-TOGGLE _"Flatten Image" TRUE)
SF-TOGGLE _"Flatten Image" TRUE)

View File

@ -20,7 +20,11 @@
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (script-fu-alien-glow-horizontal-ruler length height glow-color bg-color flatten)
(define (script-fu-alien-glow-horizontal-ruler length
height
glow-color
bg-color
flatten)
(let* ((img (car (gimp-image-new height length RGB)))
(border (/ height 4))
(ruler-layer (car (gimp-layer-new img (+ length height) (+ height height) RGBA_IMAGE "Ruler" 100 NORMAL)))
@ -43,7 +47,11 @@
(gimp-rect-select img (/ height 2) (/ height 2) length height REPLACE FALSE 0)
(gimp-palette-set-foreground '(79 79 79))
(gimp-palette-set-background '(0 0 0))
(gimp-blend ruler-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 height height)
(gimp-blend ruler-layer FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 height height)
(gimp-palette-set-foreground glow-color)
(gimp-selection-grow img border)
@ -61,8 +69,6 @@
(gimp-display-new img)))
(script-fu-register "script-fu-alien-glow-horizontal-ruler"
_"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow/Hrule..."
"Create an Hrule with the Alien Glow look"
@ -70,12 +76,8 @@
"Adrian Likins"
"1997"
""
SF-ADJUSTMENT _"Bar Length" '(480 5 1500 1 10 0 1)
SF-ADJUSTMENT _"Bar Height" '(16 1 100 1 10 0 1)
SF-COLOR _"Glow Color" '(63 252 0)
SF-COLOR _"Background Color" '(0 0 0)
SF-TOGGLE _"Flatten Image" TRUE)
SF-ADJUSTMENT _"Bar Length" '(480 5 1500 1 10 0 1)
SF-ADJUSTMENT _"Bar Height" '(16 1 100 1 10 0 1)
SF-COLOR _"Glow Color" '(63 252 0)
SF-COLOR _"Background Color" '(0 0 0)
SF-TOGGLE _"Flatten Image" TRUE)

View File

@ -19,12 +19,23 @@
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (center-ellipse img cx cy rx ry op aa feather frad)
(gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx ) (+ ry ry ) op aa feather frad))
(define (center-ellipse img
cx
cy
rx
ry
op
aa
feather
frad)
(gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
op aa feather frad))
(define (script-fu-alien-glow-bullet radius glow-color bg-color flatten)
(define (script-fu-alien-glow-bullet radius
glow-color
bg-color
flatten)
(let* ((img (car (gimp-image-new radius radius RGB)))
(border (/ radius 4))
(diameter (* radius 2))
@ -35,24 +46,31 @@
(bg-layer (car (gimp-layer-new img diameter diameter RGB_IMAGE "Back" 100 NORMAL)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-image-undo-disable img)
(gimp-image-resize img diameter diameter 0 0)
(gimp-image-add-layer img bg-layer 1)
(gimp-image-add-layer img glow-layer -1)
(gimp-image-add-layer img bullet-layer -1)
; (gimp-layer-set-preserve-trans ruler-layer TRUE)
; (gimp-layer-set-preserve-trans ruler-layer TRUE)
(gimp-palette-set-background bg-color)
(gimp-edit-fill bg-layer BG-IMAGE-FILL)
(gimp-edit-clear glow-layer)
(gimp-edit-clear bullet-layer)
(center-ellipse img radius radius half-radius half-radius REPLACE TRUE FALSE 0)
(center-ellipse img radius radius half-radius half-radius
REPLACE TRUE FALSE 0)
; (gimp-rect-select img (/ height 2) (/ height 2) length height REPLACE FALSE 0)
; (gimp-rect-select img (/ height 2) (/ height 2) length height REPLACE FALSE 0)
(gimp-palette-set-foreground '(90 90 90))
(gimp-palette-set-background '(0 0 0))
(gimp-blend bullet-layer FG-BG-RGB NORMAL RADIAL 100 0 REPEAT-NONE FALSE 0 0 TRUE blend-start blend-start (+ half-radius radius)(+ half-radius radius ))
(gimp-blend bullet-layer FG-BG-RGB NORMAL
RADIAL 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
blend-start blend-start
(+ half-radius radius) (+ half-radius radius))
(gimp-palette-set-foreground glow-color)
(gimp-selection-grow img border)
@ -71,9 +89,6 @@
(gimp-image-undo-enable img)
(gimp-display-new img)))
(script-fu-register "script-fu-alien-glow-bullet"
_"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow/Bullet..."
"Create a Bullet with an Alien Glow theme for web pages"
@ -81,8 +96,7 @@
"Adrian Likins"
"1997"
""
SF-ADJUSTMENT _"Radius" '(16 1 100 1 10 0 1)
SF-COLOR _"Glow Color" '(63 252 0)
SF-ADJUSTMENT _"Radius" '(16 1 100 1 10 0 1)
SF-COLOR _"Glow Color" '(63 252 0)
SF-COLOR _"Background Color" '(0 0 0)
SF-TOGGLE _"Flatten Image" TRUE)
SF-TOGGLE _"Flatten Image" TRUE)

View File

@ -35,32 +35,26 @@
(define (text-descent extents)
(cadr (cddr extents)))
(define (blend-bumpmap img drawable x1 y1 x2 y2)
(gimp-blend drawable
FG-BG-RGB
DARKEN-ONLY
LINEAR
100
0
REPEAT-NONE
FALSE
0
0
TRUE
x1
y1
x2
y2))
(define (blend-bumpmap img
drawable
x1
y1
x2
y2)
(gimp-blend drawable FG-BG-RGB DARKEN-ONLY
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
x1 y1 x2 y2))
(define (script-fu-alien-glow-button text
font
size
text-color
glow-color
bg-color
padding
glow-radius
flatten)
font
size
text-color
glow-color
bg-color
padding
glow-radius
flatten)
(let* ((old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents-fontname text
@ -101,9 +95,21 @@
(gimp-rect-select img 0 0 img-width img-height REPLACE FALSE 0)
(gimp-palette-set-foreground '(100 100 100))
(gimp-palette-set-background '(0 0 0))
(gimp-blend button-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 img-height img-width)
(gimp-blend button-layer FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 img-height img-width)
(gimp-edit-clear glow-layer)
(gimp-rect-select img (/ glow-radius 4) (/ glow-radius 4) (- img-width (/ glow-radius 2)) (- img-height (/ glow-radius 2)) REPLACE FALSE 0 )
(gimp-rect-select img
(/ glow-radius 4)
(/ glow-radius 4)
(- img-width (/ glow-radius 2))
(- img-height (/ glow-radius 2))
REPLACE FALSE 0 )
(gimp-palette-set-foreground glow-color)
(gimp-edit-fill glow-layer FG-IMAGE-FILL)
(gimp-selection-none img)
@ -123,8 +129,6 @@
(gimp-image-flatten img))
(gimp-display-new img)))
; Register!
(script-fu-register "script-fu-alien-glow-button"
_"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow/Button..."
"Button with an eerie glow"
@ -132,12 +136,12 @@
"Adrian Likins"
"July 1997"
""
SF-STRING _"Text" "Hello world!"
SF-FONT _"Font" "Futura_Poster"
SF-STRING _"Text" "Hello world!"
SF-FONT _"Font" "Futura_Poster"
SF-ADJUSTMENT _"Font Size (pixels)" '(22 2 100 1 1 0 1)
SF-COLOR _"Text Color" '(0 0 0)
SF-COLOR _"Glow Color" '(63 252 0)
SF-COLOR _"Background Color" '(0 0 0)
SF-ADJUSTMENT _"Padding" '(6 1 100 1 10 0 1)
SF-ADJUSTMENT _"Glow Radius" '(10 1 200 1 10 0 1)
SF-TOGGLE _"Flatten Image" TRUE)
SF-COLOR _"Text Color" '(0 0 0)
SF-COLOR _"Glow Color" '(63 252 0)
SF-COLOR _"Background Color" '(0 0 0)
SF-ADJUSTMENT _"Padding" '(6 1 100 1 10 0 1)
SF-ADJUSTMENT _"Glow Radius" '(10 1 200 1 10 0 1)
SF-TOGGLE _"Flatten Image" TRUE)

View File

@ -14,6 +14,7 @@
(glow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Alien Glow" 100 NORMAL)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img bg-layer 1)
@ -28,9 +29,15 @@
(gimp-palette-set-foreground glow-color)
(gimp-edit-fill glow-layer FG-IMAGE-FILL)
(gimp-selection-none img)
(gimp-palette-set-background '(0 0 0))
(gimp-palette-set-foreground '(79 79 79))
(gimp-blend logo-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 1 1)
(gimp-blend logo-layer FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)))
@ -51,10 +58,10 @@
"Spencer Kimball"
"1997"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Glow Size (pixels * 4)" '(150 2 1000 1 10 0 1)
SF-COLOR _"Glow Color" '(63 252 0))
SF-COLOR _"Glow Color" '(63 252 0))
(define (script-fu-alien-glow-logo text
size
@ -69,6 +76,7 @@
(height (car (gimp-drawable-height text-layer)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-alien-glow-logo-effect img text-layer size glow-color)
@ -82,7 +90,7 @@
"Spencer Kimball"
"1997"
""
SF-STRING _"Text" "ALIEN"
SF-STRING _"Text" "ALIEN"
SF-ADJUSTMENT _"Font Size (pixels)" '(150 2 1000 1 10 0 1)
SF-FONT _"Font" "Futura_Poster"
SF-COLOR _"Glow Color" '(63 252 0))
SF-FONT _"Font" "Futura_Poster"
SF-COLOR _"Glow Color" '(63 252 0))

View File

@ -11,6 +11,7 @@
(shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img shadow-layer 1)
@ -27,7 +28,12 @@
(gimp-edit-fill shadow-layer BG-IMAGE-FILL)
(gimp-selection-none img)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend logo-layer FG-BG-RGB MULTIPLY RADIAL 100 20 REPEAT-NONE FALSE 0 0 TRUE 0 0 width height)
(gimp-blend logo-layer FG-BG-RGB MULTIPLY
RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width height)
(gimp-layer-translate shadow-layer 3 3)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)))
@ -49,10 +55,10 @@
"Spencer Kimball"
"1996"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Text Color" '(6 6 206))
SF-COLOR _"Text Color" '(6 6 206))
(define (script-fu-basic1-logo text
size
@ -61,6 +67,7 @@
text-color)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-basic1-logo-effect img text-layer bg-color text-color)
@ -74,8 +81,8 @@
"Spencer Kimball"
"1996"
""
SF-STRING _"Text" "The Gimp"
SF-STRING _"Text" "The Gimp"
SF-ADJUSTMENT _"Font Size (pixels)" '(100 2 1000 1 10 0 1)
SF-FONT _"Font" "Dragonwick"
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Text Color" '(6 6 206))
SF-FONT _"Font" "Dragonwick"
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Text Color" '(6 6 206))

View File

@ -5,6 +5,7 @@
(let ((r (car color))
(g (cadr color))
(b (caddr color)))
(set! r (+ r (* (- 255 r) 0.75)))
(set! g (+ g (* (- 255 g) 0.75)))
(set! b (+ b (* (- 255 b) 0.75)))
@ -16,13 +17,14 @@
text-color)
(let* ((width (car (gimp-drawable-width logo-layer)))
(height (car (gimp-drawable-height logo-layer)))
(posx (- (car (gimp-drawable-offsets logo-layer))))
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
(posx (- (car (gimp-drawable-offsets logo-layer))))
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
(bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
(highlight-layer (car (gimp-layer-copy logo-layer TRUE)))
(shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img bg-layer 1)
@ -43,7 +45,12 @@
(gimp-edit-fill shadow-layer BG-IMAGE-FILL)
(gimp-selection-none img)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend logo-layer FG-BG-RGB MULTIPLY RADIAL 100 20 REPEAT-NONE FALSE 0 0 TRUE 0 0 width height)
(gimp-blend logo-layer FG-BG-RGB MULTIPLY
RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width height)
(gimp-layer-translate shadow-layer 3 3)
(gimp-layer-translate highlight-layer (- posx 2) (- posy 2))
(gimp-layer-set-name highlight-layer "Highlight")
@ -79,6 +86,7 @@
text-color)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-basic2-logo-effect img text-layer bg-color text-color)
@ -92,8 +100,8 @@
"Spencer Kimball"
"1996"
""
SF-STRING _"Text" "SCRIPT-FU"
SF-STRING _"Text" "SCRIPT-FU"
SF-ADJUSTMENT _"Font Size (pixels)" '(150 2 1000 1 10 0 1)
SF-FONT _"Font" "Futura_Poster"
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Text Color" '(206 6 50))
SF-FONT _"Font" "Futura_Poster"
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Text Color" '(206 6 50))

View File

@ -38,22 +38,16 @@
(define (text-descent extents)
(cadr (cddr extents)))
(define (blend-bumpmap img drawable x1 y1 x2 y2)
(gimp-blend drawable
FG-BG-RGB
DARKEN-ONLY
LINEAR
100
0
REPEAT-NONE
FALSE
0
0
TRUE
x1
y1
x2
y2))
(define (blend-bumpmap img
drawable
x1
y1
x2
y2)
(gimp-blend drawable FG-BG-RGB DARKEN-ONLY
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
x1 y1 x2 y2))
(define (script-fu-button00 text
size
@ -66,14 +60,14 @@
pressed)
(let* ((old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents-fontname text
size
PIXELS
font))
(ascent (text-ascent text-extents))
(descent (text-descent text-extents))
(img-width (+ (* 2 (+ padding bevel-width))
(text-width text-extents)))
(img-height (+ (* 2 (+ padding bevel-width))
@ -112,23 +106,14 @@
(gimp-image-add-layer img gradient -1)
(gimp-palette-set-foreground ul-color)
(gimp-palette-set-background lr-color)
(gimp-blend gradient
FG-BG-RGB
NORMAL
LINEAR
100
0
REPEAT-NONE
FALSE
0
0
TRUE
0
0
(- img-width 1)
(- img-height 1))
(plug-in-bump-map 1 img gradient bumpmap 135 45 bevel-width 0 0 0 0 TRUE pressed 0)
(gimp-blend gradient FG-BG-RGB NORMAL
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 (- img-width 1) (- img-height 1))
(plug-in-bump-map 1 img gradient bumpmap
135 45 bevel-width 0 0 0 0 TRUE pressed 0)
; Create text layer
@ -147,8 +132,6 @@
(gimp-image-undo-enable img)
(gimp-display-new img)))
; Register!
(script-fu-register "script-fu-button00"
_"<Toolbox>/Xtns/Script-Fu/Buttons/Simple Beveled Button..."
"Simple beveled button"
@ -156,12 +139,12 @@
"Federico Mena Quintero"
"June 1997"
""
SF-STRING _"Text" "Hello world!"
SF-STRING _"Text" "Hello world!"
SF-ADJUSTMENT _"Font Size (pixels)" '(16 2 100 1 1 0 1)
SF-FONT _"Font" "Sans"
SF-COLOR _"Upper-Left color" '(0 255 127)
SF-COLOR _"Lower-Right color" '(0 127 255)
SF-COLOR _"Text Color" '(0 0 0)
SF-ADJUSTMENT _"Padding" '(2 1 100 1 10 0 1)
SF-ADJUSTMENT _"Bevel Width" '(4 1 100 1 10 0 1)
SF-TOGGLE _"Pressed" FALSE)
SF-FONT _"Font" "Sans"
SF-COLOR _"Upper-Left color" '(0 255 127)
SF-COLOR _"Lower-Right color" '(0 127 255)
SF-COLOR _"Text Color" '(0 0 0)
SF-ADJUSTMENT _"Padding" '(2 1 100 1 10 0 1)
SF-ADJUSTMENT _"Bevel Width" '(4 1 100 1 10 0 1)
SF-TOGGLE _"Pressed" FALSE)

View File

@ -5,7 +5,9 @@
; if the blend colors are specified as high intensity, the sharp option
; should be enabled or the logo will come out blurry
(define (scale size percent) (* size percent))
(define (scale size
percent)
(* size percent))
(define (apply-blended-logo-effect img
logo-layer
@ -14,7 +16,8 @@
blend-mode
blend-fg
blend-bg
blend-gradient)
blend-gradient
blend-gradient-reverse)
(let* ((b-size-2 (scale b-size 0.5))
(f-size (scale b-size 0.75))
(ds-size (scale b-size 0.5))
@ -30,6 +33,7 @@
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background)))
(old-grad (car (gimp-gradients-get-gradient))))
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img shadow-layer 1)
(gimp-image-add-layer img blend-layer 1)
@ -54,12 +58,22 @@
(gimp-palette-set-background '(0 0 0))
(gimp-edit-fill text-shadow-layer BG-IMAGE-FILL)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend text-shadow-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 1 1)
(gimp-blend text-shadow-layer FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-selection-none img)
(gimp-palette-set-foreground blend-fg)
(gimp-palette-set-background blend-bg)
(gimp-gradients-set-gradient blend-gradient)
(gimp-blend blend-layer blend-mode NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 width 0)
(gimp-blend blend-layer blend-mode NORMAL
LINEAR 100 0 REPEAT-NONE blend-gradient-reverse
FALSE 0 0 TRUE
0 0 width 0)
(gimp-layer-translate logo-layer (- b-size-2) (- b-size-2))
(gimp-layer-translate blend-layer (- b-size) (- b-size))
(gimp-layer-translate text-shadow-layer (- ts-size) (- ts-size))
@ -81,11 +95,13 @@
blend-mode
blend-fg
blend-bg
blend-gradient)
blend-gradient
blend-gradient-reverse)
(begin
(gimp-undo-push-group-start img)
(apply-blended-logo-effect img logo-layer b-size bg-color
blend-mode blend-fg blend-bg blend-gradient)
blend-mode blend-fg blend-bg
blend-gradient blend-gradient-reverse)
(gimp-undo-push-group-end img)
(gimp-displays-flush)))
@ -97,17 +113,17 @@
"Spencer Kimball"
"1996"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Offset (pixels)" '(15 1 100 1 10 0 1)
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Offset (pixels)" '(15 1 100 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-OPTION _"Blend Mode" '(_"FG-BG-RGB" _"FG-BG-HSV"
_"FG-Transparent"
_"Custom Gradient")
SF-COLOR _"Start Blend" '(22 9 129)
SF-COLOR _"End Blend" '(129 9 82)
SF-GRADIENT _"Gradient" "Golden"
)
SF-OPTION _"Blend Mode" '(_"FG-BG-RGB" _"FG-BG-HSV"
_"FG-Transparent"
_"Custom Gradient")
SF-COLOR _"Start Blend" '(22 9 129)
SF-COLOR _"End Blend" '(129 9 82)
SF-GRADIENT _"Gradient" "Golden"
SF-TOGGLE _"Gradient Reverse" FALSE)
(define (script-fu-blended-logo text
size
@ -117,7 +133,8 @@
blend-mode
blend-fg
blend-bg
blend-gradient)
blend-gradient
blend-gradient-reverse)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(b-size (scale size 0.1))
(text-layer (car (gimp-text-fontname img -1 0 0 text b-size TRUE size PIXELS font)))
@ -129,7 +146,8 @@
(gimp-edit-fill text-layer FG-IMAGE-FILL)
(gimp-palette-set-foreground old-fg)
(apply-blended-logo-effect img text-layer b-size bg-color
blend-mode blend-fg blend-bg blend-gradient)
blend-mode blend-fg blend-bg
blend-gradient blend-gradient-reverse)
(gimp-image-undo-enable img)
(gimp-display-new img)))
@ -140,15 +158,16 @@
"Spencer Kimball"
"1996"
""
SF-STRING _"Text" "The GIMP"
SF-STRING _"Text" "The GIMP"
SF-ADJUSTMENT _"Font Size (pixels)" '(150 2 1000 1 10 0 1)
SF-FONT _"Font" "Crillee"
SF-COLOR _"Text Color" '(124 174 255)
SF-COLOR _"Background Color" '(255 255 255)
SF-OPTION _"Blend Mode" '(_"FG-BG-RGB" _"FG-BG-HSV"
_"FG-Transparent"
_"Custom Gradient")
SF-COLOR _"Start Blend" '(22 9 129)
SF-COLOR _"End Blend" '(129 9 82)
SF-GRADIENT _"Gradient" "Golden"
)
SF-FONT _"Font" "Crillee"
SF-COLOR _"Text Color" '(124 174 255)
SF-COLOR _"Background Color" '(255 255 255)
SF-OPTION _"Blend Mode" '(_"FG-BG-RGB"
_"FG-BG-HSV"
_"FG-Transparent"
_"Custom Gradient")
SF-COLOR _"Start Blend" '(22 9 129)
SF-COLOR _"End Blend" '(129 9 82)
SF-GRADIENT _"Gradient" "Golden"
SF-TOGGLE _"Gradient Reverse" FALSE)

View File

@ -11,168 +11,171 @@
; Copying Policy: GNU Public License http://www.gnu.org
;
(define (script-fu-burn-in-anim org-img org-layer glow-color
fadeout bl-width corona-width after-glow show-glow optimize speed)
(define (script-fu-burn-in-anim org-img
org-layer
glow-color
fadeout
bl-width
corona-width
after-glow
show-glow
optimize
speed)
(let* (
;--- main variable: "bl-x" runs from 0 to layer-width
(bl-x 0)
(frame-nr 0)
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))) )
(let* (
;--- main variable: "bl-x" runs from 0 to layer-width
(bl-x 0)
(frame-nr 0)
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(if (< speed 1)
(set! speed (* -1 speed)) )
;--- check image and work on a copy
(if (= (car (gimp-image-get-layers org-img)) 2)
;--- check image and work on a copy
(if (= (car (gimp-image-get-layers org-img)) 2)
;--- main program structure starts here, begin of "if-1"
(begin
(set! img (car (gimp-image-duplicate org-img)))
(gimp-image-undo-disable img)
(if (> (car (gimp-drawable-type org-layer)) 1 )
(gimp-convert-rgb img))
(set! source-layer (aref (cadr (gimp-image-get-layers img)) 0 ))
(set! bg-source-layer (aref (cadr (gimp-image-get-layers img)) 1 ))
(set! source-layer-width (car (gimp-drawable-width source-layer)))
;--- hide layers, cause we want to "merge visible layers" later
(gimp-layer-set-visible source-layer FALSE)
(gimp-layer-set-visible bg-source-layer FALSE)
;--- process image horizontal with pixel-speed
(while (< bl-x (+ source-layer-width bl-width))
(set! bl-layer (car (gimp-layer-copy source-layer TRUE)))
(set! bl-layer-name (string-append "fr-nr"
(number->string frame-nr 10) ) )
(gimp-image-add-layer img bl-layer -2)
(gimp-layer-set-name bl-layer bl-layer-name)
(gimp-layer-set-visible bl-layer TRUE)
(gimp-layer-set-preserve-trans bl-layer TRUE)
(gimp-layer-add-alpha bl-layer)
;--- add an alpha mask for blending and select it
(gimp-selection-layer-alpha bl-layer)
(set! bl-mask (car (gimp-layer-create-mask bl-layer BLACK-MASK)))
(gimp-image-add-layer-mask img bl-layer bl-mask)
;--- handle layer geometry
(set! bl-layer-width source-layer-width)
(set! bl-height (car (gimp-drawable-height bl-layer)))
(set! bl-x-off (- bl-x bl-width))
(set! bl-x-off (+ bl-x-off (car (gimp-drawable-offsets bl-layer))))
(set! bl-y-off (cadr (gimp-drawable-offsets bl-layer)))
;--- select a rectangular area to blend
(gimp-rect-select img bl-x-off bl-y-off bl-width bl-height REPLACE 0 0)
;--- select at least 1 pixel!
(gimp-rect-select img bl-x-off bl-y-off (+ bl-width 1) bl-height ADD 0 0)
(if (= fadeout FALSE)
;--- main program structure starts here, begin of "if-1"
(begin
(set! nofadeout-bl-x-off (car (gimp-drawable-offsets bl-layer)))
(set! nofadeout-bl-width (+ nofadeout-bl-x-off bl-x))
(set! nofadeout-bl-width (max nofadeout-bl-width 1))
(gimp-rect-select img nofadeout-bl-x-off bl-y-off
nofadeout-bl-width bl-height REPLACE 0 0)
) )
(set! img (car (gimp-image-duplicate org-img)))
(gimp-image-undo-disable img)
(if (> (car (gimp-drawable-type org-layer)) 1 )
(gimp-convert-rgb img))
(set! source-layer (aref (cadr (gimp-image-get-layers img)) 0 ))
(set! bg-source-layer (aref (cadr (gimp-image-get-layers img)) 1 ))
(set! source-layer-width (car (gimp-drawable-width source-layer)))
;--- alpha blending text to trans (fadeout)
(gimp-palette-set-foreground '(255 255 255))
(gimp-palette-set-background '( 0 0 0))
(if (= fadeout TRUE)
(begin
; blend with 20% offset to get less transparency in the front
(gimp-blend bl-mask FG-BG-RGB NORMAL-MODE LINEAR 100 20 REPEAT-NONE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0 bl-x-off 0)
)
)
(if (= fadeout FALSE)
(begin
(gimp-palette-set-foreground '(255 255 255))
(gimp-bucket-fill bl-mask FG-BUCKET-FILL NORMAL-MODE
100 255 0 0 0) ) )
;--- hide layers, cause we want to "merge visible layers" later
(gimp-layer-set-visible source-layer FALSE)
(gimp-layer-set-visible bg-source-layer FALSE)
(gimp-image-remove-layer-mask img bl-layer APPLY)
;--- process image horizontal with pixel-speed
(while (< bl-x (+ source-layer-width bl-width))
(set! bl-layer (car (gimp-layer-copy source-layer TRUE)))
(set! bl-layer-name (string-append "fr-nr"
(number->string frame-nr 10) ) )
;--- add bright glow in front
(if (= show-glow TRUE) (begin
;--- add some brightness to whole text
(if (= fadeout TRUE)
(gimp-brightness-contrast bl-layer 100 0)
)
(gimp-image-add-layer img bl-layer -2)
(gimp-layer-set-name bl-layer bl-layer-name)
(gimp-layer-set-visible bl-layer TRUE)
(gimp-layer-set-preserve-trans bl-layer TRUE)
(gimp-layer-add-alpha bl-layer)
;--- blend glow color inside the letters
(gimp-palette-set-foreground glow-color)
(gimp-blend bl-layer FG-TRANS NORMAL-MODE LINEAR 100 0 REPEAT-NONE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0
(- (+ bl-x-off bl-width) after-glow ) 0)
;--- add an alpha mask for blending and select it
(gimp-selection-layer-alpha bl-layer)
(set! bl-mask (car (gimp-layer-create-mask bl-layer BLACK-MASK)))
(gimp-image-add-layer-mask img bl-layer bl-mask)
;--- add corona effect
(gimp-selection-layer-alpha bl-layer)
(gimp-selection-sharpen img)
(gimp-selection-grow img corona-width)
(gimp-layer-set-preserve-trans bl-layer FALSE)
(gimp-selection-feather img corona-width)
(gimp-palette-set-foreground glow-color)
(gimp-blend bl-layer FG-TRANS NORMAL-MODE LINEAR 100 0 REPEAT-NONE
FALSE 0 0 TRUE
(- (+ bl-x-off bl-width) corona-width) 0
(- (+ bl-x-off bl-width) after-glow ) 0)
))
;--- handle layer geometry
(set! bl-layer-width source-layer-width)
(set! bl-height (car (gimp-drawable-height bl-layer)))
(set! bl-x-off (- bl-x bl-width))
(set! bl-x-off (+ bl-x-off (car (gimp-drawable-offsets bl-layer))))
(set! bl-y-off (cadr (gimp-drawable-offsets bl-layer)))
;--- merge with bg layer
(set! bg-layer (car (gimp-layer-copy bg-source-layer FALSE)))
(gimp-image-add-layer img bg-layer -1)
(gimp-image-lower-layer img bg-layer)
(set! bg-layer-name (string-append "bg-"
(number->string frame-nr 10) ) )
(gimp-layer-set-name bg-layer bg-layer-name)
(gimp-layer-set-visible bg-layer TRUE)
(set! blended-layer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))
;(set! blended-layer bl-layer)
(gimp-layer-set-visible blended-layer FALSE)
;--- select a rectangular area to blend
(gimp-rect-select img bl-x-off bl-y-off bl-width bl-height REPLACE 0 0)
;--- select at least 1 pixel!
(gimp-rect-select img bl-x-off bl-y-off (+ bl-width 1) bl-height ADD 0 0)
;--- end of "while" loop
(set! frame-nr (+ frame-nr 1))
(set! bl-x (+ bl-x speed))
)
(if (= fadeout FALSE)
(begin
(set! nofadeout-bl-x-off (car (gimp-drawable-offsets bl-layer)))
(set! nofadeout-bl-width (+ nofadeout-bl-x-off bl-x))
(set! nofadeout-bl-width (max nofadeout-bl-width 1))
(gimp-rect-select img nofadeout-bl-x-off bl-y-off
nofadeout-bl-width bl-height
REPLACE 0 0)))
;--- alpha blending text to trans (fadeout)
(gimp-palette-set-foreground '(255 255 255))
(gimp-palette-set-background '( 0 0 0))
(if (= fadeout TRUE)
(begin
; blend with 20% offset to get less transparency in the front
(gimp-blend bl-mask FG-BG-RGB NORMAL-MODE
LINEAR 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0 bl-x-off 0)))
;--- finalize the job
(gimp-selection-none img)
(gimp-image-remove-layer img source-layer)
(gimp-image-remove-layer img bg-source-layer)
(if (= fadeout FALSE)
(begin
(gimp-palette-set-foreground '(255 255 255))
(gimp-bucket-fill bl-mask FG-BUCKET-FILL NORMAL-MODE
100 255 0 0 0)))
(gimp-image-set-filename img "burn-in")
(gimp-image-remove-layer-mask img bl-layer APPLY)
(if (= optimize TRUE) (begin
(gimp-convert-indexed img 1 WEB-PALETTE 250 FALSE TRUE "")
(set! img-out (car (plug-in-animationoptimize 0 img bl-layer)))
))
;--- add bright glow in front
(if (= show-glow TRUE)
(begin
;--- add some brightness to whole text
(if (= fadeout TRUE)
(gimp-brightness-contrast bl-layer 100 0)))
(gimp-layer-set-visible (aref (cadr (gimp-image-get-layers img)) 0 ) TRUE)
(gimp-image-undo-enable img)
(gimp-image-clean-all img)
(set! img-display (car (gimp-display-new img)))
(gimp-palette-set-foreground old-fg)
(gimp-palette-set-background old-bg)
;--- blend glow color inside the letters
(gimp-palette-set-foreground glow-color)
(gimp-blend bl-layer FG-TRANS NORMAL-MODE
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0
(- (+ bl-x-off bl-width) after-glow) 0)
(gimp-displays-flush)
;--- add corona effect
(gimp-selection-layer-alpha bl-layer)
(gimp-selection-sharpen img)
(gimp-selection-grow img corona-width)
(gimp-layer-set-preserve-trans bl-layer FALSE)
(gimp-selection-feather img corona-width)
(gimp-palette-set-foreground glow-color)
(gimp-blend bl-layer FG-TRANS NORMAL-MODE
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(- (+ bl-x-off bl-width) corona-width) 0
(- (+ bl-x-off bl-width) after-glow) 0)))
;--- false form of "if-1"
)
(gimp-message _"Burn-In: Need two layers in total!
A foreground text layer with transparency
and a background layer.")
)
;--- merge with bg layer
(set! bg-layer (car (gimp-layer-copy bg-source-layer FALSE)))
(gimp-image-add-layer img bg-layer -1)
(gimp-image-lower-layer img bg-layer)
(set! bg-layer-name (string-append "bg-"
(number->string frame-nr 10)))
(gimp-layer-set-name bg-layer bg-layer-name)
(gimp-layer-set-visible bg-layer TRUE)
(set! blended-layer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))
;(set! blended-layer bl-layer)
(gimp-layer-set-visible blended-layer FALSE)
;--- end of main program
))
;--- end of "while" loop
(set! frame-nr (+ frame-nr 1))
(set! bl-x (+ bl-x speed)))
;--- finalize the job
(gimp-selection-none img)
(gimp-image-remove-layer img source-layer)
(gimp-image-remove-layer img bg-source-layer)
(gimp-image-set-filename img "burn-in")
(if (= optimize TRUE)
(begin
(gimp-convert-indexed img 1 WEB-PALETTE 250 FALSE TRUE "")
(set! img-out (car (plug-in-animationoptimize 0 img bl-layer)))))
(gimp-layer-set-visible (aref (cadr (gimp-image-get-layers img)) 0)
TRUE)
(gimp-image-undo-enable img)
(gimp-image-clean-all img)
(set! img-display (car (gimp-display-new img)))
(gimp-palette-set-foreground old-fg)
(gimp-palette-set-background old-bg)
(gimp-displays-flush))
;--- false form of "if-1"
(gimp-message _"Burn-In: Need two layers in total!"
"A foreground text layer with transparency"
"and a background layer.")))
(script-fu-register "script-fu-burn-in-anim"
@ -182,14 +185,13 @@
"Roland Berger"
"January 2001"
"RGBA GRAYA INDEXEDA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "Layer to animate" 0
SF-COLOR _"Glow Color" '(255 255 255)
SF-TOGGLE _"Fadeout" FALSE
SF-VALUE _"Fadeout Width" "100"
SF-VALUE _"Corona Width" "7"
SF-VALUE _"After Glow" "50"
SF-TOGGLE _"Add Glowing" TRUE
SF-TOGGLE _"Prepare for GIF" FALSE
SF-VALUE _"Speed (pixels/frame)" "50"
)
SF-IMAGE "The Image" 0
SF-DRAWABLE "Layer to animate" 0
SF-COLOR _"Glow Color" '(255 255 255)
SF-TOGGLE _"Fadeout" FALSE
SF-VALUE _"Fadeout Width" "100"
SF-VALUE _"Corona Width" "7"
SF-VALUE _"After Glow" "50"
SF-TOGGLE _"Add Glowing" TRUE
SF-TOGGLE _"Prepare for GIF" FALSE
SF-VALUE _"Speed (pixels/frame)" "50")

View File

@ -53,8 +53,11 @@
(gimp-gradients-set-gradient "Coffee")
(gimp-blend theStain CUSTOM NORMAL SHAPEBURST-DIMPLED
100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 0 0)
(gimp-blend theStain CUSTOM NORMAL
SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 0 0)
(gimp-layer-set-offsets theStain
(- (rand theWidth) (/ theSize 2))
(- (rand theHeight) (/ theSize 2)) theSize))

View File

@ -22,6 +22,7 @@
(define (apply-comic-logo-effect img
logo-layer
gradient
gradient-reverse
ol-width
ol-color
bg-color)
@ -35,6 +36,7 @@
(old-gradient (car (gimp-gradients-get-gradient)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img bg-layer 1)
(gimp-image-add-layer img white-layer 1)
@ -71,7 +73,12 @@
(gimp-gradients-set-gradient gradient)
(gimp-layer-set-preserve-trans logo-layer TRUE)
(gimp-selection-all img)
(gimp-blend logo-layer CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 (* height 0.33333) 0 (* height 0.83333))
(gimp-blend logo-layer CUSTOM NORMAL
LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 (* height 0.33333) 0 (* height 0.83333))
(plug-in-noisify 1 img logo-layer 0 0.20 0.20 0.20 0.20)
(gimp-selection-none img)
(gimp-layer-set-preserve-trans logo-layer FALSE)
@ -102,19 +109,20 @@
"Brian McFee"
"April 1998"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-GRADIENT _"Gradient" "Incandescent"
SF-ADJUSTMENT _"Outline Size" '(5 1 100 1 10 0 1)
SF-COLOR _"Outline Color" '(255 255 255)
SF-COLOR _"Background Color" '(255 255 255)
)
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-GRADIENT _"Gradient" "Incandescent"
SF-TOGGLE _"Gradient Reverse" FALSE
SF-ADJUSTMENT _"Outline Size" '(5 1 100 1 10 0 1)
SF-COLOR _"Outline Color" '(255 255 255)
SF-COLOR _"Background Color" '(255 255 255))
(define (script-fu-comic-logo text
size
font
gradient
gradient-reverse
ol-width
ol-color
bg-color)
@ -123,7 +131,8 @@
(text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-comic-logo-effect img text-layer gradient ol-width ol-color
(apply-comic-logo-effect img text-layer gradient gradient-reverse
ol-width ol-color
bg-color)
(gimp-image-undo-enable img)
(gimp-display-new img)))
@ -135,11 +144,11 @@
"Brian McFee"
"April 1998"
""
SF-STRING _"Text" "Moo"
SF-STRING _"Text" "Moo"
SF-ADJUSTMENT _"Font Size (pixels)" '(85 2 1000 1 10 0 1)
SF-FONT _"Font" "Tribeca"
SF-GRADIENT _"Gradient" "Incandescent"
SF-ADJUSTMENT _"Outline Size" '(5 1 100 1 10 0 1)
SF-COLOR _"Outline Color" '(255 255 255)
SF-COLOR _"Background Color" '(255 255 255)
)
SF-FONT _"Font" "Tribeca"
SF-GRADIENT _"Gradient" "Incandescent"
SF-TOGGLE _"Gradient Reverse" FALSE
SF-ADJUSTMENT _"Outline Size" '(5 1 100 1 10 0 1)
SF-COLOR _"Outline Color" '(255 255 255)
SF-COLOR _"Background Color" '(255 255 255))

View File

@ -8,7 +8,8 @@
logo-layer
size
bg-color
gradient)
gradient
gradient-reverse)
(let* ((feather (/ size 5))
(smear 7.5)
(period (/ size 3))
@ -30,6 +31,7 @@
(old-gradient (car (gimp-gradients-get-gradient)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-selection-none img)
(gimp-image-resize img img-width img-height posx posy)
(gimp-image-add-layer img bg-layer 1)
@ -44,7 +46,12 @@
(gimp-edit-fill shadow-layer BG-IMAGE-FILL)
(gimp-gradients-set-gradient gradient)
(gimp-blend logo-layer CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 0 (+ height 5))
(gimp-blend logo-layer CUSTOM NORMAL
LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))
(gimp-rect-select img 0 (- (/ height 2) feather) img-width (* 2 feather) REPLACE 0 0)
(plug-in-gauss-iir 1 img logo-layer smear TRUE TRUE)
(gimp-selection-none img)
@ -88,8 +95,10 @@
(gimp-image-add-layer-mask img reflect-layer layer-mask)
(gimp-palette-set-foreground '(255 255 255))
(gimp-palette-set-background '(0 0 0))
(gimp-blend layer-mask FG-BG-RGB NORMAL LINEAR 100 0 REPEAT-NONE
FALSE 0 0 TRUE 0 (- (/ height 2)) 0 height)
(gimp-blend layer-mask FG-BG-RGB NORMAL
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 (- (/ height 2)) 0 height)
(gimp-image-remove-channel img channel)
@ -102,10 +111,12 @@
logo-layer
size
bg-color
gradient)
gradient
gradient-reverse)
(begin
(gimp-undo-push-group-start img)
(apply-cool-metal-logo-effect img logo-layer size bg-color gradient)
(apply-cool-metal-logo-effect img logo-layer size bg-color
gradient gradient-reverse)
(gimp-undo-push-group-end img)
(gimp-displays-flush)))
@ -116,24 +127,27 @@
"Spencer Kimball & Rob Malda"
"1997"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Effect Size (pixels)" '(100 2 1000 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-GRADIENT _"Gradient" "Horizon 1"
)
SF-COLOR _"Background Color" '(255 255 255)
SF-GRADIENT _"Gradient" "Horizon 1"
SF-TOGGLE _"Gradient Reverse" FALSE)
(define (script-fu-cool-metal-logo text
size
font
bg-color
gradient)
gradient
gradient-reverse)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(text-layer (car (gimp-text-fontname img -1 0 0 text 0 TRUE size PIXELS font))))
(text-layer (car (gimp-text-fontname img -1 0 0 text 0 TRUE
size PIXELS font))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-cool-metal-logo-effect img text-layer size bg-color gradient)
(apply-cool-metal-logo-effect img text-layer size bg-color
gradient gradient-reverse)
(gimp-image-undo-enable img)
(gimp-display-new img)))
@ -144,9 +158,9 @@
"Spencer Kimball & Rob Malda"
"1997"
""
SF-STRING _"Text" "Cool Metal"
SF-STRING _"Text" "Cool Metal"
SF-ADJUSTMENT _"Font Size (pixels)" '(100 2 1000 1 10 0 1)
SF-FONT _"Font" "Crillee"
SF-COLOR _"Background Color" '(255 255 255)
SF-GRADIENT _"Gradient" "Horizon 1"
)
SF-FONT _"Font" "Crillee"
SF-COLOR _"Background Color" '(255 255 255)
SF-GRADIENT _"Gradient" "Horizon 1"
SF-TOGGLE _"Gradient Reverse" FALSE)

View File

@ -25,7 +25,9 @@
(define (apply-glossy-logo-effect img
logo-layer
blend-gradient-text
blend-gradient-text-reverse
blend-gradient-outline
blend-gradient-outline-reverse
grow-size
bg-color
use-pattern-text
@ -77,7 +79,11 @@
(if (= use-pattern-text FALSE)
(begin
(gimp-gradients-set-gradient blend-gradient-text)
(gimp-blend logo-layer CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 0 (+ height 5))))
(gimp-blend logo-layer CUSTOM NORMAL
LINEAR 100 0 REPEAT-NONE blend-gradient-text-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))))
(gimp-selection-none img)
@ -98,7 +104,11 @@
(if (= use-pattern-outline FALSE)
(begin
(gimp-gradients-set-gradient blend-gradient-outline)
(gimp-blend grow-me CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 0 (+ height 5))))
(gimp-blend grow-me CUSTOM NORMAL
LINEAR 100 0 REPEAT-NONE blend-gradient-outline-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))))
(gimp-selection-none img)
@ -129,7 +139,9 @@
(define (script-fu-glossy-logo-alpha img
logo-layer
blend-gradient-text
blend-gradient-text-reverse
blend-gradient-outline
blend-gradient-outline-reverse
grow-size
bg-color
use-pattern-text
@ -144,8 +156,12 @@
s-offset-y)
(begin
(gimp-undo-push-group-start img)
(apply-glossy-logo-effect img logo-layer blend-gradient-text
blend-gradient-outline grow-size bg-color
(apply-glossy-logo-effect img logo-layer
blend-gradient-text
blend-gradient-text-reverse
blend-gradient-outline
blend-gradient-outline-reverse
grow-size bg-color
use-pattern-text pattern-text
use-pattern-outline pattern-outline
use-pattern-overlay pattern-overlay
@ -162,30 +178,33 @@
"Hrvoje Horvat"
"14/04/1998"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-GRADIENT _"Blend Gradient (Text)" "Shadows 2"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-GRADIENT _"Blend Gradient (Text)" "Shadows 2"
SF-TOGGLE _"Text Gradient Reverse" FALSE
SF-GRADIENT _"Blend Gradient (Outline)" "Shadows 2"
SF-ADJUSTMENT _"Outline Size" '(5 0 250 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-TOGGLE _"Outline Gradient Reverse" FALSE
SF-ADJUSTMENT _"Outline Size" '(5 0 250 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-TOGGLE _"Use Pattern for Text instead of Gradient" FALSE
SF-PATTERN _"Pattern (Text)" "Electric Blue"
SF-PATTERN _"Pattern (Text)" "Electric Blue"
SF-TOGGLE _"Use Pattern for Outline instead of Gradient" FALSE
SF-PATTERN _"Pattern (Outline)" "Electric Blue"
SF-TOGGLE _"Use Pattern Overlay" FALSE
SF-PATTERN _"Pattern (Overlay)" "Parque #1"
SF-PATTERN _"Pattern (Outline)" "Electric Blue"
SF-TOGGLE _"Use Pattern Overlay" FALSE
SF-PATTERN _"Pattern (Overlay)" "Parque #1"
SF-TOGGLE _"Default Bumpmap Settings" TRUE
SF-TOGGLE _"Shadow" TRUE
SF-ADJUSTMENT _"Shadow X Offset" '(8 0 100 1 10 0 1)
SF-ADJUSTMENT _"Shadow Y Offset" '(8 0 100 1 10 0 1)
)
SF-TOGGLE _"Shadow" TRUE
SF-ADJUSTMENT _"Shadow X Offset" '(8 0 100 1 10 0 1)
SF-ADJUSTMENT _"Shadow Y Offset" '(8 0 100 1 10 0 1))
(define (script-fu-glossy-logo text
size
font
blend-gradient-text
blend-gradient-text-reverse
blend-gradient-outline
blend-gradient-outline-reverse
grow-size
bg-color
use-pattern-text
@ -202,8 +221,12 @@
(text-layer (car (gimp-text-fontname img -1 0 0 text 30 TRUE size PIXELS font))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-glossy-logo-effect img text-layer blend-gradient-text
blend-gradient-outline grow-size bg-color
(apply-glossy-logo-effect img text-layer
blend-gradient-text
blend-gradient-text-reverse
blend-gradient-outline
blend-gradient-outline-reverse
grow-size bg-color
use-pattern-text pattern-text
use-pattern-outline pattern-outline
use-pattern-overlay pattern-overlay
@ -219,21 +242,22 @@
"Hrvoje Horvat"
"14/04/1998"
""
SF-STRING _"Text" "Galaxy"
SF-ADJUSTMENT _"Font Size (pixels)" '(100 2 1000 1 10 0 1)
SF-FONT _"Font" "Eras"
SF-GRADIENT _"Blend Gradient (Text)" "Shadows 2"
SF-STRING _"Text" "Galaxy"
SF-ADJUSTMENT _"Font Size (pixels)" '(100 2 1000 1 10 0 1)
SF-FONT _"Font" "Eras"
SF-GRADIENT _"Blend Gradient (Text)" "Shadows 2"
SF-TOGGLE _"Text Gradient Reverse" FALSE
SF-GRADIENT _"Blend Gradient (Outline)" "Shadows 2"
SF-ADJUSTMENT _"Outline Size" '(5 0 250 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-TOGGLE _"Outline Gradient Reverse" FALSE
SF-ADJUSTMENT _"Outline Size" '(5 0 250 1 10 0 1)
SF-COLOR _"Background Color" '(255 255 255)
SF-TOGGLE _"Use Pattern for Text instead of Gradient" FALSE
SF-PATTERN _"Pattern (Text)" "Electric Blue"
SF-PATTERN _"Pattern (Text)" "Electric Blue"
SF-TOGGLE _"Use Pattern for Outline instead of Gradient" FALSE
SF-PATTERN _"Pattern (Outline)" "Electric Blue"
SF-TOGGLE _"Use Pattern Overlay" FALSE
SF-PATTERN _"Pattern (Overlay)" "Parque #1"
SF-PATTERN _"Pattern (Outline)" "Electric Blue"
SF-TOGGLE _"Use Pattern Overlay" FALSE
SF-PATTERN _"Pattern (Overlay)" "Parque #1"
SF-TOGGLE _"Default Bumpmap Settings" TRUE
SF-TOGGLE _"Shadow" TRUE
SF-ADJUSTMENT _"Shadow X Offset" '(8 0 100 1 10 0 1)
SF-ADJUSTMENT _"Shadow Y Offset" '(8 0 100 1 10 0 1)
)
SF-TOGGLE _"Shadow" TRUE
SF-ADJUSTMENT _"Shadow X Offset" '(8 0 100 1 10 0 1)
SF-ADJUSTMENT _"Shadow Y Offset" '(8 0 100 1 10 0 1))

View File

@ -33,6 +33,7 @@
(blur-layer (car (gimp-layer-new img width height RGBA_IMAGE "Blur" 100 NORMAL)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img bg-layer 1)
(gimp-image-add-layer img blur-layer 1)
@ -57,7 +58,12 @@
(gimp-palette-set-foreground '(255 255 255))
(gimp-layer-set-preserve-trans logo-layer TRUE)
(gimp-selection-all img)
(gimp-blend logo-layer FG-BG-RGB NORMAL RADIAL 95 0 REPEAT-NONE FALSE 0 0 TRUE indentX indentY indentX (- height indentY))
(gimp-blend logo-layer FG-BG-RGB NORMAL
RADIAL 95 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
indentX indentY indentX (- height indentY))
(gimp-selection-none img)
(gimp-layer-set-preserve-trans logo-layer FALSE)
(plug-in-bump-map 1 img logo-layer blur-layer 115 bevel-height 5 0 0 0 15 TRUE FALSE 0)
@ -88,13 +94,12 @@
"Brian McFee"
"April 1998"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Border Size (pixels)" '(22 1 300 1 10 0 1)
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Border Size (pixels)" '(22 1 300 1 10 0 1)
SF-ADJUSTMENT _"Bevel Height (Sharpness)" '(40 1 250 1 10 0 1)
SF-ADJUSTMENT _"Bevel Width" '(2.5 1 200 1 10 1 1)
SF-COLOR _"Background Color" '(255 255 255)
)
SF-ADJUSTMENT _"Bevel Width" '(2.5 1 200 1 10 1 1)
SF-COLOR _"Background Color" '(255 255 255))
(define (script-fu-gradient-bevel-logo text
size
@ -104,7 +109,8 @@
bg-color)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(border (/ size 4))
(text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font))))
(text-layer (car (gimp-text-fontname img -1 0 0 text
border TRUE size PIXELS font))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-gradient-bevel-logo-effect img text-layer border
@ -119,10 +125,9 @@
"Brian McFee"
"April 1998"
""
SF-STRING _"Text" "Moo"
SF-ADJUSTMENT _"Font Size (pixels)" '(90 2 1000 1 10 0 1)
SF-FONT _"Font" "Futura_Poster"
SF-STRING _"Text" "Moo"
SF-ADJUSTMENT _"Font Size (pixels)" '(90 2 1000 1 10 0 1)
SF-FONT _"Font" "Futura_Poster"
SF-ADJUSTMENT _"Bevel Height (Sharpness)" '(40 1 250 1 10 0 1)
SF-ADJUSTMENT _"Bevel Width" '(2.5 1 200 1 10 1 1)
SF-COLOR _"Background Color" '(255 255 255)
)
SF-ADJUSTMENT _"Bevel Width" '(2.5 1 200 1 10 1 1)
SF-COLOR _"Background Color" '(255 255 255))

View File

@ -19,9 +19,12 @@
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (script-fu-gradient-example width height)
(define (script-fu-gradient-example width
height
gradient-reverse)
(let* ((img (car (gimp-image-new width height RGB)))
(drawable (car (gimp-layer-new img width height RGB "Gradient example" 100 NORMAL)))
(drawable (car (gimp-layer-new img width height RGB
"Gradient example" 100 NORMAL)))
; Save old foreground and background colors
@ -44,7 +47,10 @@
; Render gradient
(gimp-blend drawable CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 (- width 1) 0)
(gimp-blend drawable CUSTOM NORMAL
LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 0 (- width 1) 0)
; Terminate
@ -60,5 +66,6 @@
"Federico Mena Quintero"
"June 1997"
""
SF-ADJUSTMENT _"Width" '(400 1 2000 1 10 0 1)
SF-ADJUSTMENT _"Height" '(30 1 2000 1 10 0 1))
SF-ADJUSTMENT _"Width" '(400 1 2000 1 10 0 1)
SF-ADJUSTMENT _"Height" '(30 1 2000 1 10 0 1)
SF-TOGGLE _"Gradient Reverse" FALSE)

View File

@ -37,30 +37,35 @@
(define (text-descent extents)
(cadr (cddr extents)))
(define (round-select img x y width height ratio)
(define (round-select img
x
y
width
height
ratio)
(let* ((diameter (* ratio height)))
(gimp-ellipse-select img x y diameter height ADD FALSE 0 0)
(gimp-ellipse-select img (+ x (- width diameter)) y
diameter height ADD FALSE 0 0)
(gimp-rect-select img (+ x (/ diameter 2)) y
(- width diameter) height ADD FALSE 0)))
(define (script-fu-round-button text
size
font
ul-color
lr-color
text-color
ul-color-high
lr-color-high
hlight-color
xpadding
ypadding
bevel
ratio
notpressed
notpressed-active
pressed)
size
font
ul-color
lr-color
text-color
ul-color-high
lr-color-high
hlight-color
xpadding
ypadding
bevel
ratio
notpressed
notpressed-active
pressed)
(cond ((eqv? notpressed TRUE)
(do-pupibutton text size font ul-color lr-color
@ -71,29 +76,29 @@
(cond ((eqv? pressed TRUE)
(do-pupibutton text size font ul-color-high lr-color-high
hlight-color xpadding ypadding bevel ratio 1))))
(define (do-pupibutton text
size
font
ul-color
lr-color
text-color
xpadding
ypadding
bevel
ratio
pressed)
size
font
ul-color
lr-color
text-color
xpadding
ypadding
bevel
ratio
pressed)
(let* ((old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents-fontname text
size
PIXELS
font))
size
PIXELS
font))
(ascent (text-ascent text-extents))
(descent (text-descent text-extents))
(height (+ (* 2 (+ ypadding bevel))
(+ ascent descent)))
@ -109,6 +114,7 @@
RGBA_IMAGE "Bumpmap" 100 NORMAL)))
(gradient (car (gimp-layer-new img width height
RGBA_IMAGE "Button" 100 NORMAL))))
(gimp-image-undo-disable img)
; Create bumpmap layer
@ -134,21 +140,10 @@
(gimp-palette-set-foreground ul-color)
(gimp-palette-set-background lr-color)
(gimp-blend gradient
FG-BG-RGB
NORMAL
LINEAR
100
0
REPEAT-NONE
FALSE
0
0
TRUE
0
0
0
(- height 1))
(gimp-blend gradient FG-BG-RGB NORMAL
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 0 (- height 1))
(gimp-selection-none img)
@ -185,8 +180,6 @@
(gimp-image-undo-enable img)
(gimp-display-new img)))
; Register!
(script-fu-register "script-fu-round-button"
_"<Toolbox>/Xtns/Script-Fu/Buttons/Round Button..."
"Round button"
@ -194,21 +187,19 @@
"Arturo Espinosa & Federico Mena Quintero"
"June 1998"
""
SF-STRING _"Text" "The GIMP"
SF-ADJUSTMENT _"Font Size (pixels)" '(16 2 100 1 1 0 1)
SF-FONT _"Font" "Sans"
SF-COLOR _"Upper Color" '(192 192 0)
SF-COLOR _"Lower Color" '(128 108 0)
SF-COLOR _"Text Color" '(0 0 0)
SF-STRING _"Text" "The GIMP"
SF-ADJUSTMENT _"Font Size (pixels)" '(16 2 100 1 1 0 1)
SF-FONT _"Font" "Sans"
SF-COLOR _"Upper Color" '(192 192 0)
SF-COLOR _"Lower Color" '(128 108 0)
SF-COLOR _"Text Color" '(0 0 0)
SF-COLOR _"Upper Color (Active)" '(255 255 0)
SF-COLOR _"Lower Color (Active)" '(128 108 0)
SF-COLOR _"Text Color (Active)" '(0 0 192)
SF-ADJUSTMENT _"Padding X" '(4 0 100 1 10 0 1)
SF-ADJUSTMENT _"Padding Y" '(4 0 100 1 10 0 1)
SF-ADJUSTMENT _"Bevel Width" '(2 0 100 1 10 0 1)
SF-ADJUSTMENT _"Round Ratio" '(1 0.05 20 0.05 1 2 1)
SF-TOGGLE _"Not Pressed" TRUE
SF-COLOR _"Text Color (Active)" '(0 0 192)
SF-ADJUSTMENT _"Padding X" '(4 0 100 1 10 0 1)
SF-ADJUSTMENT _"Padding Y" '(4 0 100 1 10 0 1)
SF-ADJUSTMENT _"Bevel Width" '(2 0 100 1 10 0 1)
SF-ADJUSTMENT _"Round Ratio" '(1 0.05 20 0.05 1 2 1)
SF-TOGGLE _"Not Pressed" TRUE
SF-TOGGLE _"Not Pressed (Active)" TRUE
SF-TOGGLE _"Pressed" TRUE)
SF-TOGGLE _"Pressed" TRUE)

View File

@ -1,6 +1,3 @@
;
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
@ -19,62 +16,71 @@
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (script-fu-render-map inSize inGrain inGrad inWiden)
(define (script-fu-render-map inSize
inGrain
inGrad
inWiden)
(set! old-gradient (car (gimp-gradients-get-gradient)))
(set! old-fg (car (gimp-palette-get-foreground)))
(set! old-bg (car (gimp-palette-get-background)))
(set! old-gradient (car (gimp-gradients-get-gradient)))
(set! old-fg (car (gimp-palette-get-foreground)))
(set! old-bg (car (gimp-palette-get-background)))
(set! theWidth inSize)
(set! theHeight inSize)
(set! theImage (car(gimp-image-new theWidth theHeight RGB)))
(set! theWidth inSize)
(set! theHeight inSize)
(set! theImage (car(gimp-image-new theWidth theHeight RGB)))
(gimp-selection-all theImage)
(gimp-selection-all theImage)
(set! theLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "I've got more rubber ducks than you!" 100 NORMAL)))
(gimp-image-add-layer theImage theLayer 0)
(plug-in-solid-noise TRUE theImage theLayer 1 0 (rand 65536) inGrain inGrain inGrain)
(set! theLayer (car (gimp-layer-new theImage theWidth theHeight
RGBA_IMAGE
"I've got more rubber ducks than you!"
100 NORMAL)))
(gimp-image-add-layer theImage theLayer 0)
(plug-in-solid-noise TRUE theImage theLayer 1 0 (rand 65536)
inGrain inGrain inGrain)
(if (= inWiden 1) (begin
(set! thinLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Camo Thin Layer" 100 NORMAL)))
(gimp-image-add-layer theImage thinLayer 0)
(let ((theBigGrain (min 15 (* 2 inGrain))))
(plug-in-solid-noise TRUE theImage thinLayer 1 0 (rand 65536) theBigGrain theBigGrain theBigGrain)
)
(gimp-palette-set-background '(255 255 255))
(gimp-palette-set-foreground '(0 0 0))
(let ((theMask (car(gimp-layer-create-mask thinLayer 0))))
(gimp-image-add-layer-mask theImage thinLayer theMask)
(gimp-blend theMask FG-BG-RGB NORMAL LINEAR 100
0 REPEAT-TRIANGULAR FALSE 0 0 TRUE 0 0 0 (/ theHeight 2) )
)
(set! theLayer (car(gimp-image-flatten theImage)))
))
(if (= inWiden 1)
(begin
(set! thinLayer (car (gimp-layer-new theImage theWidth theHeight
RGBA_IMAGE "Camo Thin Layer"
100 NORMAL)))
(gimp-image-add-layer theImage thinLayer 0)
(let ((theBigGrain (min 15 (* 2 inGrain))))
(plug-in-solid-noise TRUE theImage thinLayer 1 0 (rand 65536)
theBigGrain theBigGrain theBigGrain))
(gimp-palette-set-background '(255 255 255))
(gimp-palette-set-foreground '(0 0 0))
(let ((theMask (car (gimp-layer-create-mask thinLayer 0))))
(gimp-image-add-layer-mask theImage thinLayer theMask)
(gimp-blend theMask FG-BG-RGB NORMAL
LINEAR 100 0 REPEAT-TRIANGULAR FALSE
FALSE 0 0 TRUE
0 0 0 (/ theHeight 2)))
(set! theLayer (car(gimp-image-flatten theImage)))))
(gimp-selection-none theImage)
(gimp-gradients-set-gradient inGrad)
(plug-in-gradmap TRUE theImage theLayer)
(gimp-gradients-set-gradient old-gradient)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)
(gimp-display-new theImage)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-render-map"
_"<Toolbox>/Xtns/Script-Fu/Patterns/Render Map..."
"Another pattern which resembles a map"
"Chris Gutteridge: cjg@ecs.soton.ac.uk"
"28th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
""
SF-ADJUSTMENT _"Image Size" '(256 0 2048 1 10 0 0)
SF-ADJUSTMENT _"Granularity" '(4 0 15 1 1 0 0)
SF-GRADIENT _"Gradient" "Land and Sea"
SF-OPTION _"Behaviour" '(_"Tile" _"Detail in Middle")
)
(gimp-selection-none theImage)
(gimp-gradients-set-gradient inGrad)
(plug-in-gradmap TRUE theImage theLayer)
(gimp-gradients-set-gradient old-gradient)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)
(gimp-display-new theImage))
(script-fu-register "script-fu-render-map"
_"<Toolbox>/Xtns/Script-Fu/Patterns/Render Map..."
"Another pattern which resembles a map"
"Chris Gutteridge: cjg@ecs.soton.ac.uk"
"28th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
""
SF-ADJUSTMENT _"Image Size" '(256 0 2048 1 10 0 0)
SF-ADJUSTMENT _"Granularity" '(4 0 15 1 1 0 0)
SF-GRADIENT _"Gradient" "Land and Sea"
SF-TOGGLE _"Gradient Reverse" FALSE
SF-OPTION _"Behaviour" '(_"Tile"
_"Detail in Middle"))

View File

@ -7,11 +7,16 @@
; light: angle of light source in degrees
; shadow: whather to create a shadow as well
(define (script-fu-sphere radius light shadow bg-color sphere-color)
(define (script-fu-sphere radius
light
shadow
bg-color
sphere-color)
(let* ((width (* radius 3.75))
(height (* radius 2.5))
(img (car (gimp-image-new width height RGB)))
(drawable (car (gimp-layer-new img width height RGB_IMAGE "Sphere Layer" 100 NORMAL)))
(drawable (car (gimp-layer-new img width height RGB_IMAGE
"Sphere Layer" 100 NORMAL)))
(radians (/ (* light *pi*) 180))
(cx (/ width 2))
(cy (/ height 2))
@ -22,6 +27,7 @@
(offset (* radius 0.1))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-image-undo-disable img)
(gimp-image-add-layer img drawable 0)
(gimp-palette-set-foreground sphere-color)
@ -29,7 +35,8 @@
(gimp-edit-fill drawable BG-IMAGE-FILL)
(gimp-palette-set-background '(20 20 20))
(if (and
(or (and (>= light 45) (<= light 75)) (and (<= light 135) (>= light 105)))
(or (and (>= light 45) (<= light 75))
(and (<= light 135) (>= light 105)))
(= shadow TRUE))
(let ((shadow-w (* (* radius 2.5) (cos (+ *pi* radians))))
(shadow-h (* radius 0.5))
@ -38,11 +45,19 @@
(if (< shadow-w 0)
(prog1 (set! shadow-x (+ cx shadow-w))
(set! shadow-w (- shadow-w))))
(gimp-ellipse-select img shadow-x shadow-y shadow-w shadow-h REPLACE TRUE TRUE 7.5)
(gimp-bucket-fill drawable BG-BUCKET-FILL MULTIPLY 100 0 FALSE 0 0)))
(gimp-ellipse-select img (- cx radius) (- cy radius) (* 2 radius) (* 2 radius) REPLACE TRUE FALSE 0)
(gimp-blend drawable FG-BG-RGB NORMAL RADIAL 100 offset REPEAT-NONE
FALSE 0 0 TRUE light-x light-y light-end-x light-end-y)
(gimp-ellipse-select img shadow-x shadow-y shadow-w shadow-h
REPLACE TRUE TRUE 7.5)
(gimp-bucket-fill drawable BG-BUCKET-FILL MULTIPLY 100 0 FALSE 0 0)))
(gimp-ellipse-select img (- cx radius) (- cy radius)
(* 2 radius) (* 2 radius) REPLACE TRUE FALSE 0)
(gimp-blend drawable FG-BG-RGB NORMAL
RADIAL 100 offset REPEAT-NONE FALSE
FALSE 0 0 TRUE
light-x light-y light-end-x light-end-y)
(gimp-selection-none img)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)
@ -56,8 +71,8 @@
"Spencer Kimball"
"1996"
""
SF-ADJUSTMENT _"Radius (pixels)" '(100 5 500 1 10 0 1)
SF-ADJUSTMENT _"Radius (pixels)" '(100 5 500 1 10 0 1)
SF-ADJUSTMENT _"Lighting (degrees)" '(45 0 360 1 10 0 0)
SF-TOGGLE _"Shadow" TRUE
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Sphere Color" '(255 0 0))
SF-TOGGLE _"Shadow" TRUE
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Sphere Color" '(255 0 0))

View File

@ -1,13 +1,17 @@
; Nova Starscape
; Create a text effect that simulates an eerie alien glow around text
(define (find-blend-coords w h)
(define (find-blend-coords w
h)
(let* ((denom (+ (/ w h) (/ h w)))
(bx (/ (* -2 h) denom))
(by (/ (* -2 w) denom)))
(cons bx by)))
(define (find-nova-x-coord drawable x1 x2 y)
(define (find-nova-x-coord drawable
x1
x2
y)
(let* ((x 0)
(alpha 3)
(range (- x2 x1))
@ -59,6 +63,7 @@
(old-pattern (car (gimp-patterns-get-pattern)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img bg-layer 1)
@ -88,14 +93,19 @@
(gimp-selection-none img)
(gimp-palette-set-background '(31 31 31))
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend logo-layer FG-BG-RGB NORMAL BILINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE cx cy bx by)
(gimp-blend logo-layer FG-BG-RGB NORMAL
BILINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
cx cy bx by)
(plug-in-nova 1 img glow-layer novax novay glow-color novaradius 100 0)
(gimp-selection-all img)
(gimp-patterns-set-pattern "Stone")
(gimp-bucket-fill bump-channel PATTERN-BUCKET-FILL NORMAL 100 0 FALSE 0 0)
(plug-in-bump-map 1 img logo-layer bump-channel 135.0 45.0 4 0 0 0 0 FALSE FALSE 0)
(plug-in-bump-map 1 img logo-layer bump-channel
135.0 45.0 4 0 0 0 0 FALSE FALSE 0)
(gimp-image-remove-channel img bump-channel)
(gimp-selection-none img)
@ -103,7 +113,6 @@
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)))
(define (script-fu-starscape-logo-alpha img
logo-layer
size
@ -121,11 +130,10 @@
"Spencer Kimball"
"1997"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Effect Size (pixels * 4)" '(150 1 1000 1 10 0 1)
SF-COLOR _"Glow Color" '(28 65 188)
)
SF-COLOR _"Glow Color" '(28 65 188))
(define (script-fu-starscape-logo text
@ -134,7 +142,8 @@
glow-color)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(border (/ size 4))
(text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS fontname))))
(text-layer (car (gimp-text-fontname img -1 0 0 text border
TRUE size PIXELS fontname))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-starscape-logo-effect img text-layer size glow-color)
@ -148,8 +157,7 @@
"Spencer Kimball"
"1997"
""
SF-STRING _"Text" "Nova"
SF-STRING _"Text" "Nova"
SF-ADJUSTMENT _"Font Size (pixels)" '(150 1 1000 1 10 0 1)
SF-FONT _"Font" "Engraver"
SF-COLOR _"Glow Color" '(28 65 188)
)
SF-FONT _"Font" "Engraver"
SF-COLOR _"Glow Color" '(28 65 188))

View File

@ -107,24 +107,26 @@
; ----------------------------------------------------------------------
(define (script-fu-test-sphere radius
light
shadow
bg-color
sphere-color
brush
text
pattern
gradient
font
size
(define (script-fu-test-sphere radius
light
shadow
bg-color
sphere-color
brush
text
pattern
gradient
gradient-reverse
font
size
filename
orientation
dirname)
(let* ((width (* radius 3.75))
(height (* radius 2.5))
(img (car (gimp-image-new width height RGB)))
(drawable (car (gimp-layer-new img width height RGB_IMAGE "Sphere Layer" 100 NORMAL)))
(drawable (car (gimp-layer-new img width height RGB_IMAGE
"Sphere Layer" 100 NORMAL)))
(radians (/ (* light *pi*) 180))
(cx (/ width 2))
(cy (/ height 2))
@ -140,14 +142,17 @@
(old-gradient (car (gimp-gradients-get-gradient)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background))))
(gimp-image-undo-disable img)
(gimp-image-add-layer img drawable 0)
(gimp-palette-set-foreground sphere-color)
(gimp-palette-set-background bg-color)
(gimp-edit-fill drawable BG-IMAGE-FILL)
(gimp-palette-set-background '(20 20 20))
(if (and
(or (and (>= light 45) (<= light 75)) (and (<= light 135) (>= light 105)))
(or (and (>= light 45) (<= light 75))
(and (<= light 135) (>= light 105)))
(= shadow TRUE))
(let ((shadow-w (* (* radius 2.5) (cos (+ *pi* radians))))
(shadow-h (* radius 0.5))
@ -156,18 +161,31 @@
(if (< shadow-w 0)
(prog1 (set! shadow-x (+ cx shadow-w))
(set! shadow-w (- shadow-w))))
(gimp-ellipse-select img shadow-x shadow-y shadow-w shadow-h REPLACE TRUE TRUE 7.5)
(gimp-ellipse-select img shadow-x shadow-y shadow-w shadow-h
REPLACE TRUE TRUE 7.5)
(gimp-patterns-set-pattern pattern)
(gimp-bucket-fill drawable PATTERN-BUCKET-FILL MULTIPLY 100 0 FALSE 0 0)))
(gimp-ellipse-select img (- cx radius) (- cy radius) (* 2 radius) (* 2 radius) REPLACE TRUE FALSE 0)
(gimp-blend drawable FG-BG-RGB NORMAL RADIAL 100 offset REPEAT-NONE
FALSE 0 0 TRUE light-x light-y light-end-x light-end-y)
(gimp-bucket-fill drawable PATTERN-BUCKET-FILL MULTIPLY
100 0 FALSE 0 0)))
(gimp-ellipse-select img (- cx radius) (- cy radius)
(* 2 radius) (* 2 radius) REPLACE TRUE FALSE 0)
(gimp-blend drawable FG-BG-RGB NORMAL
RADIAL 100 offset REPEAT-NONE FALSE
FALSE 0 0 TRUE
light-x light-y light-end-x light-end-y)
(gimp-selection-none img)
(gimp-gradients-set-gradient gradient)
(gimp-ellipse-select img 10 10 50 50 REPLACE TRUE FALSE 0)
(gimp-blend drawable CUSTOM NORMAL LINEAR 100 offset REPEAT-NONE
FALSE 0 0 TRUE 10 10 30 60)
(gimp-blend drawable CUSTOM NORMAL
LINEAR 100 offset REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
10 10 30 60)
(gimp-selection-none img)
(gimp-palette-set-foreground '(0 0 0))
@ -194,15 +212,16 @@
""
SF-ADJUSTMENT "Radius (in pixels)" '(100 1 5000 1 10 0 1)
SF-ADJUSTMENT "Lighting (degrees)" '(45 0 360 1 10 1 0)
SF-TOGGLE "Shadow" TRUE
SF-COLOR "Background Color" '(255 255 255)
SF-COLOR "Sphere Color" '(255 0 0)
SF-BRUSH "Brush" '("Circle (03)" 1.0 44 0)
SF-STRING "Text" "Script-Fu rocks!"
SF-PATTERN "Pattern" "Maple Leaves"
SF-GRADIENT "Gradient" "Deep Sea"
SF-FONT "Font" "Agate"
SF-TOGGLE "Shadow" TRUE
SF-COLOR "Background Color" '(255 255 255)
SF-COLOR "Sphere Color" '(255 0 0)
SF-BRUSH "Brush" '("Circle (03)" 1.0 44 0)
SF-STRING "Text" "Script-Fu rocks!"
SF-PATTERN "Pattern" "Maple Leaves"
SF-GRADIENT "Gradient" "Deep Sea"
SF-TOGGLE "Gradient Reverse" FALSE
SF-FONT "Font" "Agate"
SF-ADJUSTMENT "Font Size (pixels)" '(50 1 1000 1 10 0 1)
SF-FILENAME "Environment Map" (string-append "" gimp-data-dir "/scripts/beavis.jpg")
SF-OPTION "Orientation" '("Horizontal" "Vertical")
SF-DIRNAME "Output Directory" "/var/tmp/")
SF-FILENAME "Environment Map" (string-append "" gimp-data-dir "/scripts/beavis.jpg")
SF-OPTION "Orientation" '("Horizontal" "Vertical")
SF-DIRNAME "Output Directory" "/var/tmp/")

View File

@ -21,15 +21,22 @@
(ts-size (- b-size-2 3))
(width (car (gimp-drawable-width logo-layer)))
(height (car (gimp-drawable-height logo-layer)))
(blend-layer (car (gimp-layer-new img width height RGBA_IMAGE "Blend" 100 NORMAL)))
(shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 NORMAL)))
(text-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Text Shadow" 100 MULTIPLY)))
(tsl-layer-mask (car (gimp-layer-create-mask text-shadow-layer BLACK-MASK)))
(drop-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Drop Shadow" 100 MULTIPLY)))
(dsl-layer-mask (car (gimp-layer-create-mask drop-shadow-layer BLACK-MASK)))
(blend-layer (car (gimp-layer-new img width height RGBA_IMAGE
"Blend" 100 NORMAL)))
(shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE
"Shadow" 100 NORMAL)))
(text-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE
"Text Shadow" 100 MULTIPLY)))
(tsl-layer-mask (car (gimp-layer-create-mask text-shadow-layer
BLACK-MASK)))
(drop-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE
"Drop Shadow" 100 MULTIPLY)))
(dsl-layer-mask (car (gimp-layer-create-mask drop-shadow-layer
BLACK-MASK)))
(old-fg (car (gimp-palette-get-foreground)))
(old-bg (car (gimp-palette-get-background)))
(old-pattern (car (gimp-patterns-get-pattern))))
(old-pattern (car (gimp-patterns-get-pattern))))
(script-fu-util-image-resize-from-layer img logo-layer)
(gimp-image-add-layer img shadow-layer 1)
(gimp-image-add-layer img blend-layer 1)
@ -44,7 +51,8 @@
(gimp-edit-clear drop-shadow-layer)
(gimp-palette-set-background bg-color)
(gimp-drawable-fill shadow-layer BG-IMAGE-FILL)
(gimp-rect-select img b-size-2 b-size-2 (- width b-size) (- height b-size) REPLACE TRUE b-size-2)
(gimp-rect-select img b-size-2 b-size-2 (- width b-size) (- height b-size)
REPLACE TRUE b-size-2)
(gimp-palette-set-background '(0 0 0))
(gimp-edit-fill shadow-layer BG-IMAGE-FILL)
(gimp-selection-layer-alpha logo-layer)
@ -57,12 +65,24 @@
(gimp-palette-set-background '(0 0 0))
(gimp-edit-fill text-shadow-layer BG-IMAGE-FILL)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend text-shadow-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 1 1)
(gimp-blend text-shadow-layer FG-BG-RGB NORMAL
SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-selection-none img)
(gimp-palette-set-foreground blend-fg)
(gimp-palette-set-background blend-bg)
(gimp-blend blend-layer FG-BG-RGB NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 TRUE 0 0 width 0)
(plug-in-mosaic 1 img blend-layer 12 1 1 0.7 TRUE 135 0.2 TRUE FALSE tile-type 1 0)
(gimp-blend blend-layer FG-BG-RGB NORMAL
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width 0)
(plug-in-mosaic 1 img blend-layer 12 1 1 0.7 TRUE 135 0.2 TRUE FALSE
tile-type 1 0)
(gimp-layer-translate logo-layer (- b-size-2) (- b-size-2))
(gimp-layer-translate blend-layer (- b-size) (- b-size))
(gimp-layer-translate text-shadow-layer (- ts-size) (- ts-size))
@ -99,15 +119,16 @@
"Spencer Kimball"
"1996"
"RGBA"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Border Size (pixels)" '(20 1 100 1 10 0 1)
SF-PATTERN _"Pattern" "Fibers"
SF-OPTION _"Mosaic Tile Type" '(_"Squares" _"Hexagons" _"Octagons")
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Starting Blend" '(32 106 0)
SF-COLOR _"Ending Blend" '(0 0 106)
)
SF-PATTERN _"Pattern" "Fibers"
SF-OPTION _"Mosaic Tile Type" '(_"Squares"
_"Hexagons"
_"Octagons")
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Starting Blend" '(32 106 0)
SF-COLOR _"Ending Blend" '(0 0 106))
(define (script-fu-textured-logo text
size
@ -119,7 +140,8 @@
blend-bg)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(b-size (scale size 0.1))
(text-layer (car (gimp-text-fontname img -1 0 0 text b-size TRUE size PIXELS fontname))))
(text-layer (car (gimp-text-fontname img -1 0 0 text b-size
TRUE size PIXELS fontname))))
(gimp-image-undo-disable img)
(gimp-layer-set-name text-layer text)
(apply-textured-logo-effect img text-layer b-size text-pattern tile-type
@ -134,12 +156,13 @@
"Spencer Kimball"
"1996"
""
SF-STRING _"Text" "The GIMP"
SF-STRING _"Text" "The GIMP"
SF-ADJUSTMENT _"Font Size (pixels)" '(200 1 1000 1 10 0 1)
SF-FONT _"Font" "CuneiFont"
SF-PATTERN _"Text Pattern" "Fibers"
SF-OPTION _"Mosaic Tile Type" '(_"Squares" _"Hexagons" _"Octagons")
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Starting Blend" '(32 106 0)
SF-COLOR _"Ending Blend" '(0 0 106)
)
SF-FONT _"Font" "CuneiFont"
SF-PATTERN _"Text Pattern" "Fibers"
SF-OPTION _"Mosaic Tile Type" '(_"Squares"
_"Hexagons"
_"Octagons")
SF-COLOR _"Background Color" '(255 255 255)
SF-COLOR _"Starting Blend" '(32 106 0)
SF-COLOR _"Ending Blend" '(0 0 106))

View File

@ -30,28 +30,24 @@
(define (script-fu-title-header text
size
; foundry
; family
; weight
; slant
; set-width
fontname)
fontname
gradient-reverse)
(let* (; Parameters
(padding 8)
(fade-width 64)
; Save foreground and background colors
(old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
; Image
(img (car (gimp-image-new 256 256 RGB)))
; Text layer
(text-layer (car (gimp-text-fontname
img
-1
@ -75,7 +71,8 @@
; Additional layers
(bg-layer (car (gimp-layer-new img img-width img-height RGBA_IMAGE "bg-layer" 100 NORMAL)))
(bg-layer (car (gimp-layer-new img img-width img-height RGBA_IMAGE
"bg-layer" 100 NORMAL)))
(bumpmap-layer (car (gimp-layer-new img
text-width
text-height
@ -83,13 +80,14 @@
"bumpmap-layer"
100
NORMAL)))
(fore-layer (car (gimp-layer-new img text-width text-height RGBA_IMAGE "fore-layer" 100 NORMAL))))
(fore-layer (car (gimp-layer-new img text-width text-height RGBA_IMAGE
"fore-layer" 100 NORMAL))))
; Create image
(gimp-image-undo-disable img)
(gimp-image-resize img img-width img-height 0 0)
(gimp-image-add-layer img bg-layer -1)
(gimp-image-add-layer img bumpmap-layer -1)
(gimp-image-add-layer img fore-layer -1)
@ -122,41 +120,36 @@
(gimp-layer-set-visible text-layer TRUE)
(gimp-layer-set-preserve-trans text-layer TRUE)
(gimp-blend text-layer CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0.2 3 TRUE
padding
padding
(- text-width padding 1)
(- text-height padding 1))
(gimp-blend text-layer CUSTOM NORMAL
LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0.2 3 TRUE
padding padding
(- text-width padding 1) (- text-height padding 1))
; Semicircle at the left
(gimp-palette-set-background '(0 0 0))
(gimp-edit-fill bg-layer BG-IMAGE-FILL)
(gimp-ellipse-select img 0 0 text-height text-height REPLACE TRUE FALSE 0)
(gimp-palette-set-background (car (gimp-color-picker img text-layer text-layers-offset 0 TRUE FALSE 0)))
(gimp-palette-set-background (car (gimp-color-picker img text-layer
text-layers-offset 0
TRUE FALSE 0)))
(gimp-edit-fill bg-layer BG-IMAGE-FILL)
; Fade-out gradient at the right
(gimp-rect-select img (- img-width fade-width) 0 fade-width text-height REPLACE FALSE 0)
(gimp-rect-select img (- img-width fade-width) 0 fade-width text-height
REPLACE FALSE 0)
(gimp-palette-set-foreground (car (gimp-palette-get-background)))
(gimp-palette-set-background '(0 0 0))
(gimp-blend bg-layer
FG-BG-RGB
NORMAL
LINEAR
100
0
REPEAT-NONE
FALSE
0.2
3
TRUE
(- img-width fade-width)
0
(- img-width 1)
0)
(gimp-blend bg-layer FG-BG-RGB NORMAL
LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0.2 3 TRUE
(- img-width fade-width) 0 (- img-width 1) 0)
(gimp-selection-none img)
; Done
@ -174,11 +167,7 @@
"Federico Mena Quintero"
"June 1997"
""
SF-STRING _"Text" "Hello world!"
SF-STRING _"Text" "Hello world!"
SF-ADJUSTMENT _"Font Size (pixels)" '(32 2 256 1 10 0 0)
SF-FONT _"Font" "Sans")
SF-FONT _"Font" "Sans"
SF-TOGGLE _"Gradient Reverse" FALSE)

View File

@ -22,7 +22,14 @@
; Copies the specified rectangle from/to the specified drawable
(define (copy-rectangle img drawable x1 y1 width height dest-x dest-y)
(define (copy-rectangle img
drawable
x1
y1
width
height
dest-x
dest-y)
(gimp-rect-select img x1 y1 width height REPLACE FALSE 0)
(gimp-edit-copy drawable)
(let ((floating-sel (car (gimp-edit-paste drawable FALSE))))
@ -32,11 +39,15 @@
; Creates a single weaving tile
(define (create-weave-tile ribbon-width ribbon-spacing shadow-darkness shadow-depth)
(define (create-weave-tile ribbon-width
ribbon-spacing
shadow-darkness
shadow-depth)
(let* ((tile-size (+ (* 2 ribbon-width) (* 2 ribbon-spacing)))
(darkness (* 255 (/ (- 100 shadow-darkness) 100)))
(img (car (gimp-image-new tile-size tile-size RGB)))
(drawable (car (gimp-layer-new img tile-size tile-size RGB_IMAGE "Weave tile" 100 NORMAL))))
(drawable (car (gimp-layer-new img tile-size tile-size RGB_IMAGE
"Weave tile" 100 NORMAL))))
(gimp-image-undo-disable img)
(gimp-image-add-layer img drawable 0)
@ -56,21 +67,11 @@
REPLACE
FALSE
0)
(gimp-blend drawable
FG-BG-RGB
NORMAL
BILINEAR
100
(- 100 shadow-depth)
REPEAT-NONE
FALSE
0
0
TRUE
(/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2)
0
0
0)
(gimp-blend drawable FG-BG-RGB NORMAL
BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
FALSE 0 0 TRUE
(/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0 0)
; Create main vertical ribbon
@ -82,21 +83,11 @@
REPLACE
FALSE
0)
(gimp-blend drawable
FG-BG-RGB
NORMAL
BILINEAR
100
(- 100 shadow-depth)
REPEAT-NONE
FALSE
0
0
TRUE
0
(/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2)
0
0)
(gimp-blend drawable FG-BG-RGB NORMAL
BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0)
; Create the secondary horizontal ribbon
@ -146,8 +137,14 @@
; Creates a complete weaving mask
(define (create-weave width height ribbon-width ribbon-spacing shadow-darkness shadow-depth)
(let* ((tile (create-weave-tile ribbon-width ribbon-spacing shadow-darkness shadow-depth))
(define (create-weave width
height
ribbon-width
ribbon-spacing
shadow-darkness
shadow-depth)
(let* ((tile (create-weave-tile ribbon-width ribbon-spacing shadow-darkness
shadow-depth))
(tile-img (car tile))
(tile-layer (cadr tile))
(weaving (plug-in-tile 1 tile-img tile-layer width height TRUE)))
@ -156,13 +153,24 @@
; Creates a single tile for masking
(define (create-mask-tile ribbon-width ribbon-spacing
r1-x1 r1-y1 r1-width r1-height
r2-x1 r2-y1 r2-width r2-height
r3-x1 r3-y1 r3-width r3-height)
(define (create-mask-tile ribbon-width
ribbon-spacing
r1-x1
r1-y1
r1-width
r1-height
r2-x1
r2-y1
r2-width
r2-height
r3-x1
r3-y1
r3-width
r3-height)
(let* ((tile-size (+ (* 2 ribbon-width) (* 2 ribbon-spacing)))
(img (car (gimp-image-new tile-size tile-size RGB)))
(drawable (car (gimp-layer-new img tile-size tile-size RGB_IMAGE "Mask" 100 NORMAL))))
(drawable (car (gimp-layer-new img tile-size tile-size RGB_IMAGE
"Mask" 100 NORMAL))))
(gimp-image-undo-disable img)
(gimp-image-add-layer img drawable 0)
@ -183,24 +191,39 @@
; Creates a complete mask image
(define (create-mask final-width final-height
ribbon-width ribbon-spacing
r1-x1 r1-y1 r1-width r1-height
r2-x1 r2-y1 r2-width r2-height
r3-x1 r3-y1 r3-width r3-height)
(define (create-mask final-width
final-height
ribbon-width
ribbon-spacing
r1-x1
r1-y1
r1-width
r1-height
r2-x1
r2-y1
r2-width
r2-height
r3-x1
r3-y1
r3-width
r3-height)
(let* ((tile (create-mask-tile ribbon-width ribbon-spacing
r1-x1 r1-y1 r1-width r1-height
r2-x1 r2-y1 r2-width r2-height
r3-x1 r3-y1 r3-width r3-height))
(tile-img (car tile))
(tile-layer (cadr tile))
(mask (plug-in-tile 1 tile-img tile-layer final-width final-height TRUE)))
(mask (plug-in-tile 1 tile-img tile-layer final-width final-height
TRUE)))
(gimp-image-delete tile-img)
mask))
; Creates the mask for horizontal ribbons
(define (create-horizontal-mask ribbon-width ribbon-spacing final-width final-height)
(define (create-horizontal-mask ribbon-width
ribbon-spacing
final-width
final-height)
(create-mask final-width
final-height
ribbon-width
@ -220,7 +243,10 @@
; Creates the mask for vertical ribbons
(define (create-vertical-mask ribbon-width ribbon-spacing final-width final-height)
(define (create-vertical-mask ribbon-width
ribbon-spacing
final-width
final-height)
(create-mask final-width
final-height
ribbon-width
@ -240,8 +266,14 @@
; Adds a threads layer at a certain orientation to the specified image
(define (create-threads-layer img width height length density orientation)
(let* ((drawable (car (gimp-layer-new img width height RGBA_IMAGE "Threads" 100 NORMAL)))
(define (create-threads-layer img
width
height
length
density
orientation)
(let* ((drawable (car (gimp-layer-new img width height RGBA_IMAGE
"Threads" 100 NORMAL)))
(dense (/ density 100.0)))
(gimp-image-add-layer img drawable -1)
(gimp-palette-set-background '(255 255 255))
@ -264,17 +296,21 @@
thread-length
thread-density
thread-intensity)
(let* ((weave (create-weave width height ribbon-width ribbon-spacing shadow-darkness shadow-depth))
(let* ((weave (create-weave width height ribbon-width ribbon-spacing
shadow-darkness shadow-depth))
(w-img (car weave))
(w-layer (cadr weave))
(h-layer (create-threads-layer w-img width height thread-length thread-density 'horizontal))
(h-layer (create-threads-layer w-img width height thread-length
thread-density 'horizontal))
(h-mask (car (gimp-layer-create-mask h-layer WHITE-MASK)))
(v-layer (create-threads-layer w-img width height thread-length thread-density 'vertical))
(v-layer (create-threads-layer w-img width height thread-length
thread-density 'vertical))
(v-mask (car (gimp-layer-create-mask v-layer WHITE-MASK)))
(hmask (create-horizontal-mask ribbon-width ribbon-spacing width height))
(hmask (create-horizontal-mask ribbon-width ribbon-spacing
width height))
(hm-img (car hmask))
(hm-layer (cadr hmask))
@ -349,8 +385,6 @@
(gimp-palette-set-background old-bg-color)
(gimp-displays-flush)))
; Register!
(script-fu-register "script-fu-weave"
_"<Image>/Script-Fu/Alchemy/Weave..."
"Weave effect like Alien Skin"
@ -358,8 +392,8 @@
"Federico Mena Quintero"
"June 1997"
"RGB* GRAY*"
SF-IMAGE "Image to Weave" 0
SF-DRAWABLE "Drawable to Weave" 0
SF-IMAGE "Image to Weave" 0
SF-DRAWABLE "Drawable to Weave" 0
SF-ADJUSTMENT _"Ribbon Width" '(30 0 256 1 10 1 1)
SF-ADJUSTMENT _"Ribbon Spacing" '(10 0 256 1 10 1 1)
SF-ADJUSTMENT _"Shadow Darkness" '(75 0 100 1 10 1 1)

View File

@ -315,11 +315,6 @@ init_constants (void)
setvar (cintern ("HARD"), flocons (GIMP_BRUSH_HARD), NIL);
setvar (cintern ("SOFT"), flocons (GIMP_BRUSH_SOFT), NIL);
setvar (cintern ("ONCE-FORWARD"), flocons (GIMP_GRADIENT_ONCE_FORWARD), NIL);
setvar (cintern ("ONCE-BACKWARDS"), flocons (GIMP_GRADIENT_ONCE_BACKWARD), NIL);
setvar (cintern ("LOOP-SAWTOOTH"), flocons (GIMP_GRADIENT_LOOP_SAWTOOTH), NIL);
setvar (cintern ("LOOP-TRIANGLE"), flocons (GIMP_GRADIENT_LOOP_TRIANGLE), NIL);
setvar (cintern ("CONTINUOUS"), flocons (GIMP_PAINT_CONSTANT), NIL);
setvar (cintern ("INCREMENTAL"), flocons (GIMP_PAINT_INCREMENTAL), NIL);

View File

@ -378,18 +378,6 @@ package Gimp::CodeGen::enums;
mapping => { GIMP_DODGE => '0',
GIMP_BURN => '1' }
},
GimpGradientPaintMode =>
{ contig => 1,
header => 'paint/paint-enums.h',
symbols => [ qw(GIMP_GRADIENT_ONCE_FORWARD
GIMP_GRADIENT_ONCE_BACKWARD
GIMP_GRADIENT_LOOP_SAWTOOTH
GIMP_GRADIENT_LOOP_TRIANGLE) ],
mapping => { GIMP_GRADIENT_ONCE_FORWARD => '0',
GIMP_GRADIENT_ONCE_BACKWARD => '1',
GIMP_GRADIENT_LOOP_SAWTOOTH => '2',
GIMP_GRADIENT_LOOP_TRIANGLE => '3' }
},
GimpConvolveType =>
{ contig => 1,
header => 'paint/paint-enums.h',

View File

@ -188,7 +188,7 @@ HELP
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, &color);
gimp_gradient_get_color_at (gradient, pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;
@ -240,7 +240,7 @@ HELP
while (i--)
{
gimp_gradient_get_color_at (gradient, *pos, &color);
gimp_gradient_get_color_at (gradient, *pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;
@ -303,12 +303,14 @@ HELP
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
name);
if (gradient)
success = TRUE;
}
else
success = (gradient = gimp_context_get_gradient (gimp_get_current_context (gimp))) != NULL;
{
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));;
}
if (gradient)
success = TRUE;
if (success)
{
@ -325,7 +327,7 @@ HELP
while (i--)
{
gimp_gradient_get_color_at (gradient, pos, &color);
gimp_gradient_get_color_at (gradient, pos, FALSE, &color);
*pv++ = color.r;
*pv++ = color.g;

View File

@ -80,6 +80,8 @@ HELP
(%%desc%%)' },
{ name => 'repeat', type => 'enum GimpRepeatMode',
desc => 'Repeat mode: { %%desc%% }' },
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' },
{ name => 'supersample', type => 'boolean',
desc => 'Do adaptive supersampling (%%desc%%)' },
{ name => 'max_depth', type => '1 <= int32 <= 9',
@ -115,7 +117,7 @@ HELP
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat,
offset, repeat, reverse,
supersample, max_depth,
threshold, dither,
x1, y1, x2, y2,

View File

@ -468,7 +468,9 @@ HELP
g_object_set (options,
"application-mode", method,
"use-fade", fade_out > 0.0,
"fade-length", fade_out,
"use-gradient", gradient_length > 0.0,
"gradient-length", gradient_length,
NULL);