"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "rtengine/rtthumbnail.cc" between
rawtherapee-5.6.tar.xz and rawtherapee-5.7.tar.xz

About: RawTherapee is a powerful cross-platform raw image processing program.

rtthumbnail.cc  (rawtherapee-5.6.tar.xz):rtthumbnail.cc  (rawtherapee-5.7.tar.xz)
skipping to change at line 17 skipping to change at line 17
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* RawTherapee is distributed in the hope that it will be useful, * RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "rtengine.h" #include "rtengine.h"
#include "rtthumbnail.h" #include "rtthumbnail.h"
#include "../rtgui/options.h" #include "../rtgui/options.h"
#include "image8.h" #include "image8.h"
#include <lcms2.h> #include <lcms2.h>
#include "curves.h" #include "curves.h"
#include <glibmm.h> #include <glibmm.h>
#include "improcfun.h" #include "improcfun.h"
#include "colortemp.h" #include "colortemp.h"
skipping to change at line 548 skipping to change at line 548
unsigned int tempImageNum = 0; unsigned int tempImageNum = 0;
int r = ri->loadRaw (1, tempImageNum, 0); int r = ri->loadRaw (1, tempImageNum, 0);
if ( r ) { if ( r ) {
delete ri; delete ri;
sensorType = ST_NONE; sensorType = ST_NONE;
return nullptr; return nullptr;
} }
if (ri->getFrameCount() == 7) {
// special case for Hasselblad H6D-100cMS pixelshift files
// first frame is not bayer, load second frame
int r = ri->loadRaw (1, 1, 0);
if ( r ) {
delete ri;
sensorType = ST_NONE;
return nullptr;
}
}
sensorType = ri->getSensorType(); sensorType = ri->getSensorType();
int width = ri->get_width(); int width = ri->get_width();
int height = ri->get_height(); int height = ri->get_height();
rtengine::Thumbnail* tpp = new rtengine::Thumbnail; rtengine::Thumbnail* tpp = new rtengine::Thumbnail;
tpp->isRaw = true; tpp->isRaw = true;
tpp->embProfile = nullptr; tpp->embProfile = nullptr;
tpp->embProfileData = nullptr; tpp->embProfileData = nullptr;
tpp->embProfileLength = ri->get_profileLen(); tpp->embProfileLength = ri->get_profileLen();
skipping to change at line 715 skipping to change at line 726
} }
} else { } else {
int iwidth = ri->get_iwidth(); int iwidth = ri->get_iwidth();
int iheight = ri->get_iheight(); int iheight = ri->get_iheight();
int left_margin = ri->get_leftmargin(); int left_margin = ri->get_leftmargin();
firstgreen += left_margin; firstgreen += left_margin;
int top_margin = ri->get_topmargin(); int top_margin = ri->get_topmargin();
int wmax = tmpw; int wmax = tmpw;
int hmax = tmph; int hmax = tmph;
if (ri->get_maker() == "Sigma" && ri->DNGVERSION()) { // Hack to pre vent sigma dng files from crashing if ((ri->get_maker() == "Sigma" || ri->get_maker() == "Pentax" || ri ->get_maker() == "Sony") && ri->DNGVERSION()) { // Hack to prevent sigma dng fil es from crashing
wmax = (width - 2 - left_margin) / hskip; wmax = (width - 2 - left_margin) / hskip;
hmax = (height - 2 - top_margin) / vskip; hmax = (height - 2 - top_margin) / vskip;
} }
int y = 0; int y = 0;
for (int row = 1 + top_margin; row < iheight + top_margin - 1 && y < hmax; row += vskip, y++) { for (int row = 1 + top_margin; row < iheight + top_margin - 1 && y < hmax; row += vskip, y++) {
rofs = row * iwidth; rofs = row * iwidth;
int x = 0; int x = 0;
skipping to change at line 1166 skipping to change at line 1177
if (params.coarse.rotate == 90 || params.coarse.rotate == 270) { if (params.coarse.rotate == 90 || params.coarse.rotate == 270) {
rwidth = rheight; rwidth = rheight;
rheight = int (size_t (thumbImg->getHeight()) * size_t (rwidth) / size_t (thumbImg->getWidth())); rheight = int (size_t (thumbImg->getHeight()) * size_t (rwidth) / size_t (thumbImg->getWidth()));
} else { } else {
rwidth = int (size_t (thumbImg->getWidth()) * size_t (rheight) / size_t (thumbImg->getHeight())); rwidth = int (size_t (thumbImg->getWidth()) * size_t (rheight) / size_t (thumbImg->getHeight()));
} }
Imagefloat* baseImg = resizeTo<Imagefloat> (rwidth, rheight, interp, thumbIm g); Imagefloat* baseImg = resizeTo<Imagefloat> (rwidth, rheight, interp, thumbIm g);
if (isRaw && params.filmNegative.enabled) {
processFilmNegative(params, baseImg, rwidth, rheight, rmi, gmi, bmi);
}
if (params.coarse.rotate) { if (params.coarse.rotate) {
baseImg->rotate (params.coarse.rotate); baseImg->rotate (params.coarse.rotate);
rwidth = baseImg->getWidth(); rwidth = baseImg->getWidth();
rheight = baseImg->getHeight(); rheight = baseImg->getHeight();
} }
if (params.coarse.hflip) { if (params.coarse.hflip) {
baseImg->hflip (); baseImg->hflip ();
} }
skipping to change at line 1473 skipping to change at line 1488
delete baseImg; delete baseImg;
// calculate scale // calculate scale
if (params.coarse.rotate == 90 || params.coarse.rotate == 270) { if (params.coarse.rotate == 90 || params.coarse.rotate == 270) {
myscale = scale * thumbImg->getWidth() / fh; myscale = scale * thumbImg->getWidth() / fh;
} else { } else {
myscale = scale * thumbImg->getHeight() / fh; myscale = scale * thumbImg->getHeight() / fh;
} }
myscale = 1.0 / myscale; myscale = 1.0 / myscale;
/* // apply crop // apply crop
if (params.crop.enabled) { if (params.crop.enabled) {
int ix = 0; int ix = 0;
for (int i=0; i<fh; i++) for (int i = 0; i < fh; ++i) {
for (int j=0; j<fw; j++) for (int j = 0; j < fw; ++j) {
if (i<params.crop.y/myscale || i>(params.crop.y+params.crop. if (i < params.crop.y * myscale || i > (params.crop.y + params.c
h)/myscale || j<params.crop.x/myscale || j>(params.crop.x+params.crop.w)/myscale rop.h) * myscale || j < params.crop.x * myscale || j > (params.crop.x + params.c
) { rop.w) * myscale) {
readyImg->data[ix++] /= 3; readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3; readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3; readyImg->data[ix++] /= 3;
} } else {
else ix += 3;
ix += 3; }
}*/ }
}
}
return readyImg; return readyImg;
} }
int Thumbnail::getImageWidth (const procparams::ProcParams& params, int rheight, float &ratio) int Thumbnail::getImageWidth (const procparams::ProcParams& params, int rheight, float &ratio)
{ {
if (!thumbImg) { if (!thumbImg) {
return 0; // Can happen if thumb is just building and GUI comes in wi th resize wishes return 0; // Can happen if thumb is just building and GUI comes in wi th resize wishes
} }
 End of changes. 5 change blocks. 
17 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)