From db140e205616f4748857cc96d286c6724873431b Mon Sep 17 00:00:00 2001 From: "Adam D. Moss" Date: Tue, 30 Mar 1999 18:56:44 +0000 Subject: [PATCH] remove crusty old snp plugin --- configure.in | 1 - plug-ins/Makefile.am | 1 - plug-ins/snp/.cvsignore | 6 - plug-ins/snp/Makefile.am | 35 ----- plug-ins/snp/snp.c | 269 --------------------------------------- 5 files changed, 312 deletions(-) delete mode 100644 plug-ins/snp/.cvsignore delete mode 100644 plug-ins/snp/Makefile.am delete mode 100644 plug-ins/snp/snp.c diff --git a/configure.in b/configure.in index ac7f9087b1..2953108e0f 100644 --- a/configure.in +++ b/configure.in @@ -795,7 +795,6 @@ plug-ins/shift/Makefile plug-ins/sinus/Makefile plug-ins/smooth_palette/Makefile plug-ins/snoise/Makefile -plug-ins/snp/Makefile plug-ins/sobel/Makefile plug-ins/sparkle/Makefile plug-ins/spread/Makefile diff --git a/plug-ins/Makefile.am b/plug-ins/Makefile.am index 69c199963e..e4e6deb730 100644 --- a/plug-ins/Makefile.am +++ b/plug-ins/Makefile.am @@ -123,7 +123,6 @@ SUBDIRS = \ sinus \ smooth_palette \ snoise \ - snp \ sobel \ sparkle \ spread \ diff --git a/plug-ins/snp/.cvsignore b/plug-ins/snp/.cvsignore deleted file mode 100644 index 8f346a0fcb..0000000000 --- a/plug-ins/snp/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile.in -Makefile -.deps -_libs -.libs -snp diff --git a/plug-ins/snp/Makefile.am b/plug-ins/snp/Makefile.am deleted file mode 100644 index 7bca9a0917..0000000000 --- a/plug-ins/snp/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## Process this file with automake to produce Makefile.in - -pluginlibdir = $(gimpplugindir)/plug-ins - -pluginlib_PROGRAMS = snp - -snp_SOURCES = \ - snp.c - -INCLUDES = \ - -I$(top_srcdir) \ - $(GTK_CFLAGS) \ - -I$(includedir) - -LDADD = \ - $(top_builddir)/libgimp/libgimp.la \ - $(GTK_LIBS) - -DEPS = \ - $(top_builddir)/libgimp/libgimp.la - -snp_DEPENDENCIES = $(DEPS) - -.PHONY: files - -files: - @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ - echo $$p; \ - done - @for subdir in $(SUBDIRS); do \ - files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \ - for file in $$files; do \ - echo $$subdir/$$file; \ - done; \ - done diff --git a/plug-ins/snp/snp.c b/plug-ins/snp/snp.c deleted file mode 100644 index 95c28e5178..0000000000 --- a/plug-ins/snp/snp.c +++ /dev/null @@ -1,269 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * Plugin to load MicroEyes SNP format animations - * v1.1 - Adam D. Moss, adam@foxbox.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * Changelog: - * - * 97/07/08 - * v1.1: SNP Animations only use 192 colour entries, so the resulting - * GIMP INDEXED image should reflect this. - * Added progress bar. - * - * 97/07/06 - * v1.0: Initial release. - */ - -#include -#include -#include -#include "libgimp/gimp.h" - - - -static void query (void); -static void run (char *name, - int nparams, - GParam *param, - int *nreturn_vals, - GParam **return_vals); -static gint32 load_image (char *filename); - - -GPlugInInfo PLUG_IN_INFO = -{ - NULL, /* init_proc */ - NULL, /* quit_proc */ - query, /* query_proc */ - run, /* run_proc */ -}; - - -MAIN () - -static void -query () -{ - static GParamDef load_args[] = - { - { PARAM_INT32, "run_mode", "Interactive, non-interactive" }, - { PARAM_STRING, "filename", "The name of the file to load" }, - { PARAM_STRING, "raw_filename", "The name entered" }, - }; - static GParamDef load_return_vals[] = - { - { PARAM_IMAGE, "image", "Output image" }, - }; - static int nload_args = sizeof (load_args) / sizeof (load_args[0]); - static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); - gimp_install_procedure ("file_snp_load", - "Loads animations of the MicroEyes SNP file format", - "FIXME: write help for snp_load", - "Adam D. Moss", - "Adam D. Moss", - "1997", - "/Snp", - NULL, - PROC_PLUG_IN, - nload_args, nload_return_vals, - load_args, load_return_vals); - gimp_register_load_handler ("file_snp_load", "snp", ""); -} - -static void -run (char *name, - int nparams, - GParam *param, - int *nreturn_vals, - GParam **return_vals) -{ - static GParam values[2]; - GRunModeType run_mode; - gint32 image_ID; - - run_mode = param[0].data.d_int32; - - *nreturn_vals = 1; - *return_vals = values; - - values[0].type = PARAM_STATUS; - values[0].data.d_status = STATUS_CALLING_ERROR; - - if (strcmp (name, "file_snp_load") == 0) - { - image_ID = load_image (param[1].data.d_string); - if (image_ID != -1) - { - *nreturn_vals = 2; - values[0].data.d_status = STATUS_SUCCESS; - values[1].type = PARAM_IMAGE; - values[1].data.d_image = image_ID; - } - else - { - values[0].data.d_status = STATUS_EXECUTION_ERROR; - } - } - else - g_assert (FALSE); -} - - -short unsigned int getword(FILE *fp) -{ - int c1,c2; - - c1 = fgetc(fp); - c2 = fgetc(fp); - - return(c1|(c2<<8)); -} - - -unsigned int getlongword(FILE *fp) -{ - int c1,c2,c3,c4; - - c1 = fgetc(fp); - c2 = fgetc(fp); - c3 = fgetc(fp); - c4 = fgetc(fp); - - return(c1|(c2<<8)|(c3<<16)|(c4<<24)); -} - - -static gint32 -load_image (char *filename) -{ - GPixelRgn pixel_rgn; - GDrawable *drawable; - gint32 image_ID; - gint32 layer_ID; - gchar *temp; - - guchar pal[768]; - gint i,j,k, frames, delay, wwidth, wheight; - FILE *fp; - guchar *data; - - gchar layername[200]; /* FIXME? */ - - - temp = g_malloc (strlen (filename) + 12); - if (!temp) gimp_quit (); - g_free (temp); - - - - gimp_progress_init ("Loading SNP file..."); - - - - fp = fopen(filename,"rb"); - - - k=getword(fp); - printf("ComputerEyes SNIP version %d\n",k); - - frames=getword(fp); - printf("%d frames, ",frames); - - wwidth=getword(fp); - wheight=getword(fp); - - data = g_malloc(wwidth * wheight * 2); - - - printf("%dx%d\n",wwidth,wheight); - - getword(fp); /* reserved */ - delay = getword(fp); - getword(fp); /* reserved */ - getword(fp); /* reserved */ - - - - - image_ID = gimp_image_new (wwidth, wheight, INDEXED); - gimp_image_set_filename (image_ID, filename); - - - - for (i=0;i<768;i++) - { - pal[i] = (fgetc(fp)*255L) / 63L; - } - - gimp_image_set_cmap (image_ID, - &pal[64*3], - 256-64); - - - for (i=0;i0) && (j63) - { - data[j*2] = k-64; - data[j*2+1] = 255; - j++; - } - else - { - j+=k; - } - k=fgetc(fp); - } - - gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); - gimp_pixel_rgn_set_rect (&pixel_rgn, data, 0,0, wwidth,wheight); - - gimp_drawable_flush (drawable); - gimp_drawable_detach (drawable); - } - - gimp_progress_update (1.0); - - g_free (data); - - return image_ID; - -}