X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=image.hpp;h=5a9704eb821b9fba736e9c00233b1b0996df2aea;hb=b3733a82424232f601867ee20311d7d4242ef1a9;hp=190b093adc1ea9e9ab136ccc29040545a2e53de7;hpb=0a91a3e83760539edc00b80cfb4338c95dfdedf2;p=apitrace diff --git a/image.hpp b/image.hpp index 190b093..5a9704e 100644 --- a/image.hpp +++ b/image.hpp @@ -59,11 +59,29 @@ public: delete [] pixels; } + inline unsigned char *start(void) { + return flipped ? pixels + (height - 1)*width*4 : pixels; + } + + inline unsigned char *end(void) { + return flipped ? pixels - width*4 : pixels + height*width*4; + } + + inline signed stride(void) const { + return flipped ? -width*4 : width*4; + } + bool writeBMP(const char *filename) const; bool writePNG(const char *filename) const; + + double compare(Image &ref); }; +Image * +readPNG(const char *filename); + + } /* namespace Image */