diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-02-27 20:28:13 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:15 +0100 |
commit | ff7c2952b7d10d3c337714695175c12528dd9b94 (patch) | |
tree | 0c7803fe2c065c12564077fac026c39364a3b5bf | |
parent | 6f12fbf4eb971e64d98449e2549f2c9b9f0fc6e1 (diff) |
Remove dead code
-rw-r--r-- | Makefile.am | 7 | ||||
-rw-r--r-- | Makefile.in | 61 | ||||
-rw-r--r-- | src/geomatic.c | 81 | ||||
-rw-r--r-- | src/render.c | 107 | ||||
-rw-r--r-- | src/render.h | 3 |
5 files changed, 15 insertions, 244 deletions
diff --git a/Makefile.am b/Makefile.am index 27914687..37c63756 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ noinst_PROGRAMS = tests/list_check TESTS = tests/list_check if HAVE_GTK -bin_PROGRAMS += src/hdfsee src/geomatic +bin_PROGRAMS += src/hdfsee endif if HAVE_CAIRO @@ -53,11 +53,6 @@ if HAVE_GTK src_hdfsee_SOURCES = src/hdfsee.c src/displaywindow.c src/render.c \ src/hdf5-file.c src/utils.c src/image.c src/filters.c \ src/thread-pool.c src/detector.c - -src_geomatic_SOURCES = src/geomatic.c src/dw-geomatic.c src/render.c \ - src/hdf5-file.c src/utils.c src/image.c src/filters.c \ - src/thread-pool.c src/cell.c src/reflist.c src/geometry.c \ - src/peaks.c src/detector.c endif src_get_hkl_SOURCES = src/get_hkl.c src/sfac.c src/cell.c src/utils.c \ diff --git a/Makefile.in b/Makefile.in index ba92b9e3..1c6d8480 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,7 +44,7 @@ bin_PROGRAMS = src/pattern_sim$(EXEEXT) src/process_hkl$(EXEEXT) \ src/sum_stack$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) noinst_PROGRAMS = tests/list_check$(EXEEXT) TESTS = tests/list_check$(EXEEXT) -@HAVE_GTK_TRUE@am__append_1 = src/hdfsee src/geomatic +@HAVE_GTK_TRUE@am__append_1 = src/hdfsee @HAVE_CAIRO_TRUE@am__append_2 = src/cubeit @HAVE_OPENCL_TRUE@am__append_3 = src/diffraction-gpu.c src/cl-utils.c @HAVE_OPENCL_TRUE@am__append_4 = src/diffraction-gpu.c src/cl-utils.c @@ -74,8 +74,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -@HAVE_GTK_TRUE@am__EXEEXT_1 = src/hdfsee$(EXEEXT) \ -@HAVE_GTK_TRUE@ src/geomatic$(EXEEXT) +@HAVE_GTK_TRUE@am__EXEEXT_1 = src/hdfsee$(EXEEXT) @HAVE_CAIRO_TRUE@am__EXEEXT_2 = src/cubeit$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(crystfeldir)" \ "$(DESTDIR)$(crystfeldocdir)" "$(DESTDIR)$(scriptdir)" @@ -123,20 +122,6 @@ src_estimate_background_OBJECTS = \ $(am_src_estimate_background_OBJECTS) src_estimate_background_LDADD = $(LDADD) src_estimate_background_DEPENDENCIES = $(top_builddir)/lib/libgnu.a -am__src_geomatic_SOURCES_DIST = src/geomatic.c src/dw-geomatic.c \ - src/render.c src/hdf5-file.c src/utils.c src/image.c \ - src/filters.c src/thread-pool.c src/cell.c src/reflist.c \ - src/geometry.c src/peaks.c src/detector.c -@HAVE_GTK_TRUE@am_src_geomatic_OBJECTS = src/geomatic.$(OBJEXT) \ -@HAVE_GTK_TRUE@ src/dw-geomatic.$(OBJEXT) src/render.$(OBJEXT) \ -@HAVE_GTK_TRUE@ src/hdf5-file.$(OBJEXT) src/utils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ src/image.$(OBJEXT) src/filters.$(OBJEXT) \ -@HAVE_GTK_TRUE@ src/thread-pool.$(OBJEXT) src/cell.$(OBJEXT) \ -@HAVE_GTK_TRUE@ src/reflist.$(OBJEXT) src/geometry.$(OBJEXT) \ -@HAVE_GTK_TRUE@ src/peaks.$(OBJEXT) src/detector.$(OBJEXT) -src_geomatic_OBJECTS = $(am_src_geomatic_OBJECTS) -src_geomatic_LDADD = $(LDADD) -src_geomatic_DEPENDENCIES = $(top_builddir)/lib/libgnu.a am_src_get_hkl_OBJECTS = src/get_hkl.$(OBJEXT) src/sfac.$(OBJEXT) \ src/cell.$(OBJEXT) src/utils.$(OBJEXT) \ src/reflections.$(OBJEXT) src/symmetry.$(OBJEXT) \ @@ -274,18 +259,16 @@ am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(src_calibrate_detector_SOURCES) $(src_check_hkl_SOURCES) \ $(src_compare_hkl_SOURCES) $(src_cubeit_SOURCES) \ - $(src_estimate_background_SOURCES) $(src_geomatic_SOURCES) \ - $(src_get_hkl_SOURCES) $(src_hdfsee_SOURCES) \ - $(src_indexamajig_SOURCES) $(src_partialator_SOURCES) \ - $(src_pattern_sim_SOURCES) $(src_powder_plot_SOURCES) \ - $(src_process_hkl_SOURCES) $(src_reintegrate_SOURCES) \ - $(src_render_hkl_SOURCES) $(src_sum_stack_SOURCES) \ - $(tests_list_check_SOURCES) + $(src_estimate_background_SOURCES) $(src_get_hkl_SOURCES) \ + $(src_hdfsee_SOURCES) $(src_indexamajig_SOURCES) \ + $(src_partialator_SOURCES) $(src_pattern_sim_SOURCES) \ + $(src_powder_plot_SOURCES) $(src_process_hkl_SOURCES) \ + $(src_reintegrate_SOURCES) $(src_render_hkl_SOURCES) \ + $(src_sum_stack_SOURCES) $(tests_list_check_SOURCES) DIST_SOURCES = $(src_calibrate_detector_SOURCES) \ $(src_check_hkl_SOURCES) $(src_compare_hkl_SOURCES) \ $(am__src_cubeit_SOURCES_DIST) \ - $(src_estimate_background_SOURCES) \ - $(am__src_geomatic_SOURCES_DIST) $(src_get_hkl_SOURCES) \ + $(src_estimate_background_SOURCES) $(src_get_hkl_SOURCES) \ $(am__src_hdfsee_SOURCES_DIST) \ $(am__src_indexamajig_SOURCES_DIST) $(src_partialator_SOURCES) \ $(am__src_pattern_sim_SOURCES_DIST) $(src_powder_plot_SOURCES) \ @@ -619,11 +602,6 @@ src_indexamajig_SOURCES = src/indexamajig.c src/hdf5-file.c \ @HAVE_GTK_TRUE@ src/hdf5-file.c src/utils.c src/image.c src/filters.c \ @HAVE_GTK_TRUE@ src/thread-pool.c src/detector.c -@HAVE_GTK_TRUE@src_geomatic_SOURCES = src/geomatic.c src/dw-geomatic.c src/render.c \ -@HAVE_GTK_TRUE@ src/hdf5-file.c src/utils.c src/image.c src/filters.c \ -@HAVE_GTK_TRUE@ src/thread-pool.c src/cell.c src/reflist.c src/geometry.c \ -@HAVE_GTK_TRUE@ src/peaks.c src/detector.c - src_get_hkl_SOURCES = src/get_hkl.c src/sfac.c src/cell.c src/utils.c \ src/reflections.c src/symmetry.c src/beam-parameters.c \ src/thread-pool.c @@ -855,18 +833,6 @@ src/estimate_background.$(OBJEXT): src/$(am__dirstamp) \ src/estimate_background$(EXEEXT): $(src_estimate_background_OBJECTS) $(src_estimate_background_DEPENDENCIES) src/$(am__dirstamp) @rm -f src/estimate_background$(EXEEXT) $(AM_V_CCLD)$(LINK) $(src_estimate_background_OBJECTS) $(src_estimate_background_LDADD) $(LIBS) -src/geomatic.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/dw-geomatic.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/reflist.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/geometry.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/peaks.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/geomatic$(EXEEXT): $(src_geomatic_OBJECTS) $(src_geomatic_DEPENDENCIES) src/$(am__dirstamp) - @rm -f src/geomatic$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(src_geomatic_OBJECTS) $(src_geomatic_LDADD) $(LIBS) src/get_hkl.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/beam-parameters.$(OBJEXT): src/$(am__dirstamp) \ @@ -883,6 +849,7 @@ src/hdfsee$(EXEEXT): $(src_hdfsee_OBJECTS) $(src_hdfsee_DEPENDENCIES) src/$(am__ $(AM_V_CCLD)$(LINK) $(src_hdfsee_OBJECTS) $(src_hdfsee_LDADD) $(LIBS) src/indexamajig.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) +src/peaks.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/index.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/diffraction.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) @@ -891,6 +858,10 @@ src/mosflm.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/templates.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) +src/geometry.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/reflist.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) src/diffraction-gpu.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/cl-utils.$(OBJEXT): src/$(am__dirstamp) \ @@ -965,10 +936,8 @@ mostlyclean-compile: -rm -f src/diffraction.$(OBJEXT) -rm -f src/dirax.$(OBJEXT) -rm -f src/displaywindow.$(OBJEXT) - -rm -f src/dw-geomatic.$(OBJEXT) -rm -f src/estimate_background.$(OBJEXT) -rm -f src/filters.$(OBJEXT) - -rm -f src/geomatic.$(OBJEXT) -rm -f src/geometry.$(OBJEXT) -rm -f src/get_hkl.$(OBJEXT) -rm -f src/hdf5-file.$(OBJEXT) @@ -1015,10 +984,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/diffraction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dirax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/displaywindow.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dw-geomatic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/estimate_background.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/filters.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/geomatic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/geometry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/get_hkl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/hdf5-file.Po@am__quote@ diff --git a/src/geomatic.c b/src/geomatic.c deleted file mode 100644 index 94975c25..00000000 --- a/src/geomatic.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * geomatic.c - * - * GUI geometry calibration - * - * (c) 2006-2011 Thomas White <taw@physics.org> - * - * Part of CrystFEL - crystallography with a FEL - * - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtk.h> -#include <getopt.h> - -#include "dw-geomatic.h" -#include "utils.h" -#include "render.h" - - -static void show_help(const char *s) -{ - printf("Syntax: %s [options] image.h5\n\n", s); - printf( -"GUI geometry calibration.\n" -"\n" -" -h, --help Display this help message.\n" -"\n"); -} - - -int main(int argc, char *argv[]) -{ - int c; - int nfiles; - - /* Long options */ - const struct option longopts[] = { - {"help", 0, NULL, 'h'}, - {0, 0, NULL, 0} - }; - - gtk_init(&argc, &argv); - - /* Short options */ - while ((c = getopt_long(argc, argv, "hp:b:i:c:", - longopts, NULL)) != -1) { - - switch (c) { - case 'h' : - show_help(argv[0]); - return 0; - - case 0 : - break; - - default : - return 1; - } - - } - - nfiles = argc-optind; - - if ( nfiles < 1 ) { - ERROR("You need to give me a file to open!\n"); - return -1; - } - - if ( geomatic_open(argv[optind]) == NULL ) { - ERROR("Couldn't open display window\n"); - return 1; - } - gtk_main(); - - return 0; -} diff --git a/src/render.c b/src/render.c index eeeda871..ba64b779 100644 --- a/src/render.c +++ b/src/render.c @@ -139,52 +139,6 @@ void render_scale(float val, float max, int scale, #ifdef HAVE_GTK -static float *get_binned_image(struct image *image, int binning, float *pmax) -{ - float *data; - int x, y; - int w, h; - int inw, inh; - float *in; - float max; - - inw = image->width; - inh = image->height; - in = image->data; - - w = inw / binning; - h = inh / binning; /* Some pixels might get discarded */ - - data = malloc(w*h*sizeof(float)); - max = 0.0; - - for ( x=0; x<w; x++ ) { - for ( y=0; y<h; y++ ) { - - double total; - size_t xb, yb; - - total = 0; - for ( xb=0; xb<binning; xb++ ) { - for ( yb=0; yb<binning; yb++ ) { - - total += in[binning*x+xb + (binning*y+yb)*inw]; - - } - } - - data[x+w*y] = total / ((double)binning * (double)binning); - if ( data[x+w*y] > max ) max = data[x+w*y]; - - } - } - - *pmax = max; - return data; - -} - - static float *get_binned_panel(struct image *image, int binning, int min_fs, int max_fs, int min_ss, int max_ss) { @@ -237,67 +191,6 @@ static void render_free_data(guchar *data, gpointer p) } -/* Return a pixbuf containing a rendered version of the image after binning. - * This pixbuf might be scaled later - hopefully mostly in a downward - * direction. */ -GdkPixbuf *render_get_image(struct image *image, int binning, int scale, - double boost) -{ - int w, h; - guchar *data; - float *hdr; - int x, y; - float max; - int mw, mh; - - mw = image->width; - mh = image->height; - w = mw / binning; - h = mh / binning; - - /* High dynamic range version */ - hdr = get_binned_image(image, binning, &max); - if ( hdr == NULL ) return NULL; - - /* Rendered (colourful) version */ - data = malloc(3*w*h); - if ( data == NULL ) { - free(hdr); - return NULL; - } - - max /= boost; - if ( max <= 6 ) { max = 10; } - /* These x,y coordinates are measured relative to the bottom-left - * corner */ - for ( y=0; y<h; y++ ) { - for ( x=0; x<w; x++ ) { - - float val; - float r, g, b; - - val = hdr[x+w*y]; - render_scale(val, max, scale, &r, &g, &b); - - /* Stuff inside square brackets makes this pixel go to - * the expected location in the pixbuf (which measures - * from the top-left corner */ - data[3*( x+w*(h-1-y) )+0] = 255*r; - data[3*( x+w*(h-1-y) )+1] = 255*g; - data[3*( x+w*(h-1-y) )+2] = 255*b; - - } - } - - /* Finished with this */ - free(hdr); - - /* Create the pixbuf from the 8-bit display data */ - return gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, FALSE, 8, - w, h, w*3, render_free_data, NULL); -} - - static GdkPixbuf *render_panel(struct image *image, int binning, int scale, double boost, int min_fs, int max_fs, int min_ss, int max_ss) diff --git a/src/render.h b/src/render.h index 79d7ec68..bdfb9bc4 100644 --- a/src/render.h +++ b/src/render.h @@ -37,9 +37,6 @@ extern void render_scale(float val, float max, int scale, #include <gdk-pixbuf/gdk-pixbuf.h> -extern GdkPixbuf *render_get_image(struct image *image, - int binning, int scale, double boost); - extern GdkPixbuf **render_panels(struct image *image, int binning, int scale, double boost, int *n_pixbufs); |