/*
 * texture.h
 * Revision 4.0  91/07/17  14:44:19  kolb
 * Initial version.
 */
#ifndef TEXTURE_H
#define TEXTURE_H

#include "common.h" 
#include "geom.h"
#include "surface.h"
#include "mapping.h"
 
/*
 * Surface properties
 */
#define COLOR		0	/* AMBIENT, DIFFUSE, SPECULAR and BODY */
#define AMBIENT		1
#define DIFFUSE		2
#define SPECULAR	3
#define BODY		4
#define REFLECT		5
#define TRANSP		6
#define SPECPOW		7
#define BUMP		8
#define INDEX		9
 
#define TextPointToModel(p)	PointTransform(p, &model2text.itrans)
#define TextPointToPrim(p)	PointTransform(p, &prim2text.itrans)
#define TextPointToWorld(p)	PointTransform(p, &world2text.itrans)
#define TextRayToModel(p)	RayTransform(r, &model2text.itrans)
#define TextRayToPrim(r)	RayTransform(r, &prim2text.itrans)
#define TextRayToWorld(r)	RayTransform(r, &world2text.itrans)
#define TextNormToModel(n)	NormalTransform(n, &model2text.trans)
#define TextNormToPrim(n)	NormalTransform(n, &prim2text.trans)
#define TextNormToWorld(n)	NormalTransform(n, &world2text.trans)
 
#define ModelPointToText(p)	PointTransform(p, &model2text.trans)
#define ModelNormToText(n)	NormalTransform(n, &model2text.itrans)
#define ModelRayToText(r)	RayTransform(r, &model2text.trans)
 
typedef char *TextRef;
 
/*
 * Texture structure
 */
typedef struct Texture {
	TextRef data;			/* Texturing info */
	void	(*method)();		/* method */
	Trans	*trans;			/* transformation info */
	short	animtrans;		/* is the transformation animated? */
	struct Texture *next;		/* next in list */
} Texture;
 
extern Texture	*TextCreate(), *TextAppend();
extern void	DNoise3(), VfBm(), TextApply(), MakeBump(), Wrinkled();
extern Float	Noise3(), Noise2(), Chaos(), Marble(), fBm();
extern int	TileValue();
Color		*ColormapRead();
 
extern Trans	model2text, prim2text, world2text;
 
#endif /*TEXTURE_H*/
