[DEBUG] correct viewer

This commit is contained in:
Edouard DUPIN 2017-10-09 10:18:19 +02:00
parent 024d00adff
commit 7965135796
3 changed files with 14 additions and 8 deletions

View File

@ -99,9 +99,14 @@ egami::Image::~Image() {
}
egami::Image::Image(const ivec2& _size, enum colorType _type) :
egami::Image::Image(const ivec2& _size,
enum colorType _type,
const void* _dataToCopy) :
m_data(nullptr) {
configure(_size, _type);
if (_dataToCopy != nullptr) {
memcpy(getTextureDataPointer(), _dataToCopy, getSize().x()*getSize().y()*egami::getFormatColorSize(getType()));
}
}
void egami::Image::swap(egami::Image& _obj) {

View File

@ -82,7 +82,8 @@ namespace egami {
Image(const egami::Image& _image);
Image& operator=(const egami::Image& _image);
Image(const ivec2& _size,
enum colorType _type = egami::colorType::undefined);
enum colorType _type = egami::colorType::undefined,
const void* _dataToCopy = nullptr);
~Image();
// TODO : IMplement move operator ... and copy operator...
public:

View File

@ -74,7 +74,7 @@ bool appl::MainWindows::onEventEntry(const ewol::event::Entry& _event) {
return true;
}
m_image->propertySource.set(m_listImages[m_idDisplayed]);
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::to_string(m_listImages.size()));
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::toString(m_listImages.size()));
return true;
}
if (_event.getType() == gale::key::keyboard::left) {
@ -84,7 +84,7 @@ bool appl::MainWindows::onEventEntry(const ewol::event::Entry& _event) {
return true;
}
m_image->propertySource.set(m_listImages[m_idDisplayed]);
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::to_string(m_listImages.size()));
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::toString(m_listImages.size()));
return true;
}
if (_event.getType() == gale::key::keyboard::down) {
@ -93,7 +93,7 @@ bool appl::MainWindows::onEventEntry(const ewol::event::Entry& _event) {
m_idDisplayed = m_listImages.size()-1;
}
m_image->propertySource.set(m_listImages[m_idDisplayed]);
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::to_string(m_listImages.size()));
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::toString(m_listImages.size()));
return true;
}
if (_event.getType() == gale::key::keyboard::up) {
@ -102,19 +102,19 @@ bool appl::MainWindows::onEventEntry(const ewol::event::Entry& _event) {
m_idDisplayed = 0;
}
m_image->propertySource.set(m_listImages[m_idDisplayed]);
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::to_string(m_listImages.size()));
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::toString(m_listImages.size()));
return true;
}
if (_event.getType() == gale::key::keyboard::pageDown) {
m_idDisplayed = m_listImages.size()-1;
m_image->propertySource.set(m_listImages[m_idDisplayed]);
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::to_string(m_listImages.size()));
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::toString(m_listImages.size()));
return true;
}
if (_event.getType() == gale::key::keyboard::pageUp) {
m_idDisplayed = 0;
m_image->propertySource.set(m_listImages[m_idDisplayed]);
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::to_string(m_listImages.size()));
propertyTitle.set("EVI:" + m_listImages[m_idDisplayed] + " " + etk::toString(m_idDisplayed+1) + "/" + etk::toString(m_listImages.size()));
return true;
}
}