summaryrefslogtreecommitdiff
path: root/src/Fl_Shared_Image.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-24 18:07:58 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-24 18:07:58 +0000
commitb650366d80e58cf3154c5bdf8ceb6a242c1a0251 (patch)
treec71ef9770b24f56c44495006426739adfa89c99e /src/Fl_Shared_Image.cxx
parente016a249b25c77b38d77d3a26d563cdec7a2592b (diff)
Added XBM, XPM, and PNM image file classes.
The pixmap_browser demo now supports all image formats via Fl_Shared_Image. Dropped image file stuff from image demo. Added Fl_Tiled_Image class, which tiles an Fl_Image, useful for tiling a background image in groups. Added tiled_image demo. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1725 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Shared_Image.cxx')
-rw-r--r--src/Fl_Shared_Image.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx
index fd345412f..996ea39ff 100644
--- a/src/Fl_Shared_Image.cxx
+++ b/src/Fl_Shared_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Shared_Image.cxx,v 1.23.2.1 2001/11/24 02:46:19 easysw Exp $"
+// "$Id: Fl_Shared_Image.cxx,v 1.23.2.2 2001/11/24 18:07:57 easysw Exp $"
//
// Shared image code for the Fast Light Tool Kit (FLTK).
//
@@ -32,8 +32,9 @@
#include <FL/Fl_GIF_Image.H>
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_PNG_Image.H>
-//#include <FL/Fl_XBM_Image.H>
-//#include <FL/Fl_XPM_Image.H>
+#include <FL/Fl_PNM_Image.H>
+#include <FL/Fl_XBM_Image.H>
+#include <FL/Fl_XPM_Image.H>
//
@@ -224,6 +225,12 @@ Fl_Shared_Image::reload() {
else if (memcmp(header, "\377\330\377", 3) == 0 && // Start-of-Image
header[3] >= 0xe0 && header[3] <= 0xef) // APPn
img = new Fl_JPEG_Image(name_);
+ else if (header[0] == 'P' && header[1] >= '1' && header[1] <= '6') // Portable anymap
+ img = new Fl_PNM_Image(name_);
+ else if (memcmp(header, "#define", 7) == 0) // XBM file
+ img = new Fl_XBM_Image(name_);
+ else if (memcmp(header, "/* XPM */", 9) == 0) // XPM file
+ img = new Fl_XPM_Image(name_);
else
img = 0;
@@ -369,5 +376,5 @@ Fl_Shared_Image::get(const char *n, int W, int H) {
//
-// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.1 2001/11/24 02:46:19 easysw Exp $".
+// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.2 2001/11/24 18:07:57 easysw Exp $".
//