From 37c83f972851851bf796a60d8000f880ab49774d Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sat, 8 Sep 2018 11:12:18 +0200 Subject: [PATCH] [DEV] update resize --- egami/Image.hpp | 3 ++- egami/ImagePrivate.hpp | 8 ++++++++ egami/egami.cpp | 1 - egami/wrapperJPG.cpp | 3 ++- lutinParseSubFolders.txt | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/egami/Image.hpp b/egami/Image.hpp index 44e7e6d..03e158f 100644 --- a/egami/Image.hpp +++ b/egami/Image.hpp @@ -96,9 +96,10 @@ namespace egami { } void swap(egami::Image& _obj); // ----------------------------------------------- - // -- basic tools : + // -- basic tools: // ----------------------------------------------- public : + void move(const ivec2& _offset); void resize(const ivec2& _size, const ivec2& _startPos=ivec2(0,0)); // TODO : Create a template function ... void resize(const ivec2& _size, const etk::Color<>& _color, const ivec2& _startPos=ivec2(0,0)); diff --git a/egami/ImagePrivate.hpp b/egami/ImagePrivate.hpp index 4a6a0ba..a0bf332 100644 --- a/egami/ImagePrivate.hpp +++ b/egami/ImagePrivate.hpp @@ -49,6 +49,7 @@ namespace egami { // ----------------------------------------------- public : void resize2__(const ivec2& _size, const ivec2& _startPos=ivec2(0,0)) { + move(-_startPos); if (_size == m_size) { // same size == > nothing to do ... return; @@ -126,6 +127,13 @@ namespace egami { m_size=_size; m_data.resize(m_size.x()*m_size.y(), _color); } + void move(const ivec2& _offset) { + for (int32_t xxx=0; xxx& _color, const ivec2& _startPos) { resize__(_size, _color); diff --git a/egami/egami.cpp b/egami/egami.cpp index 5b3510e..e16ab1b 100644 --- a/egami/egami.cpp +++ b/egami/egami.cpp @@ -170,7 +170,6 @@ bool egami::store(const egami::Image& _input, const etk::String& _fileName) { EGAMI_WARNING("egami not compile with the JPEG dependency for file '" << _fileName << "'"); return false; #endif - return false; } else if (etk::end_with(tmpName, ".j2k") == true) { EGAMI_ERROR("Can not store in JPEG 2000 file '" << _fileName << "'"); return false; diff --git a/egami/wrapperJPG.cpp b/egami/wrapperJPG.cpp index e33491b..3a484d4 100644 --- a/egami/wrapperJPG.cpp +++ b/egami/wrapperJPG.cpp @@ -183,7 +183,8 @@ bool egami::storeJPG(const etk::String& _fileName, const egami::Image& _inputIma * RGB color and is described by: */ -int quality = 250; +//int quality = 250; +int quality = 200; bool egami::storeJPG(etk::Vector& _buffer, const egami::Image& _inputImage) { _buffer.clear(); diff --git a/lutinParseSubFolders.txt b/lutinParseSubFolders.txt index 89b1ecd..9eb368f 100644 --- a/lutinParseSubFolders.txt +++ b/lutinParseSubFolders.txt @@ -1 +1,2 @@ -tools/viewer \ No newline at end of file +tools/viewer +tools/cutter \ No newline at end of file