merge with dev - I hope no error
This commit is contained in:
@@ -62,15 +62,15 @@ bool checkRawImageThumb (const rtengine::RawImage& raw_image)
|
||||
void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4], bool multiThread)
|
||||
{
|
||||
DCraw::dcrawImage_t image = ri->get_image();
|
||||
const int height = ri->get_iheight();
|
||||
const int width = ri->get_iwidth();
|
||||
const int top_margin = ri->get_topmargin();
|
||||
const int left_margin = ri->get_leftmargin();
|
||||
const int raw_width = ri->get_rawwidth();
|
||||
const bool isFloat = ri->isFloat();
|
||||
const float * const float_raw_image = ri->get_FloatRawImage();
|
||||
|
||||
if (ri->isBayer()) {
|
||||
const int height = ri->get_iheight();
|
||||
const int width = ri->get_iwidth();
|
||||
const bool isFloat = ri->isFloat();
|
||||
const int top_margin = ri->get_topmargin();
|
||||
const int left_margin = ri->get_leftmargin();
|
||||
const int raw_width = ri->get_rawwidth();
|
||||
const float * const float_raw_image = ri->get_FloatRawImage();
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for if(multiThread)
|
||||
#endif
|
||||
@@ -110,14 +110,6 @@ void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4],
|
||||
}
|
||||
}
|
||||
} else if (ri->isXtrans()) {
|
||||
const int height = ri->get_iheight();
|
||||
const int width = ri->get_iwidth();
|
||||
const bool isFloat = ri->isFloat();
|
||||
const int top_margin = ri->get_topmargin();
|
||||
const int left_margin = ri->get_leftmargin();
|
||||
const int raw_width = ri->get_rawwidth();
|
||||
const float * const float_raw_image = ri->get_FloatRawImage();
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for if(multiThread)
|
||||
#endif
|
||||
@@ -157,6 +149,20 @@ void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4],
|
||||
image[row * width + col][ccol] = rtengine::CLIP (val);
|
||||
}
|
||||
}
|
||||
} else if (isFloat) {
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for if(multiThread)
|
||||
#endif
|
||||
for (int row = 0; row < height; ++row) {
|
||||
for (int col = 0; col < width; ++col) {
|
||||
for (int i = 0; i < ri->get_colors(); ++i) {
|
||||
float val = float_raw_image[(row + top_margin) * raw_width + col + left_margin + i];
|
||||
val -= cblack[i];
|
||||
val *= scale_mul[i];
|
||||
image[row * width + col][i] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const int size = ri->get_iheight() * ri->get_iwidth();
|
||||
|
||||
@@ -574,6 +580,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
|
||||
tpp->camwbBlue = tpp->blueMultiplier / pre_mul[2]; //ri->get_pre_mul(2);
|
||||
//tpp->defGain = 1.0 / min(ri->get_pre_mul(0), ri->get_pre_mul(1), ri->get_pre_mul(2));
|
||||
tpp->defGain = max (scale_mul[0], scale_mul[1], scale_mul[2], scale_mul[3]) / min (scale_mul[0], scale_mul[1], scale_mul[2], scale_mul[3]);
|
||||
tpp->defGain *= std::pow(2, ri->getBaselineExposure());
|
||||
|
||||
tpp->gammaCorrected = true;
|
||||
|
||||
|
Reference in New Issue
Block a user