From 66304f4faf5dbaacae16eb56fba9d7f228f18ffa Mon Sep 17 00:00:00 2001 From: David Date: Wed, 8 Mar 2017 10:33:33 -0600 Subject: [PATCH] added an addition operator to stim::image --- stim/image/image.h | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/stim/image/image.h b/stim/image/image.h index b359405..b001232 100644 --- a/stim/image/image.h +++ b/stim/image/image.h @@ -624,6 +624,15 @@ public: return result; } + //operator functions + image operator+(image rhs) { + size_t N = size(); //calculate the total number of values in the image + image r(X(), Y(), C()); //allocate space for the resulting image + for (size_t n = 0; n < N; n++) + r.img[n] = img[n] + rhs.img[n]; //perform the inversion + return r; //return the inverted image + } + image srgb2lab(){ std::cout<<"ERROR stim::image::srgb2lab - function has been broken, re-implement."<