diff --git a/stim/cuda/arraymath.cuh b/stim/cuda/arraymath.cuh index b5dcf20..449062d 100644 --- a/stim/cuda/arraymath.cuh +++ b/stim/cuda/arraymath.cuh @@ -1,6 +1,7 @@ #ifndef STIM_CUDA_ARRAYMATH_H #define STIM_CUDA_ARRAYMATH_H +#include #include #include #include diff --git a/stim/cuda/gaussian_blur.cuh b/stim/cuda/gaussian_blur.cuh index d510bf9..d2256d8 100644 --- a/stim/cuda/gaussian_blur.cuh +++ b/stim/cuda/gaussian_blur.cuh @@ -237,7 +237,7 @@ namespace stim{ cudaFree(gpuI0); } - } -} + }; +}; #endif \ No newline at end of file diff --git a/stim/image/image.h b/stim/image/image.h index 38278b8..0db4d91 100644 --- a/stim/image/image.h +++ b/stim/image/image.h @@ -7,6 +7,7 @@ #include #include + namespace stim{ //This static class provides the STIM interface for loading images // Use this interface for all image management - that way the actual library can be changed without problems @@ -83,12 +84,23 @@ public: //create a new image image single; - single.img = img.channel(c); + single.img = img.get_channel(c); return single; } + image getslice(unsigned int c){ + + //create a new image + image slice; + + slice.img = img.get_slice(c); + + return slice; + + } + unsigned int channels(){ return (unsigned int)img.spectrum(); } @@ -101,6 +113,10 @@ public: return img.height(); } + T* data(){ + return img.data(); + } + //returns the size (number of values) of the image unsigned long size(){ return img.size(); @@ -155,8 +171,61 @@ public: return s; //return the index list } + + /// Returns the maximum pixel value in the image + T max(){ + float max = 0; + unsigned long N = width() * height(); //get the number of pixels + + for (unsigned long i=0; i max) + { + max = img.data()[i]; + } + } + + return max; + } + /// Returns the minimum pixel value in the image + T min(){ + float min = 0; + unsigned long N = width() * height(); //get the number of pixels + + for (unsigned long i=0; i srgb2lab(){ + + image rgb; + rgb.img = img.get_sRGBtoRGB(); + + image lab; + lab.img = rgb.img.get_RGBtoLab(); + + return lab; + + } + + image convolve2(image mask){ + + image result; + + result.img = img.get_convolve(mask.img); + + return result; + } }; -- libgit2 0.21.4