7 #include "ResourceIO.h"
14 typedef unsigned short HeightData;
17 virtual unsigned int getValue(
int x,
int y) = 0;
19 virtual double getValue(
double x,
double y) = 0;
21 virtual double getValue(
double x,
double y,
double& filteredMinValue,
double& filteredMaxValue) = 0;
22 virtual void tileCoords(
double x,
double y,
unsigned int& xi,
unsigned int& yi,
unsigned int& sizeX,
unsigned int& sizeY) = 0;
29 static const int North = 0;
30 static const int West = 1;
31 static const int South = 2;
32 static const int East = 3;
39 void loadTiles(
char* filename,
int colorCount,
int tileSizeBits);
43 void init(
int sizeBits);
45 virtual unsigned int getValue(
int x,
int y)
override;
47 virtual double getValue(
double x,
double y)
override;
49 virtual double getValue(
double x,
double y,
double& filteredMinValue,
double& filteredMaxValue)
override;
50 virtual void tileCoords(
double x,
double y,
unsigned int& xi,
unsigned int& yi,
unsigned int& sizeX,
unsigned int& sizeY);
53 HeightData** tileData;
54 HeightData** tileDataMinFiltered;
55 HeightData** tileDataMaxFiltered;
63 unsigned int globalCoordMask;
64 unsigned int localCoordMask;
67 inline HeightData getTileValue(
int x,
int y);
68 inline HeightData getTileValue(
int x,
int y,
double& filteredMinValue,
double& filteredMaxValue);
78 static const int North = 0;
79 static const int West = 1;
80 static const int South = 2;
81 static const int East = 3;
83 typedef unsigned char HeightData;
86 void loadTiles(
const char* filename,
int colorCount,
int tileSizeBits);
90 void init(
int sizeBits);
92 void getValue(
double x,
double y,
double& channelA,
double& channelB);
95 HeightData** tileDataA;
96 HeightData** tileDataB;
106 unsigned int globalCoordMask;
107 unsigned int localCoordMask;
110 inline void getTileValue(
int x,
int y,
double& channelA,
double& channelB);
122 bool load(
const char* filename,
int size);
126 virtual unsigned int getValue(
int x,
int y)
override;
128 virtual double getValue(
double x,
double y)
override;
130 virtual double getValue(
double x,
double y,
double& filteredMinValue,
double& filteredMaxValue)
override;
131 virtual void tileCoords(
double x,
double y,
unsigned int& xi,
unsigned int& yi,
unsigned int& sizeX,
unsigned int& sizeY)
override;
virtual unsigned int getValue(int x, int y) override
Get value for a specific location.
Contains all classes and functions for the VoxelFarm engine.
void init(int sizeBits)
Initializes the tileboard.
bool load(const char *filename, int size)
Loads from disk.
virtual unsigned int getValue(int x, int y)=0
Get value for a specific location.
void loadTiles(const char *filename, int colorCount, int tileSizeBits)
Loads a tileset from disk.
Implement an aperiodic tiling set.
virtual unsigned int getValue(int x, int y) override
Get value for a specific location.
A tileset with matching corners and two data channels.
void loadTiles(char *filename, int colorCount, int tileSizeBits)
Loads a tileset from disk.
void init(int sizeBits)
Initializes the tileboard.
void getValue(double x, double y, double &channelA, double &channelB)
Get value for a specific location with floating point input.