2013-12-09 21:16:00 +00:00
|
|
|
#ifndef TEXTURE3D_H
|
|
|
|
#define TEXTURE3D_H
|
|
|
|
|
|
|
|
#include "basics_global.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace basics {
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
class BASICSSHARED_EXPORT Texture3D {
|
|
|
|
public:
|
2013-12-09 21:16:00 +00:00
|
|
|
Texture3D(int xsize, int ysize, int zsize);
|
|
|
|
~Texture3D();
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
void getSize(int *xsize, int *ysize, int *zsize) const;
|
2013-12-09 21:16:00 +00:00
|
|
|
void setPixel(int x, int y, int z, Color col);
|
2013-12-22 17:05:11 +00:00
|
|
|
Color getPixel(int x, int y, int z) const;
|
|
|
|
Color getNearest(double dx, double dy, double dz) const;
|
|
|
|
Color getLinear(double dx, double dy, double dz) const;
|
|
|
|
Color getCubic(double dx, double dy, double dz) const;
|
2013-12-09 21:16:00 +00:00
|
|
|
void fill(Color col);
|
2015-11-09 21:30:46 +00:00
|
|
|
void add(Texture3D *other);
|
|
|
|
void save(PackStream *stream) const;
|
|
|
|
void load(PackStream *stream);
|
2013-12-22 17:05:11 +00:00
|
|
|
void saveToFile(const std::string &filepath) const;
|
2013-12-09 21:16:00 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
2013-12-09 21:16:00 +00:00
|
|
|
int xsize;
|
|
|
|
int ysize;
|
|
|
|
int zsize;
|
2015-11-09 21:30:46 +00:00
|
|
|
Color *data;
|
2013-12-09 21:16:00 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // TEXTURE3D_H
|