diff --git a/configure.ac b/configure.ac index c4917d27..a9f5c0da 100644 --- a/configure.ac +++ b/configure.ac @@ -548,6 +548,9 @@ AC_CONFIG_FILES( AC_CONFIG_FILES( [tools/neercs/Makefile ]) +AC_CONFIG_FILES( + [tools/pimp/Makefile +]) AC_CONFIG_FILES( [people/jnat/Makefile people/jnat/TestProject/Makefile diff --git a/src/image/codec/android-image.cpp b/src/image/codec/android-image.cpp index 379b4f69..f615a8fc 100644 --- a/src/image/codec/android-image.cpp +++ b/src/image/codec/android-image.cpp @@ -39,6 +39,7 @@ DECLARE_IMAGE_LOADER(AndroidImageData, 100) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -108,6 +109,13 @@ bool AndroidImageData::Open(char const *path) return true; } +bool AndroidImageData::Save(char const *path) +{ + UNUSED(path); + + /* TODO: unimplemented */ +} + bool AndroidImageData::Close() { JNIEnv *env; diff --git a/src/image/codec/dummy-image.cpp b/src/image/codec/dummy-image.cpp index 3ea1b9f3..ab3a98f4 100644 --- a/src/image/codec/dummy-image.cpp +++ b/src/image/codec/dummy-image.cpp @@ -28,6 +28,7 @@ DECLARE_IMAGE_LOADER(DummyImageData, 0) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -60,6 +61,13 @@ bool DummyImageData::Open(char const *path) return true; } +bool DummyImageData::Save(char const *path) +{ + UNUSED(path); + + return true; +} + bool DummyImageData::Close() { delete[] pixels; diff --git a/src/image/codec/gdiplus-image.cpp b/src/image/codec/gdiplus-image.cpp index 5f80eb2a..f1175ecb 100644 --- a/src/image/codec/gdiplus-image.cpp +++ b/src/image/codec/gdiplus-image.cpp @@ -35,6 +35,7 @@ DECLARE_IMAGE_LOADER(GdiPlusImageData, 100) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -139,6 +140,14 @@ bool GdiPlusImageData::Open(char const *path) return true; } +bool GdiPlusImageData::Save(char const *path) +{ + UNUSED(path); + + /* TODO: unimplemented */ + return true; +} + bool GdiPlusImageData::Close() { m_bitmap->UnlockBits(&m_bdata); diff --git a/src/image/codec/ios-image.cpp b/src/image/codec/ios-image.cpp index c842064a..0d6d4810 100644 --- a/src/image/codec/ios-image.cpp +++ b/src/image/codec/ios-image.cpp @@ -32,6 +32,7 @@ DECLARE_IMAGE_LOADER(IosImageData, 100) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -83,6 +84,14 @@ bool IosImageData::Open(char const *path) return true; } +bool IosImageData::Save(char const *path) +{ + UNUSED(path); + + /* TODO: unimplemented */ + return true; +} + bool IosImageData::Close() { free(pixels); diff --git a/src/image/codec/ps3-image.cpp b/src/image/codec/ps3-image.cpp index 0950e5bf..ac3cb322 100644 --- a/src/image/codec/ps3-image.cpp +++ b/src/image/codec/ps3-image.cpp @@ -34,6 +34,7 @@ DECLARE_IMAGE_LOADER(Ps3ImageData, 100) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -173,6 +174,14 @@ bool Ps3ImageData::Open(char const *path) return true; } +bool Ps3ImageData::Open(char const *path) +{ + UNUSED(path); + + /* TODO: unimplemented */ + return true; +} + bool Ps3ImageData::Close() { free(pixels); diff --git a/src/image/codec/sdl-image.cpp b/src/image/codec/sdl-image.cpp index 47b5062b..640919db 100644 --- a/src/image/codec/sdl-image.cpp +++ b/src/image/codec/sdl-image.cpp @@ -41,6 +41,7 @@ DECLARE_IMAGE_LOADER(SdlImageData, 50) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -89,6 +90,13 @@ bool SdlImageData::Open(char const *path) return true; } +bool SdlImageData::Save(char const *path) +{ + int ret = SDL_SaveBMP(m_img, path); + + return ret == 0; +} + bool SdlImageData::Close() { SDL_FreeSurface(m_img); diff --git a/src/image/codec/zed-image.cpp b/src/image/codec/zed-image.cpp index 89b78258..3fd4bd0e 100644 --- a/src/image/codec/zed-image.cpp +++ b/src/image/codec/zed-image.cpp @@ -29,6 +29,7 @@ DECLARE_IMAGE_LOADER(ZedImageData, 0) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -299,6 +300,13 @@ bool ZedImageData::Open(char const *path) return true; } +bool ZedImageData::Save(char const *path) +{ + UNUSED(path); + /* FIXME: do we need to implement this? */ + return true; +} + bool ZedImageData::Close() { delete[] m_pixels; diff --git a/src/image/codec/zed-palette-image.cpp b/src/image/codec/zed-palette-image.cpp index 775640d2..64405713 100644 --- a/src/image/codec/zed-palette-image.cpp +++ b/src/image/codec/zed-palette-image.cpp @@ -28,6 +28,7 @@ DECLARE_IMAGE_LOADER(ZedPaletteImageData, 0) { public: virtual bool Open(char const *); + virtual bool Save(char const *); virtual bool Close(); virtual uint8_t *GetData() const; @@ -83,6 +84,13 @@ bool ZedPaletteImageData::Open(char const *path) return true; } +bool ZedPaletteImageData::Save(char const *path) +{ + UNUSED(path); + /* FIXME: do we need to implement this? */ + return true; +} + bool ZedPaletteImageData::Close() { delete[] m_pixels; diff --git a/src/image/image-private.h b/src/image/image-private.h index 9786087a..41fa8b6c 100644 --- a/src/image/image-private.h +++ b/src/image/image-private.h @@ -81,6 +81,7 @@ public: virtual ~ImageData() {} virtual bool Open(char const *) = 0; + virtual bool Save(char const *) = 0; virtual bool Close() = 0; virtual uint8_t *GetData() const = 0; diff --git a/src/image/image.cpp b/src/image/image.cpp index d254ba99..18ba7e60 100644 --- a/src/image/image.cpp +++ b/src/image/image.cpp @@ -178,6 +178,11 @@ Image::Image() { } +bool Image::Save(char const *path) +{ + return m_data->Save(path); +} + ivec2 Image::GetSize() const { return m_data->m_size; diff --git a/src/lol/image/image.h b/src/lol/image/image.h index 5d3a5e16..3246e4e7 100644 --- a/src/lol/image/image.h +++ b/src/lol/image/image.h @@ -31,6 +31,7 @@ public: static Image *Load(char const *path); static void Destroy(Image *img); + bool Save(char const *path); ivec2 GetSize() const; PixelFormat GetFormat() const; uint8_t *GetData() const; diff --git a/tools/Makefile.am b/tools/Makefile.am index 45e93953..11f88d1c 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -4,6 +4,7 @@ include $(top_srcdir)/build/autotools/common.am SUBDIRS = SUBDIRS += lolremez SUBDIRS += neercs +SUBDIRS += pimp SUBDIRS += vimlol SUBDIRS += vslol