Add error checking and improve constructor of Fl_BMP_Image

- use new features of Fl_Image_Reader (read error and EOF checks)
- add length argument to constructor reading from memory
This commit is contained in:
Albrecht Schlosser
2021-09-27 19:21:21 +02:00
parent 1d847fec00
commit e0d630ed72
2 changed files with 155 additions and 104 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
//
// BMP image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2020 by Bill Spitzak and others.
// Copyright 1998-2021 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -27,14 +27,14 @@
*/
class FL_EXPORT Fl_BMP_Image : public Fl_RGB_Image {
public:
public:
Fl_BMP_Image(const char* filename);
Fl_BMP_Image(const char* imagename, const unsigned char *data);
Fl_BMP_Image(const char* filename);
Fl_BMP_Image(const char* imagename, const unsigned char *data, const long length = -1);
protected:
protected:
void load_bmp_(class Fl_Image_Reader &rdr);
void load_bmp_(class Fl_Image_Reader &rdr);
};