Permalink
Browse files

add the Simple Border plug-in.

  • Loading branch information...
hejiann committed Aug 11, 2012
1 parent 83aad05 commit 2ca2f02bc5831ebac31fed02d2d25995c67c0f32
View
@@ -25,41 +25,47 @@ CFLAGS = $(GIMP_CFLAGS)
GDK_PIXBUF_CSOURCE = gdk-pixbuf-csource
-all: beautify skin-whitening border
+all: beautify skin-whitening simple-border border
-install: beautify skin-whitening border
+install: beautify skin-whitening simple-border border
# need fix: --install-admin-bin has issue in x86_64,
# it install the plug-in into /usr/lib/gimp/2.0/plug-ins/
# but the correct directory is /usr/lib64/gimp/2.0/plug-ins/
$(GIMPTOOL) --install-admin-bin beautify
$(GIMPTOOL) --install-admin-bin skin-whitening
+ $(GIMPTOOL) --install-admin-bin simple-border
$(GIMPTOOL) --install-admin-bin border
ln -sf /usr/lib/gimp/2.0/plug-ins/beautify /usr/lib64/gimp/2.0/plug-ins/beautify
ln -sf /usr/lib/gimp/2.0/plug-ins/skin-whitening /usr/lib64/gimp/2.0/plug-ins/skin-whitening
+ ln -sf /usr/lib/gimp/2.0/plug-ins/simple-border /usr/lib64/gimp/2.0/plug-ins/simple-border
ln -sf /usr/lib/gimp/2.0/plug-ins/border /usr/lib64/gimp/2.0/plug-ins/border
uninstall:
$(GIMPTOOL) --uninstall-admin-bin beautify
$(GIMPTOOL) --uninstall-admin-bin skin-whitening
+ $(GIMPTOOL) --uninstall-admin-bin simple-border
$(GIMPTOOL) --uninstall-admin-bin border
$(GIMPTOOL) --uninstall-admin-bin rip-border
$(GIMPTOOL) --uninstall-admin-bin texture-border
rm -f /usr/lib64/gimp/2.0/plug-ins/beautify
rm -f /usr/lib64/gimp/2.0/plug-ins/skin-whitening
rm -f /usr/lib64/gimp/2.0/plug-ins/border
+ rm -f /usr/lib64/gimp/2.0/plug-ins/simple-border
rm -f /usr/lib64/gimp/2.0/plug-ins/rip-border
rm -f /usr/lib64/gimp/2.0/plug-ins/texture-border
-userinstall: beautify skin-whitening border
+userinstall: beautify skin-whitening simple-border border
$(GIMPTOOL) --install-bin beautify
$(GIMPTOOL) --install-bin skin-whitening
$(GIMPTOOL) --uninstall-bin rip-border
$(GIMPTOOL) --uninstall-bin texture-border
+ $(GIMPTOOL) --install-bin simple-border
$(GIMPTOOL) --install-bin border
useruninstall:
$(GIMPTOOL) --uninstall-bin beautify
$(GIMPTOOL) --uninstall-bin skin-whitening
+ $(GIMPTOOL) --uninstall-bin simple-border
$(GIMPTOOL) --uninstall-bin border
$(GIMPTOOL) --uninstall-bin rip-border
$(GIMPTOOL) --uninstall-bin texture-border
@@ -88,6 +94,12 @@ skin-whitening-images.h: skin-whitening-images.list
skin-whitening-effect.o: skin-whitening-effect.c skin-whitening-effect.h
$(CC) $(CFLAGS) -c skin-whitening-effect.c -o skin-whitening-effect.o
+simple-border: simple-border.o
+ $(CC) -o $@ $^ $(LIBS)
+
+simple-border.o: simple-border.c border-textures.h
+ $(CC) $(CFLAGS) -c simple-border.c -o simple-border.o
+
border: border.o
$(CC) -o $@ $^ $(LIBS)
@@ -98,5 +110,5 @@ border-textures.h: border-textures.list
$(GDK_PIXBUF_CSOURCE) --raw --build-list `cat border-textures.list` > $(@F)
clean:
- rm -f *.o beautify beautify-textures.h skin-whitening skin-whitening-images.h border border-textures.h rip-border rip-border-textures.h texture-border texture-border-textures.h
+ rm -f *.o beautify beautify-textures.h skin-whitening skin-whitening-images.h simple-border border border-textures.h rip-border rip-border-textures.h texture-border texture-border-textures.h
View
3 README
@@ -47,6 +47,9 @@ GIMP Chat: http://www.gimpchat.com/viewtopic.php?f=9&t=4811
CHANGELOG
===================
+2012-08-11
+add the Simple Border plug-in.
+
2012-08-06
beautify: fix contrast adjustment tool.
beautify: add Definition adjustment tool.
View
@@ -66,43 +66,6 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
{
case BEAUTIFY_EFFECT_SOFT_LIGHT:
{
- /*guint8 red_pts[] = {
- 0.000000 * 255, 0.018301 * 255,
- 0.121569 * 255, 0.140340 * 255,
- 0.247059 * 255, 0.293839 * 255,
- 0.372549 * 255, 0.436997 * 255,
- 0.498039 * 255, 0.572834 * 255,
- 0.623529 * 255, 0.704905 * 255,
- 0.749020 * 255, 0.822627 * 255,
- 0.874510 * 255, 0.918599 * 255,
- 1.000000 * 255, 1.000000 * 255,
- };
- guint8 green_pts[] = {
- 0.000000 * 255, 0.039216 * 255,
- 0.121569 * 255, 0.137287 * 255,
- 0.247059 * 255, 0.287181 * 255,
- 0.372549 * 255, 0.432968 * 255,
- 0.498039 * 255, 0.572484 * 255,
- 0.623529 * 255, 0.698476 * 255,
- 0.749020 * 255, 0.825490 * 255,
- 0.874510 * 255, 0.920394 * 255,
- 1.000000 * 255, 1.000000 * 255,
- };
- guint8 blue_pts[] = {
- 0.000000 * 255, 0.005744 * 255,
- 0.121569 * 255, 0.135120 * 255,
- 0.247059 * 255, 0.287459 * 255,
- 0.372549 * 255, 0.429606 * 255,
- 0.498039 * 255, 0.575840 * 255,
- 0.623529 * 255, 0.697813 * 255,
- 0.749020 * 255, 0.823317 * 255,
- 0.874510 * 255, 0.918301 * 255,
- 1.000000 * 255, 1.000000 * 255,
- };
- gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_RED, 18, red_pts);
- gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_GREEN, 18, green_pts);
- gimp_curves_spline (effect_layer, GIMP_HISTOGRAM_BLUE, 18, blue_pts);*/
-
gint32 layer;
layer = gimp_layer_copy (effect_layer);
@@ -1021,6 +984,68 @@ run_effect (gint32 image_ID, BeautifyEffectType effect)
gimp_image_delete (image);
+ /*GimpPixelRgn src_rgn, dest_rgn;
+ gint x1, y1;
+ gint width, height;
+ gpointer pr;
+
+ GimpDrawable *drawable = gimp_drawable_get (effect_layer);
+ if (!gimp_drawable_mask_intersect (drawable->drawable_id,
+ &x1, &y1, &width, &height))
+ return;
+
+ gimp_pixel_rgn_init (&src_rgn, drawable, x1, y1, width, height, FALSE, FALSE);
+ gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, width, height, TRUE, TRUE);
+ for (pr = gimp_pixel_rgns_register (2, &src_rgn, &dest_rgn);
+ pr != NULL;
+ pr = gimp_pixel_rgns_process (pr))
+ {
+ const guchar *src = src_rgn.data;
+ guchar *dest = dest_rgn.data;
+ gint x, y;
+
+ for (y = 0; y < src_rgn.h; y++)
+ {
+ const guchar *s = src;
+ guchar *d = dest;
+
+ for (x = 0; x < src_rgn.w; x++)
+ {
+ gdouble r, g, b;
+ gdouble v;
+
+ r = (gdouble) s[0] / 255;
+ g = (gdouble) s[1] / 255;
+ b = (gdouble) s[2] / 255;
+
+ v = b - 154.0 / 255;
+ v = MAX (0, v);
+ v = r + v - g * 172.0 / 255;
+ v = MIN (1, MAX (0, v));
+ v = sin(v * G_PI_2);
+ d[0] = v * 255;
+
+ v = g + (27.0 - r * 27) / 255;
+ v = MIN (1, v);
+ d[1] = v * 255;
+
+ v = g + (0.4 + b * 0.2 - sin(r));
+ v = MIN (1, MAX (0, v));
+ d[2] = v * 255;
+
+ s += src_rgn.bpp;
+ d += dest_rgn.bpp;
+ }
+
+ src += src_rgn.rowstride;
+ dest += dest_rgn.rowstride;
+ }
+ }
+
+ gimp_drawable_flush (drawable);
+ gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
+ gimp_drawable_update (drawable->drawable_id, x1, y1, width, height);*/
+
break;
}
case BEAUTIFY_EFFECT_ICE_SPIRIT:
View
@@ -1,3 +1,8 @@
+texture_15356
+ ./textures/simple-border/15356.png
+texture_15327
+ ./textures/simple-border/15327.png
+
texture_14911
./textures/rip-border/others/14911.jpg
texture_12847
View
@@ -20,13 +20,13 @@
#include "border-textures.h"
-#define RIP_BORDER_PROC "plug-in-rip-border"
-#define TEXTURE_BORDER_PROC "plug-in-texture-border"
+#define RIP_BORDER_PROC "plug-in-rip-border"
+#define TEXTURE_BORDER_PROC "plug-in-texture-border"
#define PLUG_IN_BINARY "border"
#define PLUG_IN_ROLE "gimp-border"
-#define RIP_BORDER_TEXTURE_PATH "rip-border"
-#define TEXTURE_BORDER_TEXTURE_PATH "texture-border"
+#define RIP_BORDER_TEXTURE_PATH "rip-border"
+#define TEXTURE_BORDER_TEXTURE_PATH "texture-border"
#define PREVIEW_SIZE 480
#define THUMBNAIL_SIZE 80
@@ -63,8 +63,8 @@ static inline gboolean
is_hidden (const gchar *filename)
{
/* skip files starting with '.' so we don't try to parse
-* stuff like .DS_Store or other metadata storage files
-*/
+ * stuff like .DS_Store or other metadata storage files
+ */
return (filename[0] == '.');
}
@@ -352,7 +352,6 @@ border_dialog (const gchar *title, const gchar *help_id, const guint8** textures
GtkWidget *right_vbox;
GtkWidget *label;
- GtkWidget *frame;
gboolean run;
gimp_ui_init (PLUG_IN_BINARY, FALSE);
Oops, something went wrong.

0 comments on commit 2ca2f02

Please sign in to comment.