From 0792860a57d4185a22ea9e0e0646a9b14c27b444 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 17 Sep 2002 20:27:19 +0000 Subject: [PATCH] Add support for XV/GIMP thumbnail format (P7) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2626 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 7 +++---- configure.in | 6 +++--- fltk.spec | 6 +++--- src/Fl_PNM_Image.cxx | 16 ++++++++++++++-- src/fl_images_core.cxx | 6 +++--- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 49d62b50e..74a945c6a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,9 @@ CHANGES IN FLTK 1.1.0rc7 + - Fl_PNM_Image now supports the XV/GIMP thumbnail format + (P7). - Fl_Preferences would not find groups inside the root - group. - -CHANGES IN FLTK 1.1.0 - + group. - Small bug fixes for Fl_Chart, Fl_Scrollbar, Fl_Tabs, and FLUID from Matthew Morrise. - Fl_Chart didn't have its own destructor, so data in diff --git a/configure.in b/configure.in index 43913a19e..82f07cd58 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl -*- sh -*- dnl the "configure" script is made from this by running GNU "autoconf" dnl -dnl "$Id: configure.in,v 1.33.2.31.2.85 2002/08/12 19:42:54 easysw Exp $" +dnl "$Id: configure.in,v 1.33.2.31.2.86 2002/09/17 20:27:17 easysw Exp $" dnl dnl Configuration script for the Fast Light Tool Kit (FLTK). dnl @@ -35,7 +35,7 @@ dnl FLTK library versions... FL_MAJOR_VERSION=1 FL_MINOR_VERSION=1 FL_PATCH_VERSION=0 -FL_RELEASE_VERSION=rc6 +FL_RELEASE_VERSION=rc7 FL_API_VERSION=${FL_MAJOR_VERSION}.${FL_MINOR_VERSION} AC_SUBST(FL_MAJOR_VERSION) @@ -785,5 +785,5 @@ dnl Make sure the fltk-config script is executable... chmod +x fltk-config dnl -dnl End of "$Id: configure.in,v 1.33.2.31.2.85 2002/08/12 19:42:54 easysw Exp $". +dnl End of "$Id: configure.in,v 1.33.2.31.2.86 2002/09/17 20:27:17 easysw Exp $". dnl diff --git a/fltk.spec b/fltk.spec index 3809a5615..6e56bd2a2 100644 --- a/fltk.spec +++ b/fltk.spec @@ -1,5 +1,5 @@ # -# "$Id: fltk.spec,v 1.1.2.9.2.15 2002/08/12 19:42:54 easysw Exp $" +# "$Id: fltk.spec,v 1.1.2.9.2.16 2002/09/17 20:27:17 easysw Exp $" # # RPM spec file for FLTK. # @@ -23,7 +23,7 @@ # Please report all bugs and problems to "fltk-bugs@fltk.org". # -%define version 1.1.0rc6 +%define version 1.1.0rc7 %define release 0 %define prefix /usr @@ -97,5 +97,5 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/share/doc/fltk/* # -# End of "$Id: fltk.spec,v 1.1.2.9.2.15 2002/08/12 19:42:54 easysw Exp $". +# End of "$Id: fltk.spec,v 1.1.2.9.2.16 2002/09/17 20:27:17 easysw Exp $". # diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx index c6de8ba15..5742357fe 100644 --- a/src/Fl_PNM_Image.cxx +++ b/src/Fl_PNM_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_PNM_Image.cxx,v 1.1.2.8 2002/05/27 21:16:47 easysw Exp $" +// "$Id: Fl_PNM_Image.cxx,v 1.1.2.9 2002/09/17 20:27:18 easysw Exp $" // // Fl_PNM_Image routines. // @@ -83,6 +83,8 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read format = atoi(lineptr); while (isdigit(*lineptr)) lineptr ++; + if (format == 7) lineptr = ""; + while (lineptr != NULL && w() == 0) { if (*lineptr == '\0' || *lineptr == '#') { lineptr = fgets(line, sizeof(line), fp); @@ -155,6 +157,16 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read case 6 : fread(ptr, w(), d(), fp); break; + + case 7 : /* XV 3:3:2 thumbnail format */ + for (x = w(); x > 0; x --) { + byte = getc(fp); + + *ptr++ = 255 * ((byte >> 5) & 7) / 7; + *ptr++ = 255 * ((byte >> 2) & 7) / 7; + *ptr++ = 255 * (byte & 3) / 3; + } + break; } } @@ -163,5 +175,5 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read // -// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.8 2002/05/27 21:16:47 easysw Exp $". +// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.9 2002/09/17 20:27:18 easysw Exp $". // diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx index e83b22b26..8f6b6a26f 100644 --- a/src/fl_images_core.cxx +++ b/src/fl_images_core.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_images_core.cxx,v 1.1.2.3 2002/08/09 01:09:49 easysw Exp $" +// "$Id: fl_images_core.cxx,v 1.1.2.4 2002/09/17 20:27:19 easysw Exp $" // // FLTK images library core. // @@ -75,7 +75,7 @@ fl_check_images(const char *name, // I - Filename if (memcmp(header, "BM", 2) == 0) // BMP file return new Fl_BMP_Image(name); - if (header[0] == 'P' && header[1] >= '1' && header[1] <= '6') + if (header[0] == 'P' && header[1] >= '1' && header[1] <= '7') // Portable anymap return new Fl_PNM_Image(name); @@ -97,5 +97,5 @@ fl_check_images(const char *name, // I - Filename // -// End of "$Id: fl_images_core.cxx,v 1.1.2.3 2002/08/09 01:09:49 easysw Exp $". +// End of "$Id: fl_images_core.cxx,v 1.1.2.4 2002/09/17 20:27:19 easysw Exp $". //