summaryrefslogtreecommitdiff
path: root/glcdgraphics/imagefile.c
blob: 0f9ec25ecc5d5bb41234df9aa74a305288921266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * GraphLCD graphics library
 *
 * imagefile.h  -  base class for file loading and saving
 *
 * This file is released under the GNU General Public License. Refer
 * to the COPYING file distributed with this package.
 *
 * (c) 2006      Andreas Regel <andreas.regel AT powarman.de>
 * (c) 2010-2013 Wolfgang Astleitner <mrwastl AT users sourceforge net>
 */

#include "image.h"
#include "imagefile.h"
#include "bitmap.h"

namespace GLCD
{

cImageFile::cImageFile(void)
{
}
cImageFile::~cImageFile(void)
{
}

bool cImageFile::Load(cImage & image, const std::string & fileName)
{
    return false;
}

bool cImageFile::Save(cImage & image, const std::string & fileName)
{
    return false;
}



bool cImageFile::LoadScaled(cImage & image, const std::string & fileName, uint16_t & scalew, uint16_t & scaleh)
{
    if (Load(image, fileName)) {
        if (scalew || scaleh) {
            return image.Scale(scalew, scaleh, true);
        } else {
            return true;
        }
    } else {
      scalew = 0;
      scaleh = 0;
      return false;
    }
}

} // end of namespace