- we can now save jpg screenshots and can also convert model textures to jpg (WARNING jpg DOES NOT support alpha channel (for transparency) so use this wisely

This commit is contained in:
Mark Vejvoda
2011-03-13 22:43:44 +00:00
parent b3951b3940
commit 28f74a15f7
6 changed files with 169 additions and 10 deletions

View File

@@ -116,6 +116,23 @@ public:
virtual void write(uint8 *pixels);
};
class PixmapIoJpg: public PixmapIo {
private:
FILE *file;
string path;
public:
PixmapIoJpg();
virtual ~PixmapIoJpg();
virtual void openRead(const string &path);
virtual void read(uint8 *pixels);
virtual void read(uint8 *pixels, int components);
virtual void openWrite(const string &path, int w, int h, int components);
virtual void write(uint8 *pixels);
};
// =====================================================
// class Pixmap1D
// =====================================================
@@ -179,6 +196,7 @@ public:
void saveBmp(const string &path);
void saveTga(const string &path);
void savePng(const string &path);
void saveJpg(const string &path);
//get
int getW() const {return w;}