+
+ static Colour GetColour(const CPURenderTarget & target, int64_t x, int64_t y)
+ {
+ int64_t index = 4*(x+y*target.w);
+ return Colour(Real(target.pixels[index+0])/Real(255),
+ Real(target.pixels[index+1])/Real(255),
+ Real(target.pixels[index+2])/Real(255),
+ Real(target.pixels[index+3])/Real(255));
+ }
+
+ static void SetColour(const CPURenderTarget & target, int64_t x, int64_t y, const Colour & c)
+ {
+ int64_t index = 4*(x+y*target.w);
+ target.pixels[index+0] = c.r*255;
+ target.pixels[index+1] = c.g*255;
+ target.pixels[index+2] = c.b*255;
+ target.pixels[index+3] = c.a*255;
+ }
+