From b55312140b2e9fe6eac13888e15e4f6cc30d483c Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 26 Jul 2020 13:28:21 +0200 Subject: [PATCH] Fix wrong const usage --- rtengine/CA_correct_RT.cc | 6 +++--- rtengine/array2D.h | 4 ++-- rtengine/color.cc | 2 +- rtengine/color.h | 2 +- rtengine/ipdehaze.cc | 4 ++-- rtengine/rawimagesource.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index fa9788af0..c17826623 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -123,7 +123,7 @@ float* RawImageSource::CA_correct_RT( double cared, double cablue, bool avoidColourshift, - const array2D &rawData, + array2D &rawData, double* fitParamsTransfer, bool fitParamsIn, bool fitParamsOut, @@ -1291,7 +1291,7 @@ float* RawImageSource::CA_correct_RT( for (int i = 0; i < H - 2 * cb; ++i) { const int firstCol = fc(cfa, i, 0) & 1; const int colour = fc(cfa, i, firstCol); - const array2D* nonGreen = colour == 0 ? redFactor : blueFactor; + array2D* nonGreen = colour == 0 ? redFactor : blueFactor; int j = firstCol; #ifdef __SSE2__ for (; j < W - 7 - 2 * cb; j += 8) { @@ -1325,7 +1325,7 @@ float* RawImageSource::CA_correct_RT( const int ngRow = 1 - (fc(cfa, 0, 0) & 1); const int ngCol = fc(cfa, ngRow, 0) & 1; const int colour = fc(cfa, ngRow, ngCol); - const array2D* nonGreen = colour == 0 ? redFactor : blueFactor; + array2D* nonGreen = colour == 0 ? redFactor : blueFactor; for (int i = 0; i < (H + 1 - 2 * cb) / 2; ++i) { (*nonGreen)[i][(W - 2 * cb + 1) / 2 - 1] = (*nonGreen)[i][(W - 2* cb + 1) / 2 - 2]; } diff --git a/rtengine/array2D.h b/rtengine/array2D.h index de6381aeb..4b301383b 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -212,7 +212,7 @@ public: } // use with indices - T * operator[](int index) const + T * operator[](int index) { assert((index >= 0) && (index < y)); return ptr[index]; @@ -225,7 +225,7 @@ public: } // use as pointer to T** - operator const T* const *() + operator const T* const *() const { return ptr; } diff --git a/rtengine/color.cc b/rtengine/color.cc index 61009c81f..5761733f0 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -1772,7 +1772,7 @@ void Color::RGB2Lab(float *R, float *G, float *B, float *L, float *a, float *b, } } -void Color::RGB2L(float *R, float *G, float *B, float *L, const float wp[3][3], int width) +void Color::RGB2L(const float *R, const float *G, const float *B, float *L, const float wp[3][3], int width) { #ifdef __SSE2__ diff --git a/rtengine/color.h b/rtengine/color.h index 76edae6a1..704871d39 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -623,7 +623,7 @@ public: static void XYZ2Lab(float x, float y, float z, float &L, float &a, float &b); static void RGB2Lab(float *X, float *Y, float *Z, float *L, float *a, float *b, const float wp[3][3], int width); static void Lab2RGBLimit(float *L, float *a, float *b, float *R, float *G, float *B, const float wp[3][3], float limit, float afactor, float bfactor, int width); - static void RGB2L(float *X, float *Y, float *Z, float *L, const float wp[3][3], int width); + static void RGB2L(const float *R, const float *G, const float *B, float *L, const float wp[3][3], int width); /** * @brief Convert Lab in Yuv diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 7d715a9b0..4376808f8 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -103,7 +103,7 @@ void restore(Imagefloat *rgb, float maxval, bool multithread) } } -int get_dark_channel(const array2D &R, const array2D &G, const array2D &B, const array2D &dst, int patchsize, const float ambient[3], bool clip, bool multithread, float strength) +int get_dark_channel(const array2D &R, const array2D &G, const array2D &B, array2D &dst, int patchsize, const float ambient[3], bool clip, bool multithread, float strength) { const int W = R.width(); const int H = R.height(); @@ -162,7 +162,7 @@ int get_dark_channel(const array2D &R, const array2D &G, const arr return (W / patchsize + ((W % patchsize) > 0)) * (H / patchsize + ((H % patchsize) > 0)); } -int get_dark_channel_downsized(const array2D &R, const array2D &G, const array2D &B, const array2D &dst, int patchsize, bool multithread) +int get_dark_channel_downsized(const array2D &R, const array2D &G, const array2D &B, array2D &dst, int patchsize, bool multithread) { const int W = R.width(); const int H = R.height(); diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 3c19efd67..75aac923c 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -247,7 +247,7 @@ protected: double cared, double cablue, bool avoidColourshift, - const array2D &rawData, + array2D &rawData, double* fitParamsTransfer, bool fitParamsIn, bool fitParamsOut,