summaryrefslogtreecommitdiff
path: root/glcdgraphics/image.h
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2013-03-21 20:29:45 +0100
committermrwastl <mrwastl@users.sourceforge.net>2013-03-21 20:29:45 +0100
commit60bdec72ecd6bb236f2f1153398c9996fb95730f (patch)
tree7b6a7667f41002b54dcc78360cef71256b811c94 /glcdgraphics/image.h
parentcf926629084ab015873859e759155f9bfe813e6b (diff)
downloadgraphlcd-base-60bdec72ecd6bb236f2f1153398c9996fb95730f.tar.gz
graphlcd-base-60bdec72ecd6bb236f2f1153398c9996fb95730f.tar.bz2
glcdgraphics: bug fix in glcd.c, moved methods Scale() and Blend() to image.c, added static methods for loading/saving image; showpic and convpic working again; convpic cleaned up; showpic: added parameters for scaling and centering image
Diffstat (limited to 'glcdgraphics/image.h')
-rw-r--r--glcdgraphics/image.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/glcdgraphics/image.h b/glcdgraphics/image.h
index 888d942..f594886 100644
--- a/glcdgraphics/image.h
+++ b/glcdgraphics/image.h
@@ -10,6 +10,7 @@
* to the COPYING file distributed with this package.
*
* (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2013 Wolfgang Astleitner <mrwastl AT users sourceforge net>
*/
#ifndef _GLCDGRAPHICS_IMAGE_H_
@@ -18,6 +19,7 @@
#include <stdint.h>
#include <vector>
+#include <string>
namespace GLCD
{
@@ -33,6 +35,8 @@ private:
unsigned int curBitmap;
uint64_t lastChange;
std::vector <cBitmap *> bitmaps;
+
+ uint32_t Blend(uint32_t fgcol, uint32_t bgcol, uint8_t level, double antiAliasGranularity = 0.0) const;
public:
cImage();
~cImage();
@@ -51,6 +55,12 @@ public:
cBitmap * GetBitmap() const;
void AddBitmap(cBitmap * Bitmap) { bitmaps.push_back(Bitmap); }
void Clear();
+
+ bool Scale(uint16_t scalew, uint16_t scaleh, bool AntiAlias = false);
+
+ static bool LoadImage(cImage & image, const std::string & fileName);
+ static bool SaveImage(cImage & image, const std::string & fileName);
+ static const std::string GetFilenameExtension(const std::string & fileName);
};
} // end of namespace