78 for (mapsMap::iterator m =
_maps.begin(), mend =
_maps.end(); m != mend; ++m) {
123 for (deque<StrokeLayer *>::iterator sl =
_Layers.begin(), slend =
_Layers.end(); sl != slend;
154 for (deque<StrokeLayer *>::iterator sl =
_Layers.begin(), slend =
_Layers.end(); sl != slend;
211 for (deque<StrokeLayer *>::iterator sl =
_Layers.begin(), slend =
_Layers.end(); sl != slend;
278 for (
uint i = index; i <
size; ++i) {
301 _Layers[i]->RenderBasic(iRenderer);
308 if (!
_maps.empty()) {
309 mapsMap::iterator m =
_maps.find(iMapName);
310 if (m !=
_maps.end()) {
325 filePath += iFileName;
328 filePath = iFileName;
333 QImage newMap(filePath.c_str());
334 if (newMap.isNull()) {
335 cerr <<
"Could not load image file " << filePath << endl;
342 if (qimg ==
nullptr) {
343 cerr <<
"Could not load image file " << filePath << endl;
350 if ((newMap.width() !=
width()) || (newMap.height() !=
height())) {
351 scaledImg = newMap.scaled(
width(),
height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
356 if ((qimg->x !=
width()) || (qimg->y !=
height())) {
363 if (newMap->depth() != 8) {
364 int w = newMap->width();
365 int h = newMap->height();
366 QImage *tmp =
new QImage(
w, h, 8);
367 for (
uint y = 0; y < h; ++
y) {
368 for (
uint x = 0; x <
w; ++
x) {
369 int c = qGray(newMap->pixel(x, y));
370 tmp->setPixel(x, y,
c);
381 int rowbytes =
w * 4;
385 for (y = 0; y < h; ++
y) {
386 for (x = 0; x <
w; ++
x) {
387 pix = qimg->byte_buffer.data + y * rowbytes + x * 4;
388 float c = (pix[0] * 11 + pix[1] * 16 + pix[2] * 5) / 32;
397 for (y = 0; y < h; ++
y) {
398 for (x = 0; x <
w; ++
x) {
406 int ow = pyramid->
width(0);
407 int oh = pyramid->
height(0);
408 string base(iMapName);
420 for (y = 0; y < oh; ++
y) {
421 for (x = 0; x < ow; ++
x) {
422 int c = pyramid->
pixel(x, y, i);
425 pix[0] = pix[1] = pix[2] =
c;
429 stringstream filepath;
431 filepath << i <<
".bmp";
433 IMB_saveiff(qtmp,
const_cast<char *
>(filepath.str().c_str()), 0);
437 QImage *qtmp =
new QImage(
w, h, 32);
438 for (y = 0; y < h; ++
y) {
439 for (x = 0; x <
w; ++
x) {
440 int c =
int(blur.pixel(x, y));
441 qtmp->setPixel(x, y, qRgb(
c,
c,
c));
448 _maps[iMapName] = pyramid;
456 cout <<
"readMapPixel warning: no map was loaded " << endl;
460 mapsMap::iterator m =
_maps.find(iMapName);
461 if (m ==
_maps.end()) {
463 cout <<
"readMapPixel warning: no map was loaded with the name " << iMapName << endl;
468 if ((x < 0) || (x >= pyramid->
width()) || (y < 0) || (y >= pyramid->
height())) {
Class to define a canvas designed to draw style modules.
Configuration definitions.
Class to perform gaussian filtering operations on an image.
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
Contains defines and structs used throughout the imbuf module.
Class to represent a pyramid of images.
Class to encapsulate an array of RGB or Gray level values.
Class to define a pseudo Perlin noise.
Convenient access to the steerable ViewMap to which any element of the ViewMap belongs to.
Classes to render a stroke with OpenGL.
Class representing a style module.
Class defining a singleton used as timestamp.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void setVisible(uint index, bool iVisible)
std::deque< StrokeLayer * > _Layers
SteerableViewMap * _steerableViewMap
void setModified(uint index, bool iMod)
void causalStyleModules(std::vector< uint > &vec, uint index=0)
void RemoveStyleModule(uint index)
void InsertStyleModule(uint index, StyleModule *iStyleModule)
void SwapStyleModules(uint i1, uint i2)
float readMapPixel(const char *iMapName, int level, int x, int y)
virtual void Render(const StrokeRenderer *iRenderer)
void PushBackStyleModule(StyleModule *iStyleModule)
virtual void RenderBasic(const StrokeRenderer *iRenderer)
void loadMap(const char *iFileName, const char *iMapName, uint iNbLevels=4, float iSigma=1.0f)
virtual int height() const =0
StyleModule * _current_sm
virtual int width() const =0
void resetModified(bool iMod=false)
std::deque< StyleModule * > _StyleModules
void ReplaceStyleModule(uint index, StyleModule *iStyleModule)
static const int NB_STEERABLE_VIEWMAP
static const char * _MapsPath
StrokeRenderer * _Renderer
static Canvas * _pInstance
float getSmoothedPixel(Map *map, int x, int y)
void setPixel(uint x, uint y, float v)
virtual float pixel(int x, int y, int level=0)
int getNumberOfLevels() const
virtual int height(int level=0)
virtual int width(int level=0)
static void init(long seed)
void setDisplayed(bool b=true)
static TimeStamp * instance()
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
struct ImBuf * IMB_allocImBuf(unsigned int, unsigned int, unsigned char, unsigned int)
bool IMB_saveiff(struct ImBuf *, const char *, int)
ImBufByteBuffer byte_buffer