X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fimage.h;h=3f3ba54094bb6caeab3cfd817ecf074f5c6b50bc;hb=HEAD;hp=d39e75026a13d9dedf2f1c236cb67996135e1bb1;hpb=77e44c5424bd5e6e7c6a706151fa786a56270e12;p=demo diff --git a/src/image.h b/src/image.h index d39e750..3f3ba54 100644 --- a/src/image.h +++ b/src/image.h @@ -1,11 +1,16 @@ #ifndef IMAGE_H_ #define IMAGE_H_ +#include + class Image { public: int w; int h; - unsigned char *pixels; + int psz; + + bool is_float; + void *pixels; Image(); ~Image(); @@ -21,6 +26,11 @@ public: Image &operator =(Image &&image); bool load(const char *fname); + + Vec4 get_pixel(int x, int y) const; + + Vec4 lookup_nearest(float u, float v) const; + Vec4 lookup_linear(float u, float v, float du, float dv) const; }; #endif // IMAGE_H_ \ No newline at end of file