|
16 | 16 | * You should have received a copy of the GNU General Public License
|
17 | 17 | * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
18 | 18 | */
|
| 19 | +#include <cassert> |
19 | 20 | #include <cmath>
|
20 | 21 | #include <cstdlib>
|
21 | 22 | #include <iostream>
|
@@ -743,6 +744,8 @@ void RawImageSource::getWBMults(const ColorTemp &ctemp, const RAWParams &raw, st
|
743 | 744 |
|
744 | 745 | void RawImageSource::getImage(const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw)
|
745 | 746 | {
|
| 747 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
| 748 | + |
746 | 749 | MyMutex::MyLock lock(getImageMutex);
|
747 | 750 |
|
748 | 751 | tran = defTransform(ri, tran);
|
@@ -1744,6 +1747,8 @@ void RawImageSource::preprocess(const RAWParams &raw, const LensProfParams &lens
|
1744 | 1747 |
|
1745 | 1748 | void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &contrastThreshold, bool cache)
|
1746 | 1749 | {
|
| 1750 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
| 1751 | + |
1747 | 1752 | MyTime t1, t2;
|
1748 | 1753 | t1.set();
|
1749 | 1754 |
|
@@ -3837,6 +3842,8 @@ void RawImageSource::hlRecovery(const std::string &method, float* red, float* gr
|
3837 | 3842 |
|
3838 | 3843 | void RawImageSource::getAutoExpHistogram(LUTu & histogram, int& histcompr)
|
3839 | 3844 | {
|
| 3845 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
| 3846 | + |
3840 | 3847 | // BENCHFUN
|
3841 | 3848 | histcompr = 3;
|
3842 | 3849 |
|
@@ -7481,6 +7488,8 @@ void RawImageSource::getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int
|
7481 | 7488 |
|
7482 | 7489 | void RawImageSource::getAutoWBMultipliersitc(bool extra, double & tempref, double & greenref, double & tempitc, double & greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double & rm, double & gm, double & bm, const WBParams & wbpar, const ColorManagementParams & cmp, const RAWParams & raw, const ToneCurveParams &hrp)
|
7483 | 7490 | {
|
| 7491 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
| 7492 | + |
7484 | 7493 | // BENCHFUN
|
7485 | 7494 | constexpr double clipHigh = 64000.0;
|
7486 | 7495 |
|
@@ -7710,6 +7719,8 @@ void RawImageSource::getAutoWBMultipliersitc(bool extra, double & tempref, doubl
|
7710 | 7719 |
|
7711 | 7720 | void RawImageSource::getAutoWBMultipliers(double &rm, double &gm, double &bm)
|
7712 | 7721 | {
|
| 7722 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
| 7723 | + |
7713 | 7724 | // BENCHFUN
|
7714 | 7725 | constexpr double clipHigh = 64000.0;
|
7715 | 7726 |
|
@@ -7926,6 +7937,7 @@ void RawImageSource::getAutoWBMultipliers(double &rm, double &gm, double &bm)
|
7926 | 7937 |
|
7927 | 7938 | ColorTemp RawImageSource::getSpotWB(std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal, StandardObserver observer)
|
7928 | 7939 | {
|
| 7940 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
7929 | 7941 |
|
7930 | 7942 | int x;
|
7931 | 7943 | int y;
|
@@ -8265,7 +8277,7 @@ void RawImageSource::init()
|
8265 | 8277 |
|
8266 | 8278 | void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int &B)
|
8267 | 8279 | {
|
8268 |
| - if (d1x) { // Nikon D1x has special sensor. We just skip it |
| 8280 | + if (rawData.getWidth() != W || rawData.getHeight() != H || d1x) { // Nikon D1x has special sensor. We just skip it |
8269 | 8281 | R = G = B = 0;
|
8270 | 8282 | return;
|
8271 | 8283 | }
|
@@ -8313,6 +8325,8 @@ bool RawImageSource::isGainMapSupported() const
|
8313 | 8325 |
|
8314 | 8326 | void RawImageSource::applyDngGainMap(const float black[4], const std::vector<GainMap> &gainMaps)
|
8315 | 8327 | {
|
| 8328 | + assert(rawData.getHeight() == H && rawData.getWidth() == W); |
| 8329 | + |
8316 | 8330 | // now we can apply each gain map to raw_data
|
8317 | 8331 | array2D<float> mvals[2][2];
|
8318 | 8332 |
|
|
0 commit comments