16 |
#include <boost/tuple/tuple.hpp> |
#include <boost/tuple/tuple.hpp> |
17 |
#include <boost/format.hpp> |
#include <boost/format.hpp> |
18 |
#include <boost/bind.hpp> |
#include <boost/bind.hpp> |
|
|
|
19 |
#include <Magick++.h> |
#include <Magick++.h> |
|
|
|
20 |
#include <GL/glew.h> |
#include <GL/glew.h> |
21 |
|
|
22 |
#include "texture.hpp" |
#include "texture.hpp" |
23 |
#include "texture-meta.hpp" |
#include "texture-meta.hpp" |
24 |
|
//#include "config.hpp" |
25 |
|
#include "system.hpp" |
26 |
#include "log.hpp" |
#include "log.hpp" |
27 |
|
|
28 |
namespace usata |
namespace usata |
98 |
case Magick::GrayscaleMatteType: |
case Magick::GrayscaleMatteType: |
99 |
Type=LUMA;mt="RA"; |
Type=LUMA;mt="RA"; |
100 |
break; |
break; |
101 |
|
// case Magick::ColorSeparationType |
102 |
|
|
103 |
|
case Magick::BilevelType: |
104 |
|
// dont ask, I dont know why not "RA" |
105 |
|
// but that doesnt work |
106 |
|
Type=LUMA; mt= "AR"; |
107 |
|
break; |
108 |
|
|
109 |
default: |
default: |
110 |
throw std::runtime_error("Unsupported image pixel layout"); |
throw std::runtime_error("Unsupported image pixel layout" ); |
111 |
} |
} |
112 |
Width = magick->columns(); |
Width = magick->columns(); |
113 |
Height = magick->rows(); |
Height = magick->rows(); |
184 |
void |
void |
185 |
TextureMap::finish_load() |
TextureMap::finish_load() |
186 |
{ |
{ |
187 |
|
using namespace system; |
188 |
|
const video::Capabilities& vcap = video::get_capabilities(); |
189 |
log::BufferedStream logstream(log::Level::DEBUG); |
log::BufferedStream logstream(log::Level::DEBUG); |
190 |
if (! m_pixmap.get() ) |
if (! m_pixmap.get() ) |
191 |
return; |
return; |
193 |
allocate_gltex(); |
allocate_gltex(); |
194 |
|
|
195 |
GLint internal_gl_format = m_pixmap->type(); |
GLint internal_gl_format = m_pixmap->type(); |
196 |
|
if (m_meta.compress) |
197 |
|
internal_gl_format=vcap.compressed_format[m_pixmap->type()]; |
198 |
|
|
199 |
|
|
200 |
if (m_pixmap->height() == 1) |
if (m_pixmap->height() == 1) |
201 |
m_gl_texture_type = GL_TEXTURE_1D; |
m_gl_texture_type = GL_TEXTURE_1D; |