// PhBTexture.H: PhBTexture nodes.

// This file has been generated using nodegen 0.5a.
// Restrict manual editing to the sections delimited by
// . the comments "utility includes" and "end of utility includes"
// . the comments "utility members" and "end of utility members"

#ifndef _PhBTexture_H_
#define _PhBTexture_H_

#include "xrml.H"

// utility includes
#include "vector.H"
// end of utility includes

namespace xrml {
#define PhBTextureTypeId 	"PhBTexture"
extern bool IsPhBTexture(SFNode*);

class PhBTexture: public virtual SFNode {
public:
  //
  virtual int major_version(void), minor_version(void);
  virtual bool is_leaf_class(void);
  
  PhBTexture();
  
  //
  virtual void     	render(void);
  
  // utility members
  virtual long nrChannels(void);
  virtual long width(void);
  virtual long height(void);
  virtual float *values(double u, double v, int *nrChannels);
  virtual void Dvalues(double u, double v, float *dX, float *dY, float *dZ);
  virtual float *filteredValues(const Vec2& uv, const Vec2& da, 
				const Vec2& db, int *nrChannels=NULL)
  {
    return values(uv.u, uv.v, nrChannels);
  }

  // texture dumping routine
  void DumpTexture(char *filename, long resx, long resy);
  void Dump(long resx, long resy, long w, long h);
  
protected:
  inline void util_init(void) { }
  inline void util_clone(const PhBTexture& src) { }
  inline void util_destruct(void) { }
};

// end of utility members
} // namespace xrml
#endif /*_PhBTexture_H_*/
