diff options
Diffstat (limited to 'rotord/src/cvimage.h')
| -rw-r--r-- | rotord/src/cvimage.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/rotord/src/cvimage.h b/rotord/src/cvimage.h index a0a2cf4..ee39edf 100644 --- a/rotord/src/cvimage.h +++ b/rotord/src/cvimage.h @@ -30,14 +30,20 @@ namespace Rotor { add=new uint8_t*[256]; multiply=new uint8_t*[256]; overlay=new uint8_t*[256]; + min=new uint8_t*[256]; + max=new uint8_t*[256]; for (int i=0;i<256;i++){ add[i]=new uint8_t[256]; multiply[i]=new uint8_t[256]; overlay[i]=new uint8_t[256]; + min[i]=new uint8_t[256]; + max[i]=new uint8_t[256]; for (int j=0;j<256;j++){ add[i][j]=(uint8_t)std::min(i+j,0xFF); multiply[i][j]=(uint8_t)(((float)i)*(((float)j)/255.0f)); overlay[i][j]=j<128?(uint8_t)((i*j)>>7):255-(((0xFF-i)*(0xFF-j))>>7); + min[i][j]=j<i?j:i; + max[i][j]=j>i?j:i; } } mono_weights=new uint8_t*[3]; @@ -54,10 +60,14 @@ namespace Rotor { delete[] add[i]; delete[] multiply[i]; delete[] overlay[i]; + delete[] min[i]; + delete[] max[i]; } delete[] add; delete[] multiply; delete[] overlay; + delete[] min; + delete[] max; for (int i=0;i<3;i++) { delete[] mono_weights[i]; } @@ -67,7 +77,8 @@ namespace Rotor { uint8_t **multiply; uint8_t **overlay; uint8_t **mono_weights; - + uint8_t **max; + uint8_t **min; }; static pixeltables pixels; class Image{ @@ -208,6 +219,8 @@ namespace Rotor { Image & add_wrap(const Image &other); Image & divide_wrap(const Image &other); Image & overlay(const Image &other); + Image & min(const Image &other); + Image & max(const Image &other); Image & operator*=(const float &amount); Image & operator+=(const float &amount); Image & operator-=(const float &amount); |
