2012-12-13 21:33:42 +00:00
|
|
|
#ifndef _PAYSAGES_TOOLS_TEXTURE_H_
|
|
|
|
#define _PAYSAGES_TOOLS_TEXTURE_H_
|
|
|
|
|
2012-12-14 16:16:09 +00:00
|
|
|
/*
|
|
|
|
* Pixel based textures.
|
|
|
|
*/
|
|
|
|
|
2012-12-13 21:33:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "color.h"
|
|
|
|
#include "pack.h"
|
2012-12-13 21:33:42 +00:00
|
|
|
|
|
|
|
typedef struct Texture2D Texture2D;
|
|
|
|
typedef struct Texture3D Texture3D;
|
|
|
|
|
|
|
|
Texture2D* texture2DCreate(int xsize, int ysize);
|
|
|
|
void texture2DDelete(Texture2D* tex);
|
2012-12-14 16:16:09 +00:00
|
|
|
void texture2DGetSize(Texture2D* tex, int* xsize, int* ysize);
|
2012-12-13 21:33:42 +00:00
|
|
|
void texture2DSetPixel(Texture2D* tex, int x, int y, Color col);
|
|
|
|
Color texture2DGetPixel(Texture2D* tex, int x, int y);
|
|
|
|
Color texture2DGetNearest(Texture2D* tex, double dx, double dy);
|
|
|
|
Color texture2DGetLinear(Texture2D* tex, double dx, double dy);
|
|
|
|
Color texture2DGetCubic(Texture2D* tex, double dx, double dy);
|
2012-12-15 19:45:19 +00:00
|
|
|
void texture2DFill(Texture2D* tex, Color col);
|
|
|
|
void texture2DAdd(Texture2D* source, Texture2D* destination);
|
2012-12-24 11:24:27 +00:00
|
|
|
void texture2DSave(PackStream* stream, Texture2D* tex);
|
|
|
|
void texture2DLoad(PackStream* stream, Texture2D* tex);
|
2012-12-13 21:33:42 +00:00
|
|
|
void texture2DSaveToFile(Texture2D* tex, const char* filepath);
|
2012-12-14 16:16:09 +00:00
|
|
|
void texture2DLoadFromFile(Texture2D* tex, const char* filepath);
|
2012-12-13 21:33:42 +00:00
|
|
|
|
|
|
|
Texture3D* texture3DCreate(int xsize, int ysize, int zsize);
|
|
|
|
void texture3DDelete(Texture3D* tex);
|
2012-12-14 16:16:09 +00:00
|
|
|
void texture3DGetSize(Texture3D* tex, int* xsize, int* ysize, int* zsize);
|
2012-12-13 21:33:42 +00:00
|
|
|
void texture3DSetPixel(Texture3D* tex, int x, int y, int z, Color col);
|
|
|
|
Color texture3DGetPixel(Texture3D* tex, int x, int y, int z);
|
|
|
|
Color texture3DGetNearest(Texture3D* tex, double dx, double dy, double dz);
|
|
|
|
Color texture3DGetLinear(Texture3D* tex, double dx, double dy, double dz);
|
|
|
|
Color texture3DGetCubic(Texture3D* tex, double dx, double dy, double dz);
|
2012-12-15 19:45:19 +00:00
|
|
|
void texture3DFill(Texture3D* tex, Color col);
|
|
|
|
void texture3DAdd(Texture3D* source, Texture3D* destination);
|
2012-12-24 11:24:27 +00:00
|
|
|
void texture3DSave(PackStream* stream, Texture3D* tex);
|
|
|
|
void texture3DLoad(PackStream* stream, Texture3D* tex);
|
2012-12-13 21:33:42 +00:00
|
|
|
void texture3DSaveToFile(Texture3D* tex, const char* filepath);
|
2012-12-14 16:16:09 +00:00
|
|
|
void texture3DLoadFromFile(Texture3D* tex, const char* filepath);
|
2012-12-13 21:33:42 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|