Commit 635b75a9 authored by Sylvain Thery's avatar Sylvain Thery

resolve problem with NO_QT & loadImage

parent 033af6c1
...@@ -236,13 +236,11 @@ public: ...@@ -236,13 +236,11 @@ public:
*/ */
bool load(const unsigned char *ptr, unsigned int w, unsigned int h, unsigned int bpp); bool load(const unsigned char *ptr, unsigned int w, unsigned int h, unsigned int bpp);
#ifdef WITH_QT
/// load from file /// load from file
bool load(const std::string& filename); bool load(const std::string& filename);
/// load from file /// load from file
void save(const std::string& filename); void save(const std::string& filename);
#endif
/** /**
* crop image * crop image
......
...@@ -347,13 +347,13 @@ bool Image<DIM,TYPE>::load(const std::string& filename) ...@@ -347,13 +347,13 @@ bool Image<DIM,TYPE>::load(const std::string& filename)
this->m_size[1] = ilGetInteger(IL_IMAGE_HEIGHT); this->m_size[1] = ilGetInteger(IL_IMAGE_HEIGHT);
this->computeSub(); this->computeSub();
this->m_data_ptr = new TYPE[ptr->width()*ptr->height()]; this->m_data_ptr = new TYPE[this->m_size[0]*this->m_size[1]];
unsigned char* ptr = reinterpret_cast<unsigned char*>(this->m_data_ptr); unsigned char* ptr = reinterpret_cast<unsigned char*>(this->m_data_ptr);
for (int i=this->m_size[1]-1; i>=0; --i) for (int i=this->m_size[1]-1; i>=0; --i)
{ {
ilCopyPixels(0, i, 0, this->m_size[0],1, 1, IL_RGB, IL_UNSIGNED_BYTE, ptr); ilCopyPixels(0, i, 0, this->m_size[0],1, 1, IL_RGB, IL_UNSIGNED_BYTE, ptr);
ptr += 3*w; ptr += 3*this->m_size[0];
} }
ilDeleteImage(imgName); ilDeleteImage(imgName);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Contact information: cgogn@unistra.fr * * Contact information: cgogn@unistra.fr *
* * * *
*******************************************************************************/ *******************************************************************************/
#ifdef WITH_QT //#ifdef WITH_QT
#include "Utils/Shaders/shaderTextureMask.h" #include "Utils/Shaders/shaderTextureMask.h"
...@@ -35,32 +35,6 @@ namespace Utils ...@@ -35,32 +35,6 @@ namespace Utils
#include "shaderTextureMask.vert" #include "shaderTextureMask.vert"
#include "shaderTextureMask.frag" #include "shaderTextureMask.frag"
//std::string ShaderTextureMask::vertexShaderText =
// "ATTRIBUTE vec3 VertexPosition;\n"
// "ATTRIBUTE vec2 VertexTexCoord;\n"
// "uniform mat4 ModelViewProjectionMatrix;\n"
// "VARYING_VERT vec2 texCoord;\n"
// "INVARIANT_POS;\n"
// "void main ()\n"
// "{\n"
// " gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);\n"
// " texCoord = VertexTexCoord;\n"
// "}";
//
//
//std::string ShaderTextureMask::fragmentShaderText =
// "PRECISON;\n"
// "VARYING_FRAG vec2 texCoord;\n"
// "uniform sampler2D textureUnit;\n"
// "uniform sampler2D textureUnitMask;\n"
// "FRAG_OUT_DEF;\n"
// "void main()\n"
// "{\n"
// " float m = texture2D(textureUnitMask,texCoord).r;\n"
// " if (m < 0.5)"
// " discard;"
// " gl_FragColor=texture2D(textureUnit,texCoord)*m;\n"
// "}";
ShaderTextureMask::ShaderTextureMask() ShaderTextureMask::ShaderTextureMask()
...@@ -137,6 +111,6 @@ void ShaderTextureMask::restoreUniformsAttribs() ...@@ -137,6 +111,6 @@ void ShaderTextureMask::restoreUniformsAttribs()
} // namespace CGoGN } // namespace CGoGN
#else //#else
#pragma message(__FILE__ " not compiled because of mising Qt") //#pragma message(__FILE__ " not compiled because of mising Qt")
#endif //#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment