diff --git a/doc/manpage/rawtherapee.1 b/doc/manpage/rawtherapee.1 index a626fd0bf..bbd2a4f44 100644 --- a/doc/manpage/rawtherapee.1 +++ b/doc/manpage/rawtherapee.1 @@ -1,86 +1,67 @@ -.TH RAWTHERAPEE 1 "July 31, 2012" +.TH RAWTHERAPEE 1 "July 05, 2016" .SH NAME -rawtherapee \- an advanced cross-platform program for developing raw photos. -.SH SYNOPSIS -\fBrawtherapee\fP [directory|image\-file] -.br -\fBrawtherapee\fP [\-o|\-O ] [\-s|\-S] [\-p ] [\-d] -[\-j[1\-100]|\-t|\-t1|\-n] [\-Y] \-c +RawTherapee - An advanced, cross-platform program for developing raw photos. .SH DESCRIPTION -\fBRawTherapee\fP is an advanced program for developing raw photos and for -processing non-raw photos. It is non-destructive, makes use of OpenMP, supports -all the cameras supported by dcraw and carries out its calculations in a high -precision 32bit floating point engine. +\fBRawTherapee\fP is an advanced program for developing raw photos and for processing non-raw photos. It is non-destructive, makes use of OpenMP, supports all the cameras supported by dcraw and more, and carries out its calculations in a high precision 32-bit floating point engine. +.SH LINKS + Website: http://www.rawtherapee.com/ + Documentation: http://rawpedia.rawtherapee.com/ + Forum: https://discuss.pixls.us/c/software/rawtherapee + Code and bug reports: https://github.com/Beep6581/RawTherapee +.SH SYMBOLS + indicate parameters you can change. + [Square brackets] mean the parameter is optional. + The pipe symbol | indicates a choice of one or the other. + The dash symbol - denotes a range of possible values from one to the other. +.SH SYNOPSIS + rawtherapee Start File Browser inside folder. + rawtherapee Start Image Editor with file. + rawtherapee -c | Convert files in batch with default parameters. + rawtherapee -c | Convert files in batch with your own settings. + rawtherapee [-o |-O ] [-s|-S] [-p [-p ...] ] [-d] [ -j[1-100] [-js<1-3>] | [-b<8|16>] [-t[z] | [-n]] ] [-Y] -c .SH OPTIONS -.TP -\-o | -select output directory. -.TP -\-O | - select output directory and copy the PP3 file into it. -.TP -\-s -use the PP3 processing profile located next to the input file (which shares -same name as the input file) when building the processing parameters, e.g.: for -IMG001.NEF there should be a IMG001.NEF.pp3 in the same directory. If such a -file is not found, the default values are used. -.TP -\-S -like \-s but skip processing that image if its corresponding PP3 file is not -found. -.TP -\-p -specify a PP3 processing profile to be used for all conversions. You can -specify as many \-p options as you like (see note below). -.TP -\-d -use the default raw or non-raw PP3 file to build the image's parameters -(specified in the options file). -.TP -\-j[1\-100] -specify output to be JPEG (default). The compression value can be in the range -1-100. If none was specified, the default compression value is 90, balanced -subsampling (4:2:2). -.TP -\-t -specify output to be uncompressed 8 bit per channel TIFF. -.TP -\-t1 -specify output to be zip-compressed 8 bit per channel TIFF. -.TP -\-n -specify output to be 8 bit per channel PNG with a compression value of 6. -.TP -\-Y -overwrite output if present. + -c Specify one or more input files. + -c must be the last option. + -o | Set output file or folder. + Saves output file alongside input file if -o is not specified. + -O | Set output file or folder and copy pp3 file into it. + Saves output file alongside input file if -O is not specified. + -s Use the existing sidecar file to build the processing parameters, + e.g. for photo.raw there should be a photo.raw.pp3 file in the same folder. + If the sidecar file does not exist, neutral values will be used. + -S Like -s but skip if the sidecar file does not exist. + -p Specify processing profile to be used for all conversions. + You can specify as many sets of "-p " options as you like, + each will be built on top of the previous one, as explained below. + -d Use the default raw or non-raw processing profile as set in + Preferences > Image Processing > Default Processing Profile + -j[1-100] Specify output to be JPEG (default, if -t and -n are not set). + Optionally, specify compression 1-100 (default value: 92). + -js<1-3> Specify the JPEG chroma subsampling parameter, where: + 1 = Best compression: 2x2, 1x1, 1x1 (4:2:0) + Chroma halved vertically and horizontally. + 2 = Balanced (default): 2x1, 1x1, 1x1 (4:2:2) + Chroma halved horizontally. + 3 = Best quality: 1x1, 1x1, 1x1 (4:4:4) + No chroma subsampling. + -b<8|16> Specify bit depth per channel (default value: 16 for TIFF, 8 for PNG). + Only applies to TIFF and PNG output, JPEG is always 8. + -t[z] Specify output to be TIFF. + Uncompressed by default, or deflate compression with 'z'. + -n Specify output to be compressed PNG. + Compression is hard-coded to 6. + -Y Overwrite output if present. -.P -.B Note: -.br -You can use partial PP3 files, in which case RawTherapee will set the -missing values as follows: -.br - The PP3 file is first built with internal default values; -.br - then overridden by those found in the "default raw" or "default non-raw" photo -profile (if \-d has been set); -.br - then overridden by those found in the PP3 files provided by \-p, each one -overriding the previous values; -.br - then overridden by the sidecar file if \-s is set and if the file exists; -.br - the time when the sidecar file is used depends of the position of the \-s -switch in the command line relative to the \-p parameters -(e.g. "\-p first.pp3 \-p second.pp3 \-s \-p fourth.pp3"). -.SH SEE ALSO -You can find the documentation, including a detailed user manual, on the -project's website: -http://rawtherapee.com/blog/documentation +Your pp3 files can be incomplete, RawTherapee will build the final values as follows: + 1- A new processing profile is created using neutral values, + 2- If the "-d" option is set, the values are overridden by those found in + the default raw or non-raw processing profile. + 3- If one or more "-p" options are set, the values are overridden by those + found in these processing profiles. + 4- If the "-s" or "-S" options are set, the values are finally overridden by those + found in the sidecar files. + The processing profiles are processed in the order specified on the command line. .SH AUTHOR -\fBRawTherapee\fP was originally written by Gabor Horvath of Budapest, -Hungary, before being relicensed as free and open-source software in January -2010 and being maintained by a team of people since. +\fBRawTherapee\fP was originally written by Gabor Horvath of Budapest, Hungary, before being re-licensed as free and open-source software in January 2010. .br -The RawTherapee Development Team comprises of passionate people from all around -the world. +The RawTherapee development team comprises of passionate people from all around the world. diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index 8290fe085..c7a6412be 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -428,7 +428,7 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float std::map::iterator best_it = mLevels[bw].begin(); if (iso > 0) { - for (it = mLevels[bw].begin(); it != mLevels[bw].end(); it++) { + for (it = mLevels[bw].begin(); it != mLevels[bw].end(); ++it) { if (abs(it->first - iso) <= abs(best_it->first - iso)) { best_it = it; } else { @@ -487,7 +487,7 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float if (it == mApertureScaling.end()) { std::map::reverse_iterator it; - for (it = mApertureScaling.rbegin(); it != mApertureScaling.rend(); it++) { + for (it = mApertureScaling.rbegin(); it != mApertureScaling.rend(); ++it) { if (it->first > fnumber) { scaling = it->second; } else { @@ -550,7 +550,8 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_) return false; } - size_t bufsize = 4096; + size_t bufsize = 16384; + size_t increment = 2 * bufsize; size_t datasize = 0, ret; char *buf = (char *)malloc(bufsize); @@ -558,8 +559,9 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_) datasize += ret; if (datasize == bufsize) { - bufsize += 4096; + bufsize += increment; buf = (char *)realloc(buf, bufsize); + increment *= 2; } } @@ -571,7 +573,11 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_) } fclose(stream); - buf = (char *)realloc(buf, datasize + 1); + + if(datasize == bufsize) { + buf = (char *)realloc(buf, datasize + 1); + } + buf[datasize] = '\0'; // remove comments @@ -637,18 +643,16 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_) Glib::ustring make_model(ji->valuestring); make_model = make_model.uppercase(); - std::map::iterator existingccIter = mCameraConstants.find(make_model); - if (existingccIter == mCameraConstants.end()) { - // add the new CamConst to the map - mCameraConstants.insert(std::pair(make_model, cc)); + const auto ret = mCameraConstants.emplace(make_model, cc); + if(ret.second) { // entry inserted into map if (settings->verbose) { printf("Add camera constants for \"%s\"\n", make_model.c_str()); } } else { // The CameraConst already exist for this camera make/model -> we merge the values - CameraConst *existingcc = existingccIter->second; + CameraConst *existingcc = ret.first->second; // updating the dcraw matrix existingcc->update_dcrawMatrix(cc->get_dcrawMatrix()); diff --git a/rtengine/color.cc b/rtengine/color.cc index c5874d110..c822a6f33 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -1361,12 +1361,10 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg float bal, balH, cal, calH, calm; bal = balH = balance; cal = calH = calm = 1.f - chromat; - float med = (iphigh + iplow) / 2.f; - float medH = (iphigh + iplow) / 2.f; + float med = 1.f; + float medH = 0.f; float medL = (iphigh + iplow) / 2.f; - med = 1.f; - medH = 0.f; //new algo for 2 colors float calan; calan = chromat; diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index c99e4bd41..8d3847e79 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -114,9 +114,8 @@ void ColorTemp::clip (double &temp, double &green, double &equal) } } -ColorTemp::ColorTemp (double mulr, double mulg, double mulb, double e) : equal(e) +ColorTemp::ColorTemp (double mulr, double mulg, double mulb, double e) : equal(e), method("Custom") { - method = "Custom"; mul2temp (mulr, mulg, mulb, equal, temp, green); } diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index bae38b193..47bfd40a7 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -895,6 +895,7 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) void CLASS lossless_jpeg_load_raw() { struct jhead jh; + int row=0, col=0; if (!ljpeg_start (&jh, 0)) return; int jwide = jh.wide * jh.clrs; @@ -917,8 +918,6 @@ void CLASS lossless_jpeg_load_raw() #pragma omp section #endif { - int row=0, col=0; - if (load_flags & 1) row = jrow & 1 ? height-1-jrow/2 : jrow/2; for (int jcol=0; jcol < jwide; jcol++) { diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch index baa0af282..5259c6b67 100644 --- a/rtengine/dcraw.patch +++ b/rtengine/dcraw.patch @@ -1,5 +1,5 @@ ---- dcraw.c 2016-06-24 11:50:34 +0000 -+++ dcraw.cc 2016-06-24 12:40:36 +0000 +--- dcraw.c 2016-06-29 12:25:09 +0000 ++++ dcraw.cc 2016-07-06 12:30:27 +0000 @@ -1,3 +1,16 @@ +/*RT*/#include +/*RT*/#include @@ -275,16 +275,20 @@ if (c <= jh->sraw) spred = **row; row[0]++; row[1]++; } -@@ -928,22 +894,39 @@ +@@ -928,22 +894,38 @@ void CLASS lossless_jpeg_load_raw() { - int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0; struct jhead jh; - ushort *rp; ++ int row=0, col=0; if (!ljpeg_start (&jh, 0)) return; - jwide = jh.wide * jh.clrs; +- +- for (jrow=0; jrow < jh.high; jrow++) { +- rp = ljpeg_row (jrow, &jh); + int jwide = jh.wide * jh.clrs; + ushort *rp[2]; + rp[0] = ljpeg_row (0, &jh); @@ -305,10 +309,6 @@ + #pragma omp section +#endif + { -+ int row=0, col=0; - -- for (jrow=0; jrow < jh.high; jrow++) { -- rp = ljpeg_row (jrow, &jh); if (load_flags & 1) row = jrow & 1 ? height-1-jrow/2 : jrow/2; - for (jcol=0; jcol < jwide; jcol++) { @@ -324,7 +324,7 @@ if ((j = i >= cr2_slice[0])) i = cr2_slice[0]; jidx -= i * (cr2_slice[1]*raw_height); -@@ -956,6 +939,8 @@ +@@ -956,6 +938,8 @@ if (++col >= raw_width) col = (row++,0); } @@ -333,7 +333,7 @@ } ljpeg_end (&jh); } -@@ -1124,8 +1109,7 @@ +@@ -1124,8 +1108,7 @@ if (++col >= tile_width || col >= raw_width) row += 1 + (col = 0); } @@ -343,7 +343,7 @@ fseek (ifp, save+4, SEEK_SET); if ((tcol += tile_width) >= raw_width) trow += tile_length + (tcol = 0); -@@ -1332,14 +1316,14 @@ +@@ -1332,14 +1315,14 @@ int i, nz; char tail[424]; @@ -360,7 +360,7 @@ void CLASS ppm_thumb() { -@@ -1701,10 +1685,10 @@ +@@ -1701,10 +1684,10 @@ } } @@ -374,7 +374,7 @@ unsigned c; if (nbits == -1) -@@ -1779,6 +1763,338 @@ +@@ -1779,6 +1762,338 @@ maximum = 0xfffc - ph1.black; } @@ -713,7 +713,7 @@ void CLASS hasselblad_load_raw() { struct jhead jh; -@@ -2002,10 +2318,10 @@ +@@ -2002,10 +2317,10 @@ maximum = curve[0x3ff]; } @@ -727,7 +727,7 @@ int byte; if (!nbits) return vbits=0; -@@ -2188,7 +2504,7 @@ +@@ -2188,7 +2503,7 @@ void CLASS kodak_radc_load_raw() { @@ -736,7 +736,7 @@ 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, -@@ -2294,11 +2610,11 @@ +@@ -2294,11 +2609,11 @@ METHODDEF(boolean) fill_input_buffer (j_decompress_ptr cinfo) { @@ -750,7 +750,7 @@ cinfo->src->next_input_byte = jpeg_buffer; cinfo->src->bytes_in_buffer = nbytes; return TRUE; -@@ -2648,10 +2964,9 @@ +@@ -2648,10 +2963,9 @@ maximum = (1 << (thumb_misc & 31)) - 1; } @@ -763,7 +763,7 @@ if (start) { for (p=0; p < 4; p++) pad[p] = key = key * 48828125 + 1; -@@ -2736,11 +3051,13 @@ +@@ -2736,11 +3050,13 @@ bit += 7; } for (i=0; i < 16; i++, col+=2) @@ -778,7 +778,7 @@ } void CLASS samsung_load_raw() -@@ -3038,7 +3355,7 @@ +@@ -3038,7 +3354,7 @@ void CLASS foveon_decoder (unsigned size, unsigned code) { @@ -787,7 +787,7 @@ struct decode *cur; int i, len; -@@ -3135,7 +3452,7 @@ +@@ -3135,7 +3451,7 @@ pred[c] += diff[dindex->leaf]; if (pred[c] >> 16 && ~pred[c] >> 16) derror(); } @@ -796,7 +796,7 @@ } } } -@@ -3746,6 +4063,8 @@ +@@ -3746,6 +4062,8 @@ if (load_raw == &CLASS phase_one_load_raw || load_raw == &CLASS phase_one_load_raw_c) phase_one_correct(); @@ -805,7 +805,7 @@ if (fuji_width) { for (row=0; row < raw_height-top_margin*2; row++) { for (col=0; col < fuji_width << !fuji_layout; col++) { -@@ -3761,10 +4080,13 @@ +@@ -3761,10 +4079,13 @@ } } } else { @@ -821,7 +821,7 @@ if (mask[0][3] > 0) goto mask_set; if (load_raw == &CLASS canon_load_raw || load_raw == &CLASS lossless_jpeg_load_raw) { -@@ -4366,239 +4688,8 @@ +@@ -4366,239 +4687,8 @@ } } @@ -1062,7 +1062,7 @@ void CLASS cielab (ushort rgb[3], short lab[3]) { -@@ -4864,112 +4955,7 @@ +@@ -4864,112 +4954,7 @@ } #undef fcol @@ -1175,7 +1175,7 @@ #undef TS void CLASS median_filter() -@@ -5139,7 +5125,7 @@ +@@ -5139,7 +5124,7 @@ } } @@ -1184,7 +1184,7 @@ void CLASS parse_makernote (int base, int uptag) { -@@ -5244,6 +5230,11 @@ +@@ -5244,6 +5229,11 @@ tag |= uptag << 16; if (tag == 2 && strstr(make,"NIKON") && !iso_speed) iso_speed = (get2(),get2()); @@ -1196,7 +1196,7 @@ if (tag == 4 && len > 26 && len < 35) { if ((i=(get4(),get2())) != 0x7fff && !iso_speed) iso_speed = 50 * pow (2, i/32.0 - 4); -@@ -5296,12 +5287,16 @@ +@@ -5296,12 +5286,16 @@ cam_mul[2] = get4() << 2; } } @@ -1214,7 +1214,7 @@ if (tag == 0x1d) while ((c = fgetc(ifp)) && c != EOF) serial = serial*10 + (isdigit(c) ? c - '0' : c % 10); -@@ -5491,14 +5486,14 @@ +@@ -5491,14 +5485,14 @@ while (entries--) { tiff_get (base, &tag, &type, &len, &save); switch (tag) { @@ -1232,7 +1232,7 @@ shutter = pow (2, expo); break; case 37378: aperture = pow (2, getreal(type)/2); break; case 37386: focal_len = getreal(type); break; -@@ -5667,28 +5662,33 @@ +@@ -5667,28 +5661,33 @@ } } @@ -1272,7 +1272,7 @@ entries = get2(); if (entries > 512) return 1; while (entries--) { -@@ -5758,7 +5758,8 @@ +@@ -5758,7 +5757,8 @@ fgets (make, 64, ifp); break; case 272: /* Model */ @@ -1282,7 +1282,7 @@ break; case 280: /* Panasonic RW2 offset */ if (type != 4) break; -@@ -5818,6 +5819,9 @@ +@@ -5818,6 +5818,9 @@ case 315: /* Artist */ fread (artist, 64, 1, ifp); break; @@ -1292,7 +1292,7 @@ case 322: /* TileWidth */ tiff_ifd[ifd].tile_width = getint(type); break; -@@ -5833,6 +5837,9 @@ +@@ -5833,6 +5836,9 @@ is_raw = 5; } break; @@ -1302,7 +1302,7 @@ case 330: /* SubIFDs */ if (!strcmp(model,"DSLR-A100") && tiff_ifd[ifd].width == 3872) { load_raw = &CLASS sony_arw_load_raw; -@@ -5846,6 +5853,9 @@ +@@ -5846,6 +5852,9 @@ fseek (ifp, i+4, SEEK_SET); } break; @@ -1312,7 +1312,7 @@ case 400: strcpy (make, "Sarnoff"); maximum = 0xfff; -@@ -6063,12 +6073,21 @@ +@@ -6063,12 +6072,21 @@ case 61450: cblack[4] = cblack[5] = MIN(sqrt(len),64); case 50714: /* BlackLevel */ @@ -1340,7 +1340,7 @@ case 50715: /* BlackLevelDeltaH */ case 50716: /* BlackLevelDeltaV */ for (num=i=0; i < (len & 0xffff); i++) -@@ -6085,13 +6104,13 @@ +@@ -6085,13 +6103,13 @@ case 50721: /* ColorMatrix1 */ case 50722: /* ColorMatrix2 */ FORCC for (j=0; j < 3; j++) @@ -1356,7 +1356,7 @@ break; case 50727: /* AnalogBalance */ FORCC ab[c] = getreal(type); -@@ -6114,6 +6133,11 @@ +@@ -6114,6 +6132,11 @@ case 50752: read_shorts (cr2_slice, 3); break; @@ -1368,7 +1368,7 @@ case 50829: /* ActiveArea */ top_margin = getint(type); left_margin = getint(type); -@@ -6146,21 +6170,27 @@ +@@ -6146,21 +6169,27 @@ fread (buf, sony_length, 1, ifp); sony_decrypt (buf, sony_length/4, 1, sony_key); sfp = ifp; @@ -1404,7 +1404,7 @@ cam_xyz_coeff (cmatrix, cam_xyz); } if (asn[0]) { -@@ -6168,13 +6198,14 @@ +@@ -6168,13 +6197,14 @@ FORCC cam_mul[c] = 1 / asn[c]; } if (!use_cm) @@ -1420,7 +1420,7 @@ fseek (ifp, base, SEEK_SET); order = get2(); -@@ -6206,6 +6237,7 @@ +@@ -6206,6 +6236,7 @@ shutter = tiff_ifd[i].shutter; tiff_ifd[i].shutter = shutter; } @@ -1428,7 +1428,7 @@ for (i=0; i < tiff_nifds; i++) { if (max_samp < tiff_ifd[i].samples) max_samp = tiff_ifd[i].samples; -@@ -6266,7 +6298,12 @@ +@@ -6266,7 +6297,12 @@ case 8: load_raw = &CLASS eight_bit_load_raw; break; case 12: if (tiff_ifd[raw].phint == 2) load_flags = 6; @@ -1442,7 +1442,7 @@ case 14: load_flags = 0; case 16: load_raw = &CLASS unpacked_load_raw; if (!strncmp(make,"OLYMPUS",7) && -@@ -6305,6 +6342,7 @@ +@@ -6305,6 +6341,7 @@ case 32803: load_raw = &CLASS kodak_65000_load_raw; } case 32867: case 34892: break; @@ -1450,7 +1450,7 @@ default: is_raw = 0; } if (!dng_version) -@@ -6390,7 +6428,7 @@ +@@ -6390,7 +6427,7 @@ { const char *file, *ext; char *jname, *jfile, *jext; @@ -1459,7 +1459,7 @@ ext = strrchr (ifname, '.'); file = strrchr (ifname, '/'); -@@ -6412,13 +6450,14 @@ +@@ -6412,13 +6449,14 @@ } else while (isdigit(*--jext)) { if (*jext != '9') { @@ -1476,7 +1476,7 @@ if (verbose) fprintf (stderr,_("Reading metadata from %s ...\n"), jname); parse_tiff (12); -@@ -6693,6 +6732,7 @@ +@@ -6693,6 +6731,7 @@ load_raw = ph1.format < 3 ? &CLASS phase_one_load_raw : &CLASS phase_one_load_raw_c; maximum = 0xffff; @@ -1484,7 +1484,7 @@ strcpy (make, "Phase One"); if (model[0]) return; switch (raw_height) { -@@ -6761,7 +6801,11 @@ +@@ -6761,7 +6800,11 @@ order = get2(); hlen = get4(); if (get4() == 0x48454150) /* "HEAP" */ @@ -1496,7 +1496,7 @@ if (parse_tiff (save+6)) apply_tiff(); fseek (ifp, save+len, SEEK_SET); } -@@ -7033,7 +7077,8 @@ +@@ -7033,7 +7076,8 @@ { static const struct { const char *prefix; @@ -1506,7 +1506,7 @@ } table[] = { { "AgfaPhoto DC-833m", 0, 0, /* DJC */ { 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } }, -@@ -7977,12 +8022,12 @@ +@@ -7977,12 +8021,12 @@ { 6596,-2079,-562,-4782,13016,1933,-970,1581,5181 } }, { "Sony DSC-RX100", 0, 0, { 8651,-2754,-1057,-3464,12207,1373,-568,1398,4434 } }, @@ -1521,7 +1521,7 @@ { "Sony DSLR-A100", 0, 0xfeb, { 9437,-2811,-774,-8405,16215,2290,-710,596,7181 } }, { "Sony DSLR-A290", 0, 0, -@@ -8088,6 +8133,33 @@ +@@ -8088,6 +8132,33 @@ } break; } @@ -1555,7 +1555,7 @@ } void CLASS simple_coeff (int index) -@@ -8410,7 +8482,7 @@ +@@ -8410,7 +8481,7 @@ tiff_flip = flip = filters = UINT_MAX; /* unknown */ raw_height = raw_width = fuji_width = fuji_layout = cr2_slice[0] = 0; maximum = height = width = top_margin = left_margin = 0; @@ -1564,7 +1564,7 @@ iso_speed = shutter = aperture = focal_len = unique_id = 0; tiff_nifds = 0; memset (tiff_ifd, 0, sizeof tiff_ifd); -@@ -8442,13 +8514,20 @@ +@@ -8442,13 +8513,20 @@ fread (head, 1, 32, ifp); fseek (ifp, 0, SEEK_END); flen = fsize = ftell(ifp); @@ -1587,7 +1587,7 @@ parse_ciff (hlen, flen-hlen, 0); load_raw = &CLASS canon_load_raw; } else if (parse_tiff(0)) apply_tiff(); -@@ -8494,6 +8573,7 @@ +@@ -8494,6 +8572,7 @@ fseek (ifp, 100+28*(shot_select > 0), SEEK_SET); parse_tiff (data_offset = get4()); parse_tiff (thumb_offset+12); @@ -1595,7 +1595,7 @@ apply_tiff(); } else if (!memcmp (head,"RIFF",4)) { fseek (ifp, 0, SEEK_SET); -@@ -8607,9 +8687,10 @@ +@@ -8607,9 +8686,10 @@ if (make[0] == 0) parse_smal (0, flen); if (make[0] == 0) { parse_jpeg(0); @@ -1609,7 +1609,7 @@ strcpy (make, "OmniVision"); data_offset = ftell(ifp) + 0x8000-32; width = raw_width; -@@ -8618,6 +8699,7 @@ +@@ -8618,6 +8698,7 @@ filters = 0x16161616; } else is_raw = 0; } @@ -1617,7 +1617,7 @@ for (i=0; i < sizeof corp / sizeof *corp; i++) if (strcasestr (make, corp[i])) /* Simplify company names */ -@@ -8649,7 +8731,7 @@ +@@ -8649,7 +8730,7 @@ if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */ { height = 3124; width = 4688; filters = 0x16161616; } if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x"))) @@ -1626,7 +1626,7 @@ if (width >= 4960 && !strncmp(model,"K-5",3)) { left_margin = 10; width = 4950; filters = 0x16161616; } if (width == 4736 && !strcmp(model,"K-7")) -@@ -8669,6 +8751,7 @@ +@@ -8669,6 +8750,7 @@ case 0: case 1: load_raw = &CLASS packed_dng_load_raw; break; case 7: load_raw = &CLASS lossless_dng_load_raw; break; @@ -1634,7 +1634,7 @@ case 34892: load_raw = &CLASS lossy_dng_load_raw; break; default: load_raw = 0; } -@@ -8725,6 +8808,7 @@ +@@ -8725,6 +8807,7 @@ if (height > width) pixel_aspect = 2; filters = 0; simple_coeff(0); @@ -1642,7 +1642,7 @@ } else if (!strcmp(make,"Canon") && tiff_bps == 15) { switch (width) { case 3344: width -= 66; -@@ -9034,24 +9118,53 @@ +@@ -9034,24 +9117,53 @@ if (load_raw == &CLASS lossless_jpeg_load_raw) load_raw = &CLASS hasselblad_load_raw; if (raw_width == 7262) { @@ -1701,7 +1701,7 @@ } else if (raw_width == 4090) { strcpy (model, "V96C"); height -= (top_margin = 6); -@@ -9109,6 +9222,7 @@ +@@ -9109,6 +9221,7 @@ filters = 0x16161616; } } else if (!strcmp(make,"Leica") || !strcmp(make,"Panasonic")) { @@ -1709,7 +1709,7 @@ if ((flen - data_offset) / (raw_width*8/7) == raw_height) load_raw = &CLASS panasonic_load_raw; if (!load_raw) { -@@ -9126,6 +9240,7 @@ +@@ -9126,6 +9239,7 @@ } filters = 0x01010101 * (uchar) "\x94\x61\x49\x16" [((filters-1) ^ (left_margin & 1) ^ (top_margin << 1)) & 3]; @@ -1717,7 +1717,7 @@ } else if (!strcmp(model,"C770UZ")) { height = 1718; width = 2304; -@@ -9201,13 +9316,15 @@ +@@ -9201,13 +9315,15 @@ width -= 6; } else if (!strcmp(make,"Sony") && raw_width == 7392) { width -= 30; @@ -1740,7 +1740,7 @@ } else if (!strcmp(model,"DSLR-A100")) { if (width == 3880) { height--; -@@ -9357,6 +9474,18 @@ +@@ -9357,6 +9473,18 @@ memcpy (rgb_cam, cmatrix, sizeof cmatrix); raw_color = 0; } @@ -1759,7 +1759,7 @@ if (raw_color) adobe_coeff (make, model); if (load_raw == &CLASS kodak_radc_load_raw) if (raw_color) adobe_coeff ("Apple","Quicktake"); -@@ -9371,9 +9500,9 @@ +@@ -9371,9 +9499,9 @@ if (raw_width < width ) raw_width = width; } if (!tiff_bps) tiff_bps = 12; @@ -1771,7 +1771,7 @@ is_raw = 0; #ifdef NO_JASPER if (load_raw == &CLASS redcine_load_raw) { -@@ -9452,199 +9581,250 @@ +@@ -9452,199 +9580,250 @@ } #endif @@ -2205,7 +2205,7 @@ struct tiff_tag { ushort tag, type; int count; -@@ -9667,594 +9847,11 @@ +@@ -9667,594 +9846,11 @@ char desc[512], make[64], model[64], soft[32], date[20], artist[64]; }; diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index bfe9c1c9a..577a3f4a6 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -888,14 +888,9 @@ void Crop::update (int todo) realtile = 12; } - int tilesize; - int overlap; - tilesize = 1024; - overlap = 128; - tilesize = 128 * realtile; - //overlap=(int) tilesize*params->wavelet.overl; - overlap = (int) tilesize * 0.125f; - // printf("overl=%d\n",overlap); + int tilesize = 128 * realtile; + int overlap = (int) tilesize * 0.125f; + int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip; parent->ipf.Tile_calc (tilesize, overlap, kall, labnCrop->W, labnCrop->H, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 7189fbe40..b2bdf798f 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -158,7 +158,7 @@ void dfInfo::updateRawImage() int nFiles = 1; // First file data already loaded - for( iName++; iName != pathNames.end(); iName++) { + for( ++iName; iName != pathNames.end(); ++iName) { RawImage* temp = new RawImage(*iName); if( !temp->loadRaw(true)) { @@ -300,7 +300,7 @@ void DFManager::init( Glib::ustring pathname ) } // Where multiple shots exist for same group, move filename to list - for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) { + for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) { dfInfo &i = iter->second; if( !i.pathNames.empty() && !i.pathname.empty() ) { @@ -314,7 +314,7 @@ void DFManager::init( Glib::ustring pathname ) } else { printf( "%s: MEAN of \n ", i.key().c_str()); - for( std::list::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); iter++ ) { + for( std::list::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); ++iter ) { printf( "%s, ", iter->c_str() ); } @@ -391,7 +391,7 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool) iter = dfList.insert(std::pair< std::string, dfInfo>( key, n ) ); } else { while( iter != dfList.end() && iter->second.key() == key && ABS(iter->second.timestamp - idata.getDateTimeAsTS()) > 60 * 60 * 6 ) { // 6 hour difference - iter++; + ++iter; } if( iter != dfList.end() ) { @@ -414,7 +414,7 @@ void DFManager::getStat( int &totFiles, int &totTemplates) totFiles = 0; totTemplates = 0; - for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) { + for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) { dfInfo &i = iter->second; if( i.pathname.empty() ) { @@ -443,7 +443,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso dfList_t::iterator bestMatch = iter; time_t bestDeltaTime = ABS(iter->second.timestamp - t); - for(iter++; iter != dfList.end() && !key.compare( iter->second.key() ); iter++ ) { + for(++iter; iter != dfList.end() && !key.compare( iter->second.key() ); ++iter ) { time_t d = ABS(iter->second.timestamp - t ); if( d < bestDeltaTime ) { @@ -458,7 +458,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso dfList_t::iterator bestMatch = iter; double bestD = iter->second.distance( mak, mod, isospeed, shut ); - for( iter++; iter != dfList.end(); iter++ ) { + for( ++iter; iter != dfList.end(); ++iter ) { double d = iter->second.distance( mak, mod, isospeed, shut ); if( d < bestD ) { @@ -484,7 +484,7 @@ RawImage* DFManager::searchDarkFrame( const std::string &mak, const std::string RawImage* DFManager::searchDarkFrame( const Glib::ustring filename ) { - for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) { + for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) { if( iter->second.pathname.compare( filename ) == 0 ) { return iter->second.getRawImage(); } @@ -500,7 +500,7 @@ RawImage* DFManager::searchDarkFrame( const Glib::ustring filename ) } std::vector *DFManager::getHotPixels ( const Glib::ustring filename ) { - for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) { + for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) { if( iter->second.pathname.compare( filename ) == 0 ) { return &iter->second.getHotPixels(); } diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index c5461f3e9..6a653eb84 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -158,7 +158,7 @@ void ffInfo::updateRawImage() int nFiles = 1; // First file data already loaded - for( iName++; iName != pathNames.end(); iName++) { + for( ++iName; iName != pathNames.end(); ++iName) { RawImage* temp = new RawImage(*iName); if( !temp->loadRaw(true)) { @@ -268,7 +268,7 @@ void FFManager::init( Glib::ustring pathname ) } // Where multiple shots exist for same group, move filename to list - for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) { + for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) { ffInfo &i = iter->second; if( !i.pathNames.empty() && !i.pathname.empty() ) { @@ -282,7 +282,7 @@ void FFManager::init( Glib::ustring pathname ) } else { printf( "%s: MEAN of \n ", i.key().c_str()); - for( std::list::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); iter++ ) { + for( std::list::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); ++iter ) { printf( "%s, ", iter->c_str() ); } @@ -361,7 +361,7 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool) iter = ffList.insert(std::pair< std::string, ffInfo>( key, n ) ); } else { while( iter != ffList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) > 60 * 60 * 6 ) { // 6 hour difference - iter++; + ++iter; } if( iter != ffList.end() ) { @@ -384,7 +384,7 @@ void FFManager::getStat( int &totFiles, int &totTemplates) totFiles = 0; totTemplates = 0; - for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) { + for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) { ffInfo &i = iter->second; if( i.pathname.empty() ) { @@ -413,7 +413,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s ffList_t::iterator bestMatch = iter; time_t bestDeltaTime = ABS(iter->second.timestamp - t); - for(iter++; iter != ffList.end() && !key.compare( iter->second.key() ); iter++ ) { + for(++iter; iter != ffList.end() && !key.compare( iter->second.key() ); ++iter ) { time_t d = ABS(iter->second.timestamp - t ); if( d < bestDeltaTime ) { @@ -428,7 +428,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s ffList_t::iterator bestMatch = iter; double bestD = iter->second.distance( mak, mod, len, focal, apert ); - for( iter++; iter != ffList.end(); iter++ ) { + for( ++iter; iter != ffList.end(); ++iter ) { double d = iter->second.distance( mak, mod, len, focal, apert ); if( d < bestD ) { @@ -454,7 +454,7 @@ RawImage* FFManager::searchFlatField( const std::string &mak, const std::string RawImage* FFManager::searchFlatField( const Glib::ustring filename ) { - for ( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) { + for ( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) { if( iter->second.pathname.compare( filename ) == 0 ) { return iter->second.getRawImage(); } diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index bbfc303fc..2622ffcf7 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -121,61 +121,80 @@ void ImageData::extractInfo () return; } - make = ""; - model = ""; - serial = ""; - orientation = ""; - expcomp = 0; - shutter = 0; - aperture = 0; - focal_len = focal_len35mm = 0; - focus_dist = 0; - iso_speed = 0; - memset (&time, 0, sizeof(time)); + memset(&time, 0, sizeof(time)); timeStamp = 0; + iso_speed = 0; + aperture = 0.0; + focal_len = 0.0; + focal_len35mm = 0.0; + focus_dist = 0.0f; + shutter = 0.0; + expcomp = 0.0; + make.clear(); + model.clear(); + serial.clear(); + orientation.clear(); + lens.clear(); - if (root->getTag ("Make")) { - make = root->getTag ("Make")->valueToString (); - // same dcraw treatment - static const char *corp[] = { - "Canon", "NIKON", "EPSON", "KODAK", "Kodak", "OLYMPUS", "PENTAX", "RICOH", - "MINOLTA", "Minolta", "Konica", "CASIO", "Sinar", "Phase One", - "SAMSUNG", "Mamiya", "MOTOROLA", "Leaf" - }; - - for (size_t i = 0; i < (sizeof(corp) / sizeof(*corp)); i++) - if ( make.find( corp[i] ) != std::string::npos ) { /* Simplify company names */ - make = corp[i]; + if (root->getTag("Make")) { + make = root->getTag ("Make")->valueToString(); + // Same dcraw treatment + for (const auto& corp : { + "Canon", + "NIKON", + "EPSON", + "KODAK", + "Kodak", + "OLYMPUS", + "PENTAX", + "RICOH", + "MINOLTA", + "Minolta", + "Konica", + "CASIO", + "Sinar", + "Phase One", + "SAMSUNG", + "Mamiya", + "MOTOROLA", + "Leaf" + }) { + if (make.find(corp) != std::string::npos) { // Simplify company names + make = corp; break; } - - make.erase( make.find_last_not_of(' ') + 1 ); - } - - if (root->getTag ("Model")) { - model = root->getTag ("Model")->valueToString (); - } - - if (!(model.size() == 0)) { - std::size_t i = 0; - - if ( make.find("KODAK") != std::string::npos ) { - if( (i = model.find(" DIGITAL CAMERA")) != std::string::npos || - (i = model.find(" Digital Camera")) != std::string::npos || - (i = model.find("FILE VERSION")) ) { - model.resize( i ); - } } - model.erase( model.find_last_not_of(' ') + 1 ); + make.erase(make.find_last_not_of(' ') + 1); + } - //if( (i=model.find( make )) != std::string::npos ) - if( !strncasecmp (model.c_str(), make.c_str(), make.size()) ) - if( model.at( make.size() ) == ' ') { + if (root->getTag("Model")) { + model = root->getTag("Model")->valueToString(); + } + + if (!model.empty()) { + std::string::size_type i = 0; + + if ( + make.find("KODAK") != std::string::npos + && ( + (i = model.find(" DIGITAL CAMERA")) != std::string::npos + || (i = model.find(" Digital Camera")) != std::string::npos + || (i = model.find("FILE VERSION")) != std::string::npos + ) + ) { + model.resize(i); + } + + model.erase(model.find_last_not_of(' ') + 1); + + if (!strncasecmp(model.c_str(), make.c_str(), make.size())) { + if (model.size() >= make.size() && model[make.size()] == ' ') { model.erase(0, make.size() + 1); } + } - if( model.find( "Digital Camera ") != std::string::npos ) { + if (model.find( "Digital Camera ") != std::string::npos) { model.erase(0, 15); } } else { diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 3ad8faee0..a9be4e7e3 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -136,7 +136,7 @@ void ImageIO::setMetadata (const rtexif::TagDirectory* eroot, const rtengine::pr iptc = iptc_data_new (); - for (rtengine::procparams::IPTCPairs::const_iterator i = iptcc.begin(); i != iptcc.end(); i++) { + for (rtengine::procparams::IPTCPairs::const_iterator i = iptcc.begin(); i != iptcc.end(); ++i) { if (i->first == "Keywords" && !(i->second.empty())) { for (unsigned int j = 0; j < i->second.size(); j++) { IptcDataSet * ds = iptc_dataset_new (); @@ -1082,7 +1082,7 @@ int ImageIO::saveJPEG (Glib::ustring fname, int quality, int subSamp) cinfo.comp_info[2].h_samp_factor = cinfo.comp_info[2].v_samp_factor = 1; if (subSamp == 1) { - // Best compression, default of the JPEG library: 2x2, 1x1, 1x1 (4:1:1) + // Best compression, default of the JPEG library: 2x2, 1x1, 1x1 (4:2:0) cinfo.comp_info[0].h_samp_factor = cinfo.comp_info[0].v_samp_factor = 2; } else if (subSamp == 2) { // Widely used normal ratio 2x1, 1x1, 1x1 (4:2:2) @@ -1227,22 +1227,17 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) } // buffer for the exif and iptc - int bufferSize = 165535; //TODO: Is it really 165535... or 65535 ? - - if(profileData) { - bufferSize += profileLength; - } - - unsigned char* buffer = new unsigned char[bufferSize]; - unsigned char* iptcdata = NULL; + unsigned int bufferSize; + unsigned char* buffer = nullptr; // buffer will be allocated in createTIFFHeader + unsigned char* iptcdata = nullptr; unsigned int iptclen = 0; if (iptc && iptc_data_save (iptc, &iptcdata, &iptclen) && iptcdata) { iptc_data_free_buf (iptc, iptcdata); - iptcdata = NULL; + iptcdata = nullptr; } - int size = rtexif::ExifManager::createTIFFHeader (exifRoot, exifChange, width, height, bps, profileData, profileLength, (char*)iptcdata, iptclen, buffer); + int size = rtexif::ExifManager::createTIFFHeader (exifRoot, exifChange, width, height, bps, profileData, profileLength, (char*)iptcdata, iptclen, buffer, bufferSize); if (iptcdata) { iptc_data_free_buf (iptc, iptcdata); @@ -1250,7 +1245,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) // The maximum lenght is strangely not the same than for the JPEG file... // Which maximum length is the good one ? - if (size > 0 && size < bufferSize) { + if (size > 0 && size <= bufferSize) { fwrite (buffer, size, 1, file); } @@ -1277,7 +1272,9 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) } } - delete [] buffer; + if(buffer) { + delete [] buffer; + } if (ferror(file)) { writeOk = false; @@ -1288,11 +1285,13 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) // little hack to get libTiff to use proper byte order (see TIFFClienOpen()): const char *mode = !exifRoot ? "w" : (exifRoot->getOrder() == rtexif::INTEL ? "wl" : "wb"); #ifdef WIN32 - wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (fname.c_str(), -1, NULL, NULL, NULL); - TIFF* out = TIFFOpenW (wfilename, mode); - g_free (wfilename); + FILE *file = g_fopen_withBinaryAndLock (fname); + int fileno = _fileno(file); + int osfileno = _get_osfhandle(fileno); + TIFF* out = TIFFFdOpen (osfileno, fname.c_str(), mode); #else TIFF* out = TIFFOpen(fname.c_str(), mode); + int fileno = TIFFFileno (out); #endif if (!out) { @@ -1317,7 +1316,9 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) // TIFFOpen writes out the header and sets file pointer at position 8 exif->write (8, buffer); - write (TIFFFileno (out), buffer + 8, exif_size); + + write (fileno, buffer + 8, exif_size); + delete [] buffer; // let libtiff know that scanlines or any other following stuff should go // at a different offset: @@ -1350,14 +1351,12 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) } - Glib::ustring rtVersion("RawTherapee "); - rtVersion += VERSION; - TIFFSetField (out, TIFFTAG_SOFTWARE, rtVersion.c_str()); + TIFFSetField (out, TIFFTAG_SOFTWARE, "RawTherapee " VERSION); TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width); TIFFSetField (out, TIFFTAG_IMAGELENGTH, height); TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 3); - TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, height); + TIFFSetField (out, TIFFTAG_ROWSPERSTRIP, height); TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, bps); TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); @@ -1391,6 +1390,9 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) } TIFFClose (out); +#ifdef WIN32 + fclose (file); +#endif } delete [] linebuffer; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 8da4f689a..c30e626b9 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -611,8 +611,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh Jpro = (CAMBrightCurveJ[(float)(Jpro * 327.68)]) / 327.68; //ligthness CIECAM02 + contrast double sres; double Sp = spro / 100.0; - double parsat = 1.5; - parsat = 1.5; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation) + double parsat = 1.5; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation) if(schr == -100.0) { schr = -99.8; @@ -4964,7 +4963,6 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go if(s > s_1) ksat=SQR((1.f/(s_1-1.f))*s - (1.f/(s_1-1.f))); } */ - ksat = 1.f; float kl = 1.f; float rlo = 1.f; //0.4 0.5 float rlm = 1.5f; //1.1 @@ -5235,7 +5233,6 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g if(s > s_1) ksat=SQR((1.f/(s_1-1.f))*s - (1.f/(s_1-1.f))); } */ - ksat = 1.f; float kl = 1.f; float rlo = 1.f; float rlh = 2.2f; @@ -5303,7 +5300,6 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g //high tones float kh = 1.f; - kh = 1.f; float aa0, bb0; //fixed value of reducac ==0.4; secondeg_begin (reducac, iphigh, aa0, bb0); diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 4e433b453..ab29308c8 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -574,15 +574,8 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int realtile = 12; } - int tilesize; - int overlap; - tilesize = 1024; - overlap = 128; - //tilesize=128*params->wavelet.tiles; - tilesize = 128 * realtile; - //overlap=(int) tilesize*params->wavelet.overl; - overlap = (int) tilesize * 0.125f; - // printf("overl=%d\n",overlap); + int tilesize = 128 * realtile; + int overlap = (int) tilesize * 0.125f; int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip; if(params->wavelet.Tilesmethod == "full") { @@ -1828,8 +1821,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * float maxkoeLi[12]; float *koeLibuffer = NULL; - bool lipschitz = false; - lipschitz = true; + bool lipschitz = true; if(lipschitz == true) { for(int y = 0; y < 12; y++) { @@ -3262,8 +3254,6 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit int ii = i / W_L; int jj = i - ii * W_L; float LL100 = labco->L[ii * 2][jj * 2] / 327.68f; - k1 = 600.f; - k2 = 300.f; k1 = 0.3f * (waOpacityCurveW[6.f * LL100] - 0.5f); //k1 between 0 and 0.5 0.5==> 1/6=0.16 k2 = k1 * 2.f; @@ -3525,8 +3515,6 @@ void ImProcFunctions::ContAllAB (LabImage * labco, int maxlvl, float ** varhue, int ii = i / W_ab; int jj = i - ii * W_ab; float LL100 = labco->L[ii * 2][jj * 2] / 327.68f; - k1 = 600.f; - k2 = 300.f; k1 = 0.3f * (waOpacityCurveW[6.f * LL100] - 0.5f); //k1 between 0 and 0.5 0.5==> 1/6=0.16 k2 = k1 * 2.f; diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index bcc2a7db7..0414cc1de 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -68,18 +68,17 @@ int munmap(void *start, size_t length) IMFILE* fopen (const char* fname) { - int fd = -1; + int fd; #ifdef WIN32 - { - // First convert UTF8 to UTF16, then use Windows function to open the file and convert back to file descriptor. - std::unique_ptr wfname (reinterpret_cast(g_utf8_to_utf16 (fname, -1, NULL, NULL, NULL)), g_free); + fd = -1; + // First convert UTF8 to UTF16, then use Windows function to open the file and convert back to file descriptor. + std::unique_ptr wfname (reinterpret_cast(g_utf8_to_utf16 (fname, -1, NULL, NULL, NULL)), g_free); - HANDLE hFile = CreateFileW (wfname.get (), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile != INVALID_HANDLE_VALUE) { - fd = _open_osfhandle((intptr_t)hFile, 0); - } + HANDLE hFile = CreateFileW (wfname.get (), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile != INVALID_HANDLE_VALUE) { + fd = _open_osfhandle((intptr_t)hFile, 0); } #else diff --git a/rtengine/processingjob.h b/rtengine/processingjob.h index 3364e6daf..fbf56234f 100644 --- a/rtengine/processingjob.h +++ b/rtengine/processingjob.h @@ -34,15 +34,11 @@ public: procparams::ProcParams pparams; ProcessingJobImpl (const Glib::ustring& fn, bool iR, const procparams::ProcParams& pp) - : fname(fn), isRaw(iR), initialImage(NULL) - { - pparams = pp; - } + : fname(fn), isRaw(iR), initialImage(NULL), pparams(pp) {} ProcessingJobImpl (InitialImage* iImage, const procparams::ProcParams& pp) - : fname(""), initialImage(iImage) + : fname(""), initialImage(iImage), pparams(pp) { - pparams = pp; iImage->increaseRef(); } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 25d5df212..60a54baf5 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3388,14 +3388,14 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b // save exif change list if (!pedited || pedited->exif) { - for (ExifPairs::const_iterator i = exif.begin(); i != exif.end(); i++) { + for (ExifPairs::const_iterator i = exif.begin(); i != exif.end(); ++i) { keyFile.set_string ("Exif", i->first, i->second); } } // save iptc change list if (!pedited || pedited->iptc) { - for (IPTCPairs::const_iterator i = iptc.begin(); i != iptc.end(); i++) { + for (IPTCPairs::const_iterator i = iptc.begin(); i != iptc.end(); ++i) { Glib::ArrayHandle values = i->second; keyFile.set_string_list ("IPTC", i->first, values); } @@ -7487,7 +7487,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) for ( std::vector::iterator currLoadedTagValue = currIptc.begin(); currLoadedTagValue != currIptc.end(); - currLoadedTagValue++) { + ++currLoadedTagValue) { iptc[keys[i]].push_back(currLoadedTagValue->data()); } diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 919b1c7be..8f91f8f4b 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -19,7 +19,7 @@ namespace rtengine extern const Settings* settings; -RawImage::RawImage( const Glib::ustring name ) +RawImage::RawImage( const Glib::ustring &name ) : data(NULL) , prefilters(0) , filename(name) diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 5b425f7df..86965a612 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -99,7 +99,7 @@ class RawImage: public DCraw { public: - RawImage( const Glib::ustring name ); + RawImage( const Glib::ustring &name ); ~RawImage(); int loadRaw (bool loadData = true, bool closeFile = true, ProgressListener *plistener = 0, double progressRange = 1.0); diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 3913dc6ba..e8c1cd096 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -176,7 +176,7 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL int err = 1; // see if it is something we support - if ( ri->is_supportedThumb() ) { + if ( ri->is_supportedThumb() && ri->get_thumbOffset() < ri->get_file()->size ) { const char* data((const char*)fdata(ri->get_thumbOffset(), ri->get_file())); if ( (unsigned char)data[1] == 0xd8 ) { diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index ac77da25d..bb8e96c11 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -227,7 +227,7 @@ void SHMap::updateL (float** L, double radius, bool hq, int skip) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //experimental dirpyr shmap float thresh = (100.f * radius); //1000; - int levrad = 16; + int levrad; // = 16; levrad = 2; //for retinex - otherwise levrad = 16 // set up range function // calculate size of Lookup table. That's possible because from a value k for all i>=k rangefn[i] will be exp(-10) diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index f61d90c08..dd49ab23d 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -336,7 +336,7 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring return true; } -Glib::ustring TagDirectory::getDumpKey (int tagID, const Glib::ustring tagName) +Glib::ustring TagDirectory::getDumpKey (int tagID, const Glib::ustring &tagName) { Glib::ustring key; @@ -2792,6 +2792,7 @@ TagDirectory* ExifManager::parseTIFF (FILE* f, bool skipIgnored) std::vector ExifManager::getDefaultTIFFTags (TagDirectory* forthis) { + std::vector defTags; defTags.reserve (12); @@ -2800,7 +2801,7 @@ std::vector ExifManager::getDefaultTIFFTags (TagDirectory* forthis) defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "XResolution"), 300, RATIONAL)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "YResolution"), 300, RATIONAL)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ResolutionUnit"), 2, SHORT)); - defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), "RawTherapee")); + defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), "RawTherapee " VERSION)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Orientation"), 1, SHORT)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "SamplesPerPixel"), 3, SHORT)); defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "BitsPerSample"), 8, SHORT)); @@ -2840,7 +2841,7 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const rtengine::pro cl = new TagDirectory (NULL, ifdAttribs, INTEL); } - for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); i++) { + for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); ++i) { cl->applyChange (i->first, i->second); } @@ -2864,7 +2865,7 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const rtengine::pro return size + 6; } -int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer) +int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char *&buffer, unsigned &bufferSize) { // write tiff header @@ -2875,17 +2876,17 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro order = root->getOrder (); } - sset2 ((unsigned short)order, buffer + offs, order); - offs += 2; - sset2 (42, buffer + offs, order); - offs += 2; - sset4 (8, buffer + offs, order); - offs += 4; - TagDirectory* cl; if (root) { cl = (const_cast(root))->clone (NULL); + // remove some unknown top level tags which produce warnings when opening a tiff + Tag *removeTag = cl->getTag(0x9003); + if(removeTag) + removeTag->setKeep(false); + removeTag = cl->getTag(0x9211); + if(removeTag) + removeTag->setKeep(false); } else { cl = new TagDirectory (NULL, ifdAttribs, HOSTORDER); } @@ -2926,7 +2927,7 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro } // apply list of changes - for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); i++) { + for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); ++i) { cl->applyChange (i->first, i->second); } @@ -2956,6 +2957,15 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro } cl->sort (); + bufferSize = cl->calculateSize() + 8; + buffer = new unsigned char[bufferSize]; // this has to be deleted in caller + sset2 ((unsigned short)order, buffer + offs, order); + offs += 2; + sset2 (42, buffer + offs, order); + offs += 2; + sset4 (8, buffer + offs, order); + offs += 4; + int endOffs = cl->write (8, buffer); // cl->printAll(); diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index 471f9fbe3..7777331e9 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -101,7 +101,7 @@ protected: const TagAttrib* attribs; // descriptor table to decode the tags ByteOrder order; // byte order TagDirectory* parent; // parent directory (NULL if root) - static Glib::ustring getDumpKey (int tagID, const Glib::ustring tagName); + static Glib::ustring getDumpKey (int tagID, const Glib::ustring &tagName); public: TagDirectory (); @@ -318,7 +318,7 @@ public: /// @return The ownership of the return tags is passed to the caller. static std::vector getDefaultTIFFTags (TagDirectory* forthis); static int createJPEGMarker (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, unsigned char* buffer); - static int createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer); + static int createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char *&buffer, unsigned &bufferSize); }; class Interpreter @@ -495,7 +495,7 @@ protected: * Get the lens info (min/man focal, min/max aperture) and compare them to the possible choice */ if (lensInfoArray) { - for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ) { + for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); ++r ) { if( !extractLensInfo( r->second , f1, f2, a1, a2) ) { continue; } @@ -532,7 +532,7 @@ protected: std::ostringstream candidates; double deltaMin = 1000.; - for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ) { + for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); ++r ) { double lensAperture, dif; if( !extractLensInfo( r->second , f1, f2, a1, a2) ) { diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 6f2ff8846..e2f36fd3c 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -361,12 +361,12 @@ bool BatchQueue::loadBatchQueue () return !fd.empty (); } -Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring filename ) +Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring &filename ) { timeval tv; gettimeofday(&tv, 0); char mseconds[4]; - sprintf(mseconds, "%d", tv.tv_usec / 1000); + sprintf(mseconds, "%d", (int)(tv.tv_usec / 1000)); time_t rawtime; struct tm *timeinfo; char stringTimestamp [80]; diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index 5e3eec6a9..11b179e25 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -63,7 +63,7 @@ protected: BatchQueueListener* listener; Glib::ustring autoCompleteFileName (const Glib::ustring& fileName, const Glib::ustring& format); - Glib::ustring getTempFilenameForParams( const Glib::ustring filename ); + Glib::ustring getTempFilenameForParams( const Glib::ustring &filename ); bool saveBatchQueue (); void notifyListener (bool queueEmptied); diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc index f130df5ee..07a0ee3c6 100644 --- a/rtgui/batchqueueentry.cc +++ b/rtgui/batchqueueentry.cc @@ -32,11 +32,10 @@ Glib::RefPtr BatchQueueEntry::savedAsIcon; BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm) : ThumbBrowserEntryBase(fname), opreview(NULL), origpw(prevw), origph(prevh), opreviewDone(false), - job(pjob), progress(0), outFileName(""), sequence(0), forceFormatOpts(false) + job(pjob), progress(0), outFileName(""), sequence(0), forceFormatOpts(false), params(pparams) { thumbnail = thm; - params = pparams; #if 1 //ndef WIN32 // The BatchQueueEntryIdleHelper tracks if an entry has been deleted while it was sitting waiting for "idle" diff --git a/rtgui/bqentryupdater.cc b/rtgui/bqentryupdater.cc index 040036049..596811c58 100644 --- a/rtgui/bqentryupdater.cc +++ b/rtgui/bqentryupdater.cc @@ -42,7 +42,7 @@ void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQ // look up if an older version is in the queue std::list::iterator i; - for (i = jqueue.begin(); i != jqueue.end(); i++) + for (i = jqueue.begin(); i != jqueue.end(); ++i) if (i->oimg == oimg && i->listener == listener) { i->ow = ow; i->oh = oh; @@ -169,7 +169,7 @@ void BatchQueueEntryUpdater::removeJobs (BQEntryUpdateListener* listener) ready = true; std::list::iterator i; - for (i = jqueue.begin(); i != jqueue.end(); i++) + for (i = jqueue.begin(); i != jqueue.end(); ++i) if (i->listener == listener) { jqueue.erase (i); ready = false; diff --git a/rtgui/coloredbar.cc b/rtgui/coloredbar.cc index ebef8d432..0ede5c244 100644 --- a/rtgui/coloredbar.cc +++ b/rtgui/coloredbar.cc @@ -116,7 +116,7 @@ void ColoredBar::draw() break; } - for (std::vector::iterator i = bgGradient.begin(); i != bgGradient.end(); i++) { + for (std::vector::iterator i = bgGradient.begin(); i != bgGradient.end(); ++i) { bggradient->add_color_stop_rgb (i->position, i->r, i->g, i->b); } diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index dadd0f599..114fea625 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -511,7 +511,7 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y) state = SNormal; - for (std::list::iterator i = listeners.begin(); i != listeners.end(); i++) { + for (std::list::iterator i = listeners.begin(); i != listeners.end(); ++i) { (*i)->cropPositionChanged (this); } @@ -2304,7 +2304,7 @@ void CropWindow::delCropWindowListener (CropWindowListener* l) if (*i == l) { i = listeners.erase (i); } else { - i++; + ++i; } } diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index 454383075..1d4038e91 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -180,7 +180,7 @@ void DirBrowser::addRoot (char letter) void DirBrowser::updateDirTreeRoot () { - for (Gtk::TreeModel::iterator i = dirTreeModel->children().begin(); i != dirTreeModel->children().end(); i++) { + for (Gtk::TreeModel::iterator i = dirTreeModel->children().begin(); i != dirTreeModel->children().end(); ++i) { updateDirTree (i); } } @@ -191,7 +191,7 @@ void DirBrowser::updateDirTree (const Gtk::TreeModel::iterator& iter) if (dirtree->row_expanded (dirTreeModel->get_path (iter))) { updateDir (iter); - for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); i++) { + for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); ++i) { updateDirTree (i); } } @@ -207,7 +207,7 @@ void DirBrowser::updateVolumes () for (int i = 0; i < 32; i++) if (((volumes >> i) & 1) && !((nvolumes >> i) & 1)) { // volume i has been deleted - for (Gtk::TreeModel::iterator iter = dirTreeModel->children().begin(); iter != dirTreeModel->children().end(); iter++) + for (Gtk::TreeModel::iterator iter = dirTreeModel->children().begin(); iter != dirTreeModel->children().end(); ++iter) if (iter->get_value (dtColumns.filename).c_str()[0] - 'A' == i) { dirTreeModel->erase (iter); break; @@ -332,7 +332,7 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) while (change) { change = false; - for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end(); it++) + for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end(); ++it) if (!Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_EXISTS) || !Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_IS_DIR)) { GThreadLock lock; @@ -349,7 +349,7 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) for (int i = 0; i < subDirs.size(); i++) { bool found = false; - for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end() && !found ; it++) { + for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end() && !found ; ++it) { found = (it->get_value (dtColumns.filename) == subDirs[i]); } diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index efda41659..9291ac9f4 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -224,7 +224,7 @@ bool EditWindow::on_delete_event(GdkEventAny* event) // Check if any editor is still processing, and do NOT quit if so. Otherwise crashes and inconsistent caches bool isProcessing = false; - for ( std::set ::iterator iter = filesEdited.begin(); iter != filesEdited.end() && !isProcessing; iter++ ) { + for ( std::set ::iterator iter = filesEdited.begin(); iter != filesEdited.end() && !isProcessing; ++iter ) { if (epanels[*iter]->getIsProcessing()) { isProcessing = true; } @@ -234,7 +234,7 @@ bool EditWindow::on_delete_event(GdkEventAny* event) return true; } - for ( std::set ::iterator iter = filesEdited.begin(); iter != filesEdited.end(); iter++ ) { + for ( std::set ::iterator iter = filesEdited.begin(); iter != filesEdited.end(); ++iter ) { mainNB->remove_page (*epanels[*iter]); } diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 76e9eebe0..355b060ef 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -294,7 +294,7 @@ void ExifPanel::delIt (Gtk::TreeModel::iterator iter) } if (recursiveOp) - for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); i++) { + for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); ++i) { delIt (i); } } @@ -325,7 +325,7 @@ void ExifPanel::keepIt (Gtk::TreeModel::iterator iter) } if (recursiveOp) - for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); i++) { + for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); ++i) { keepIt (i); } } @@ -491,7 +491,7 @@ void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib // look up first segment of the path Gtk::TreeModel::iterator iter; - for (iter = root.begin(); iter != root.end(); iter++) + for (iter = root.begin(); iter != root.end(); ++iter) if (iter->get_value (exifColumns.field_nopango) == fseg) { break; } @@ -600,7 +600,7 @@ void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string pre Gtk::TreeModel::iterator iter; - for (iter = root.begin(); iter != root.end(); iter++) { + for (iter = root.begin(); iter != root.end(); ++iter) { if (iter->get_value (exifColumns.edited) == true) { changeList[ prefix + iter->get_value (exifColumns.field_nopango) ] = iter->get_value (exifColumns.value_nopango); } else if (iter->get_value (exifColumns.action) == AC_WRITE && iter->get_value (exifColumns.icon) == delicon) { @@ -625,7 +625,7 @@ void ExifPanel::updateChangeList () void ExifPanel::applyChangeList () { - for (rtengine::procparams::ExifPairs::iterator i = changeList.begin(); i != changeList.end(); i++) { + for (rtengine::procparams::ExifPairs::iterator i = changeList.begin(); i != changeList.end(); ++i) { editTag (exifTreeModel->children(), i->first, i->second); } } diff --git a/rtgui/favoritbrowser.cc b/rtgui/favoritbrowser.cc index 0232bf466..29b82f510 100644 --- a/rtgui/favoritbrowser.cc +++ b/rtgui/favoritbrowser.cc @@ -109,7 +109,7 @@ void FavoritBrowser::addPressed () return; } - iter++; + ++iter; } Glib::RefPtr hfile = Gio::File::create_for_parse_name (lastSelectedDir); diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 24cb62f97..9a6598572 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -607,7 +607,7 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry) std::vector::iterator i = fd.begin(); while (i != fd.end() && *entry < * ((FileBrowserEntry*)*i)) { - i++; + ++i; } fd.insert (i, entry); @@ -624,7 +624,7 @@ FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname) { MYWRITERLOCK(l, entryRW); - for (std::vector::iterator i = fd.begin(); i != fd.end(); i++) + for (std::vector::iterator i = fd.begin(); i != fd.end(); ++i) if ((*i)->filename == fname) { ThumbBrowserEntryBase* entry = *i; entry->selected = false; diff --git a/rtgui/filterpanel.cc b/rtgui/filterpanel.cc index 211a65d32..3c7b5f076 100644 --- a/rtgui/filterpanel.cc +++ b/rtgui/filterpanel.cc @@ -210,7 +210,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) expcomp->clear_items(); curefs.expcomp.clear(); - for (std::set::iterator i = defefs.expcomp.begin(); i != defefs.expcomp.end(); i++) { + for (std::set::iterator i = defefs.expcomp.begin(); i != defefs.expcomp.end(); ++i) { expcomp->append (*i); curefs.expcomp.insert(*i); } @@ -220,7 +220,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) lens->clear_items(); curefs.lenses.clear(); - for (std::set::iterator i = defefs.lenses.begin(); i != defefs.lenses.end(); i++) { + for (std::set::iterator i = defefs.lenses.begin(); i != defefs.lenses.end(); ++i) { lens->append (*i); curefs.lenses.insert(*i); } @@ -230,7 +230,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) camera->clear_items(); curefs.cameras.clear(); - for (std::set::iterator i = defefs.cameras.begin(); i != defefs.cameras.end(); i++) { + for (std::set::iterator i = defefs.cameras.begin(); i != defefs.cameras.end(); ++i) { camera->append(*i); curefs.cameras.insert(*i); } @@ -240,14 +240,14 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) filetype->clear_items(); curefs.filetypes.clear(); - for (std::set::iterator i = defefs.filetypes.begin(); i != defefs.filetypes.end(); i++) { + for (std::set::iterator i = defefs.filetypes.begin(); i != defefs.filetypes.end(); ++i) { filetype->append(*i); curefs.filetypes.insert(*i); } ftselection->select_all(); } else { - for( Gtk::TreeModel::Children::iterator iter = expcomp->get_model()->children().begin(); iter != expcomp->get_model()->children().end(); iter++) { + for( Gtk::TreeModel::Children::iterator iter = expcomp->get_model()->children().begin(); iter != expcomp->get_model()->children().end(); ++iter) { Glib::ustring v; iter->get_value(0, v); @@ -258,7 +258,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) } } - for( Gtk::TreeModel::Children::iterator iter = lens->get_model()->children().begin(); iter != lens->get_model()->children().end(); iter++) { + for( Gtk::TreeModel::Children::iterator iter = lens->get_model()->children().begin(); iter != lens->get_model()->children().end(); ++iter) { Glib::ustring v; iter->get_value(0, v); @@ -269,7 +269,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) } } - for( Gtk::TreeModel::Children::iterator iter = camera->get_model()->children().begin(); iter != camera->get_model()->children().end(); iter++) { + for( Gtk::TreeModel::Children::iterator iter = camera->get_model()->children().begin(); iter != camera->get_model()->children().end(); ++iter) { Glib::ustring v; iter->get_value(0, v); @@ -280,7 +280,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists) } } - for( Gtk::TreeModel::Children::iterator iter = filetype->get_model()->children().begin(); iter != filetype->get_model()->children().end(); iter++) { + for( Gtk::TreeModel::Children::iterator iter = filetype->get_model()->children().begin(); iter != filetype->get_model()->children().end(); ++iter) { Glib::ustring v; iter->get_value(0, v); diff --git a/rtgui/history.cc b/rtgui/history.cc index 7169d04c9..98f71331e 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -245,7 +245,7 @@ void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring // remove all rows after the selection if (iter) { - iter++; + ++iter; while (iter) { iter = historyModel->erase (iter); @@ -380,7 +380,7 @@ void History::redo () Gtk::TreeModel::iterator iter = selection->get_selected(); if (iter) { - iter++; + ++iter; if (iter != historyModel->children().end()) { selection->select (iter); diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index 1cde3ed52..854a555cf 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -215,7 +215,7 @@ bool ImageArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) cr->fill (); } - for (std::list::reverse_iterator i = cropWins.rbegin(); i != cropWins.rend(); i++) { + for (std::list::reverse_iterator i = cropWins.rbegin(); i != cropWins.rend(); ++i) { (*i)->expose (cr); } diff --git a/rtgui/iptcpanel.cc b/rtgui/iptcpanel.cc index 447de9c7a..efdfc557b 100644 --- a/rtgui/iptcpanel.cc +++ b/rtgui/iptcpanel.cc @@ -408,7 +408,7 @@ void IPTCPanel::addKeyWord () keyword->prepend (keyword->get_entry()->get_text()); std::vector items; - for (Gtk::TreeModel::iterator i = keyword->get_model()->children().begin(); i != keyword->get_model()->children().end(); i++) { + for (Gtk::TreeModel::iterator i = keyword->get_model()->children().begin(); i != keyword->get_model()->children().end(); ++i) { Glib::ustring s; i->get_value (0, s); items.push_back (s); @@ -460,7 +460,7 @@ void IPTCPanel::addSuppCategory () suppCategory->prepend (suppCategory->get_entry()->get_text()); std::vector items; - for (Gtk::TreeModel::iterator i = suppCategory->get_model()->children().begin(); i != suppCategory->get_model()->children().end(); i++) { + for (Gtk::TreeModel::iterator i = suppCategory->get_model()->children().begin(); i != suppCategory->get_model()->children().end(); ++i) { Glib::ustring s; i->get_value (0, s); items.push_back (s); @@ -563,7 +563,7 @@ void IPTCPanel::applyChangeList () keyword->get_entry()->set_text (""); suppCategory->get_entry()->set_text (""); - for (rtengine::procparams::IPTCPairs::iterator i = changeList.begin(); i != changeList.end(); i++) { + for (rtengine::procparams::IPTCPairs::iterator i = changeList.begin(); i != changeList.end(); ++i) { if (i->first == "Caption" && !i->second.empty()) { captionText->set_text (i->second.at(0)); } else if (i->first == "CaptionWriter" && !i->second.empty()) { diff --git a/rtgui/main.cc b/rtgui/main.cc index 5b7d9055e..75608bb1e 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -259,7 +259,9 @@ int main(int argc, char **argv) if (argc > 1 || options.rtSettings.verbose) { // printing RT's version in all case, particularly useful for the 'verbose' mode, but also for the batch processing std::cout << "RawTherapee, version " << VERSION << std::endl; +#ifdef WIN32 std::cout << "WARNING: closing this window will close RawTherapee!" << std::endl << std::endl; +#endif if (argc > 1) { int ret = processLineParams( argc, argv); @@ -591,59 +593,73 @@ int processLineParams( int argc, char **argv ) case '?': default: { Glib::ustring pparamsExt = paramFileExtension.substr(1); - std::cout << " indicate parameters you can change." << std::endl; - std::cout << "[Square brackets] mean the parameter is not mandatory." << std::endl; - std::cout << "The pipe symbol | indicates a choice of one or the other." << std::endl; - std::cout << "The dash symbol - denotes a range of possible values from one to the other." << std::endl; - cout << std::endl; + std::cout << " An advanced, cross-platform program for developing raw photos." << std::endl; + std::cout << std::endl; + std::cout << " Website: http://www.rawtherapee.com/" << std::endl; + std::cout << " Documentation: http://rawpedia.rawtherapee.com/" << std::endl; + std::cout << " Forum: https://discuss.pixls.us/c/software/rawtherapee" << std::endl; + std::cout << " Code and bug reports: https://github.com/Beep6581/RawTherapee" << std::endl; + std::cout << std::endl; + std::cout << "Symbols:" << std::endl; + std::cout << " indicate parameters you can change." << std::endl; + std::cout << " [Square brackets] mean the parameter is optional." << std::endl; + std::cout << " The pipe symbol | indicates a choice of one or the other." << std::endl; + std::cout << " The dash symbol - denotes a range of possible values from one to the other." << std::endl; + std::cout << std::endl; std::cout << "Usage:" << std::endl; - std::cout << " " << Glib::path_get_basename(argv[0]) << " Start File Browser inside directory." << std::endl; + std::cout << " " << Glib::path_get_basename(argv[0]) << " Start File Browser inside folder." << std::endl; std::cout << " " << Glib::path_get_basename(argv[0]) << " Start Image Editor with file." << std::endl; - std::cout << " " << Glib::path_get_basename(argv[0]) << " -c | Convert files in batch with default parameters." << std::endl << std::endl; + std::cout << " " << Glib::path_get_basename(argv[0]) << " -c | Convert files in batch with default parameters." << std::endl; + std::cout << " " << Glib::path_get_basename(argv[0]) << " -c | Convert files in batch with your own settings." << std::endl; + std::cout << std::endl; #ifdef WIN32 std::cout << " -w Do not open the Windows console" << std::endl; + std::cout << std::endl; #endif - std::cout << "Other options used with -c (-c must be the last option):" << std::endl; - std::cout << Glib::path_get_basename(argv[0]) << " [-o |-O ] [-s|-S] [-p ] [-d] [-j[1-100] [-js<1-3>]|[-b<8|16>] <[-t[z] | [-n]]] [-Y] -c " << std::endl; - std::cout << " -o | Select output file or directory." << std::endl; - std::cout << " -O | Select output file or directory and copy " << pparamsExt << " file into it." << std::endl; - std::cout << " -s Include the " << pparamsExt << " file next to the input file (with the same" << std::endl; - std::cout << " name) to build the image parameters," << std::endl; - std::cout << " e.g. for photo.raw there should be a photo.raw." << pparamsExt << " file in" << std::endl; - std::cout << " the same directory. If the file does not exist, internal" << std::endl; - std::cout << " default (neutral) values (not those in Default." << pparamsExt << ") will be" << std::endl; - std::cout << " used." << std::endl; - std::cout << " -S Like -s but skip if the " << pparamsExt << " file does not exist." << std::endl; - std::cout << " -p Specify " << pparamsExt << " file to be used for all conversions." << std::endl; - std::cout << " You can specify as many -p options as you like (see" << std::endl; - std::cout << " description below)." << std::endl; - std::cout << " -d Use the default raw or non-raw " << pparamsExt << " file as set in" << std::endl; + std::cout << "Options:" << std::endl; + std::cout << " " << Glib::path_get_basename(argv[0]) << " [-o |-O ] [-s|-S] [-p [-p ...] ] [-d] [ -j[1-100] [-js<1-3>] | [-b<8|16>] [-t[z] | [-n]] ] [-Y] -c " << std::endl; + std::cout << std::endl; + std::cout << " -c Specify one or more input files." << std::endl; + std::cout << " -c must be the last option." << std::endl; + std::cout << " -o | Set output file or folder." << std::endl; + std::cout << " Saves output file alongside input file if -o is not specified." << std::endl; + std::cout << " -O | Set output file or folder and copy " << pparamsExt << " file into it." << std::endl; + std::cout << " Saves output file alongside input file if -O is not specified." << std::endl; + std::cout << " -s Use the existing sidecar file to build the processing parameters," << std::endl; + std::cout << " e.g. for photo.raw there should be a photo.raw." << pparamsExt << " file in the same folder." << std::endl; + std::cout << " If the sidecar file does not exist, neutral values will be used." << std::endl; + std::cout << " -S Like -s but skip if the sidecar file does not exist." << std::endl; + std::cout << " -p Specify processing profile to be used for all conversions." << std::endl; + std::cout << " You can specify as many sets of \"-p \" options as you like," << std::endl; + std::cout << " each will be built on top of the previous one, as explained below." << std::endl; + std::cout << " -d Use the default raw or non-raw processing profile as set in" << std::endl; std::cout << " Preferences > Image Processing > Default Processing Profile" << std::endl; - std::cout << " -j[1-100] Specify output to be JPEG (on by default). Optionally add" << std::endl; - std::cout << " compression 1-100 (default value: 92)." << std::endl; + std::cout << " -j[1-100] Specify output to be JPEG (default, if -t and -n are not set)." << std::endl; + std::cout << " Optionally, specify compression 1-100 (default value: 92)." << std::endl; std::cout << " -js<1-3> Specify the JPEG chroma subsampling parameter, where:" << std::endl; - std::cout << " 1 = Best compression: 2x2, 1x1, 1x1 (4:2:0)" << std::endl; + std::cout << " 1 = Best compression: 2x2, 1x1, 1x1 (4:2:0)" << std::endl; std::cout << " Chroma halved vertically and horizontally." << std::endl; - std::cout << " 2 = Balanced: 2x1, 1x1, 1x1 (4:2:2)" << std::endl; + std::cout << " 2 = Balanced (default): 2x1, 1x1, 1x1 (4:2:2)" << std::endl; std::cout << " Chroma halved horizontally." << std::endl; - std::cout << " 3 = Best quality: 1x1, 1x1, 1x1 (4:4:4)" << std::endl; + std::cout << " 3 = Best quality: 1x1, 1x1, 1x1 (4:4:4)" << std::endl; std::cout << " No chroma subsampling." << std::endl; - std::cout << " -b<8|16> Specify bit depth per channel (only applies to TIFF and PNG output)." << std::endl; - std::cout << " -t[z] Specify output to be TIFF (16-bit if -b8 is not set)." << std::endl; - std::cout << " Uncompressed by default, or ZIP compression with 'z'" << std::endl; - std::cout << " -n Specify output to be compressed PNG (16-bit if -b8 is not set)." << std::endl; - std::cout << " -Y Overwrite output if present." << std::endl << std::endl; - std::cout << "Your " << pparamsExt << " files can be incomplete, RawTherapee will set the values as follows:" << std::endl; - std::cout << " 1- A new profile is created using internal default (neutral) values" << std::endl; - std::cout << " (hard-coded into RawTherapee)," << std::endl; - std::cout << " 2- then overridden by those found in the default raw or non-raw " << pparamsExt << " file" << std::endl; - std::cout << " (if -d has been set)," << std::endl; - std::cout << " 3- then overridden by those found in the " << pparamsExt << " files provided by -p, each one" << std::endl; - std::cout << " overriding the previous values," << std::endl; - std::cout << " 4- then overridden by the sidecar file if -s is set and if the file exists;" << std::endl; - std::cout << " the time where the sidecar file is used depends on the position of the -s" << std::endl; - std::cout << " switch in the command line relative to the -p parameters," << std::endl; - std::cout << " e.g. -p first." << pparamsExt << " -p second." << pparamsExt << " -s -p fourth." << pparamsExt << std::endl; + std::cout << " -b<8|16> Specify bit depth per channel (default value: 16 for TIFF, 8 for PNG)." << std::endl; + std::cout << " Only applies to TIFF and PNG output, JPEG is always 8." << std::endl; + std::cout << " -t[z] Specify output to be TIFF." << std::endl; + std::cout << " Uncompressed by default, or deflate compression with 'z'." << std::endl; + std::cout << " -n Specify output to be compressed PNG." << std::endl; + std::cout << " Compression is hard-coded to 6." << std::endl; + std::cout << " -Y Overwrite output if present." << std::endl; + std::cout << std::endl; + std::cout << "Your " << pparamsExt << " files can be incomplete, RawTherapee will build the final values as follows:" << std::endl; + std::cout << " 1- A new processing profile is created using neutral values," << std::endl; + std::cout << " 2- If the \"-d\" option is set, the values are overridden by those found in" << std::endl; + std::cout << " the default raw or non-raw processing profile." << std::endl; + std::cout << " 3- If one or more \"-p\" options are set, the values are overridden by those" << std::endl; + std::cout << " found in these processing profiles." << std::endl; + std::cout << " 4- If the \"-s\" or \"-S\" options are set, the values are finally overridden by those" << std::endl; + std::cout << " found in the sidecar files." << std::endl; + std::cout << " The processing profiles are processed in the order specified on the command line." << std::endl; return -1; } } diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index f65a6d840..eafe5d38c 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -21,10 +21,9 @@ #include #include -MyCurve::MyCurve () : pipetteR(-1.f), pipetteG(-1.f), pipetteB(-1.f), pipetteVal(-1.f), listener(NULL) +MyCurve::MyCurve () : pipetteR(-1.f), pipetteG(-1.f), pipetteB(-1.f), pipetteVal(-1.f), listener(NULL), cursor_type( CSArrow) { - cursor_type = CSArrow; graphX = get_allocation().get_width() - RADIUS * 2; graphY = get_allocation().get_height() - RADIUS * 2; prevGraphW = graphW; diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index 845fc97dd..6a05e2a80 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -574,8 +574,8 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) ity = curve.y.begin(); for (int i = 0; i < closest_point; i++) { - itx++; - ity++; + ++itx; + ++ity; } curve.x.insert (itx, 0); @@ -1099,8 +1099,8 @@ bool MyDiagonalCurve::pipetteButton1Pressed(EditDataProvider *provider, int modi ity = curve.y.begin(); for (int i = 0; i < closest_point; i++) { - itx++; - ity++; + ++itx; + ++ity; } lit_point = closest_point; diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index c544f6871..30f3681bf 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -626,10 +626,10 @@ bool MyFlatCurve::handleEvents (GdkEvent* event) itrt = curve.rightTangent.begin(); for (int i = 0; i < closest_point; i++) { - itx++; - ity++; - itlt++; - itrt++; + ++itx; + ++ity; + ++itlt; + ++itrt; } curve.x.insert (itx, 0); @@ -1312,10 +1312,10 @@ bool MyFlatCurve::pipetteButton1Pressed(EditDataProvider *provider, int modifier itrt = curve.rightTangent.begin(); for (int i = 0; i < closest_point; i++) { - itx++; - ity++; - itlt++; - itrt++; + ++itx; + ++ity; + ++itlt; + ++itrt; } curve.x.insert (itx, 0); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index fba2ef059..0422f7403 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -2765,13 +2765,13 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten // Exif changes are added to the existing ones if (exif) - for (procparams::ExifPairs::const_iterator i = mods.exif.begin(); i != mods.exif.end(); i++) { + for (procparams::ExifPairs::const_iterator i = mods.exif.begin(); i != mods.exif.end(); ++i) { toEdit.exif[i->first] = i->second; } // IPTC changes are added to the existing ones if (iptc) - for (procparams::IPTCPairs::const_iterator i = mods.iptc.begin(); i != mods.iptc.end(); i++) { + for (procparams::IPTCPairs::const_iterator i = mods.iptc.begin(); i != mods.iptc.end(); ++i) { toEdit.iptc[i->first] = i->second; } } diff --git a/rtgui/previewhandler.cc b/rtgui/previewhandler.cc index 9ba62230f..e6ef30bca 100644 --- a/rtgui/previewhandler.cc +++ b/rtgui/previewhandler.cc @@ -239,7 +239,7 @@ Glib::RefPtr PreviewHandler::getRoughImage (int desiredW, int desir void PreviewHandler::previewImageChanged () { - for (std::list::iterator i = listeners.begin(); i != listeners.end(); i++) { + for (std::list::iterator i = listeners.begin(); i != listeners.end(); ++i) { (*i)->previewImageChanged (); } } diff --git a/rtgui/profilestore.cc b/rtgui/profilestore.cc index d95e7d53f..cd725ec15 100644 --- a/rtgui/profilestore.cc +++ b/rtgui/profilestore.cc @@ -252,7 +252,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath int ProfileStore::findFolderId(const Glib::ustring &path) { - for (std::vector::iterator i = folders.begin(); i != folders.end(); i++) { + for (std::vector::iterator i = folders.begin(); i != folders.end(); ++i) { if (*i == path) { return i - folders.begin(); } diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 36ce50deb..f204bc2bd 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -667,7 +667,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event) Gtk::Widget *w = mainNB->get_nth_page(page); bool optionsWritten = false; - for (std::map::iterator i = epanels.begin(); i != epanels.end(); i++) { + for (std::map::iterator i = epanels.begin(); i != epanels.end(); ++i) { if (i->second == w) { i->second->writeOptions(); optionsWritten = true; diff --git a/rtgui/thresholdselector.cc b/rtgui/thresholdselector.cc index 6141528e0..99022e042 100644 --- a/rtgui/thresholdselector.cc +++ b/rtgui/thresholdselector.cc @@ -310,16 +310,16 @@ bool ThresholdSelector::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) if (pts.size() >= 4) { std::vector::iterator i = pts.begin(); double x = *i; - i++; + ++i; double y = *i; - i++; + ++i; cr->move_to (hb + hwslider + iw * x + 0.5, (yEnd - yStart)*y + yStart); for (; i < pts.end(); ) { x = *i; - i++; + ++i; y = *i; - i++; + ++i; cr->line_to (hb + hwslider + iw * x + 0.5, (yEnd - yStart)*y + yStart); } } else { diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index ba1a7c887..e972d1e60 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -25,9 +25,8 @@ using namespace std; ThumbBrowserBase::ThumbBrowserBase () - : inspector(NULL), isInspectorActive(false), lastClicked(NULL), previewHeight(options.thumbSize), numOfCols(1) + : lastClicked(NULL), previewHeight(options.thumbSize), numOfCols(1), inspector(NULL), isInspectorActive(false), location(THLOC_FILEBROWSER) { - location = THLOC_FILEBROWSER; inW = -1; inH = -1; diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 673c49efe..5e2c7f28f 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -903,7 +903,7 @@ Glib::ustring Thumbnail::getCacheFileName (const Glib::ustring& subdir, const Gl return cachemgr->getCacheFileName (subdir, fname, fext, cfs.md5); } -void Thumbnail::setFileName (const Glib::ustring fn) +void Thumbnail::setFileName (const Glib::ustring &fn) { fname = fn; diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index 8656543f0..ca2f898ec 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -146,7 +146,7 @@ public: { return fname; } - void setFileName (const Glib::ustring fn); + void setFileName (const Glib::ustring &fn); bool isSupported ();