From 3698cdc92500d9e29d810fa2d7094999f4a3dfe3 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 13 Aug 2014 22:30:47 +0200 Subject: [PATCH] [DEV] change default Instance --- egami/egami.cpp | 24 ++++++++++++------------ egami/wrapperEDF.cpp | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/egami/egami.cpp b/egami/egami.cpp index a145dc3..cd8be02 100644 --- a/egami/egami.cpp +++ b/egami/egami.cpp @@ -16,32 +16,32 @@ #include bool egami::scalable(const std::string& _fileName) { - if (true == end_with(_fileName, ".svg") ) { + if (true == etk::end_with(_fileName, ".svg") ) { return true; } return false; } bool egami::load(egami::Image& _output, const std::string& _fileName, const ivec2& _size) { - std::string tmpName = std::tolower(_fileName); + std::string tmpName = etk::tolower(_fileName); // select the corect Loader : - if (true == end_with(tmpName, ".edf") ) { // internal format for ewol distance field ==> simple sistance field image + if (true == etk::end_with(tmpName, ".edf") ) { // internal format for ewol distance field ==> simple sistance field image if (false == egami::loadEDF(_fileName, _output)) { EGAMI_ERROR("Error to load EDF file '" << _fileName << "'"); return false; } - } else if (true == end_with(tmpName, ".bmp") ) { + } else if (true == etk::end_with(tmpName, ".bmp") ) { if (false == egami::loadBMP(_fileName, _output)) { EGAMI_ERROR("Error to load BMP file '" << _fileName << "'"); return false; } - } else if (true == end_with(tmpName, ".svg") ) { + } else if (true == etk::end_with(tmpName, ".svg") ) { if (false == egami::loadSVG(_fileName, _output, _size)) { EGAMI_ERROR("Error to load SVG file '" << _fileName << "'"); return false; } //egami::storeEDF(_fileName + ".edf", _output); - } else if (true == end_with(tmpName, ".png") ) { + } else if (true == etk::end_with(tmpName, ".png") ) { if (false == egami::loadPNG(_fileName, _output)) { EGAMI_ERROR("Error to load PNG file '" << _fileName << "'"); return false; @@ -54,23 +54,23 @@ bool egami::load(egami::Image& _output, const std::string& _fileName, const ivec } bool egami::store(const egami::Image& _input, const std::string& _fileName) { - std::string tmpName = std::tolower(_fileName); + std::string tmpName = etk::tolower(_fileName); EGAMI_DEBUG("Store file : " << _fileName); // select the corect Loader : - if (true == end_with(tmpName, ".edf") ) { + if (true == etk::end_with(tmpName, ".edf") ) { if (false == egami::storeEDF(_fileName, _input)) { EGAMI_ERROR("Error to load EDF file '" << _fileName << "'"); return false; } - } else if (true == end_with(tmpName, ".bmp") ) { + } else if (true == etk::end_with(tmpName, ".bmp") ) { if (false == egami::storeBMP(_fileName, _input)) { EGAMI_ERROR("Error to load BMP file '" << _fileName << "'"); return false; } - } else if (true == end_with(tmpName, ".svg") ) { + } else if (true == etk::end_with(tmpName, ".svg") ) { EGAMI_ERROR("Can not store in SVG file '" << _fileName << "'"); return false; - } else if (true == end_with(tmpName, ".png") ) { + } else if (true == etk::end_with(tmpName, ".png") ) { EGAMI_ERROR("Can not store in PNG file '" << _fileName << "'"); return false; } else { @@ -166,7 +166,7 @@ static void generateDistanceField(const egami::ImageMono& _input, egami::Image& bool egami::generateDistanceFieldFile(const std::string& _input, const std::string& _output) { egami::Image data; - if (std::end_with(_input, ".edf") == true) { + if (etk::end_with(_input, ".edf") == true) { return false; } EGAMI_ERROR("Generate distance field : '" << _input << "' ==> '" << _output << "'"); diff --git a/egami/wrapperEDF.cpp b/egami/wrapperEDF.cpp index f56f5b2..c7c88e7 100644 --- a/egami/wrapperEDF.cpp +++ b/egami/wrapperEDF.cpp @@ -31,7 +31,7 @@ bool egami::loadEDF(const std::string& _inputFile, egami::Image& _ouputImage) { } std::string line; file.fileGets(line); - if (std::start_with(line, "#edf", false) == false) { + if (etk::start_with(line, "#edf", false) == false) { EGAMI_ERROR("This file seams not to be a EDF file ..."); file.fileClose(); return false; @@ -96,9 +96,9 @@ bool egami::storeEDF(const std::string& _fileName, const egami::Image& _inputIma return false; } anErrorEccured = file.filePuts( std::string("#EDF // Generate with EGAMI (") - + std::to_string(_inputImage.getSize().x()) + + etk::to_string(_inputImage.getSize().x()) + "," - + std::to_string(_inputImage.getSize().y()) + ")\n"); + + etk::to_string(_inputImage.getSize().y()) + ")\n"); char tmp[256]; for (int32_t yyy = 0; yyy < _inputImage.getSize().y(); ++yyy) {