allow querying the bitmap texture underlying a 'Texture' object (if any)

metadata
Wenzel Jakob 2013-01-04 09:05:53 -05:00
parent ad6c15177a
commit fd85716e21
3 changed files with 8 additions and 0 deletions

View File

@ -74,6 +74,9 @@ public:
/// Serialize to a binary data stream
virtual void serialize(Stream *stream, InstanceManager *manager) const;
/// Return the underlying bitmap representation (if any)
virtual ref<Bitmap> getBitmap() const;
MTS_DECLARE_CLASS()
protected:
Texture(const Properties &props);

View File

@ -47,6 +47,7 @@ Spectrum Texture::getMinimum() const { NotImplementedError("getMinimum"); }
Spectrum Texture::getMaximum() const { NotImplementedError("getMaximum"); }
bool Texture::isConstant() const { NotImplementedError("isConstant"); }
bool Texture::usesRayDifferentials() const { NotImplementedError("usesRayDifferentials"); }
ref<Bitmap> Texture::getBitmap() const { return NULL; }
ref<Texture> Texture::expand() {
return this;

View File

@ -400,6 +400,10 @@ public:
return result;
}
ref<Bitmap> getBitmap() const {
return m_mipmap1.get() ? m_mipmap1->toBitmap() : m_mipmap3->toBitmap();
}
Spectrum eval(const Point2 &uv, const Vector2 &d0, const Vector2 &d1) const {
stats::filteredLookups.incrementBase();
++stats::filteredLookups;