diff --git a/rtdata/languages/default b/rtdata/languages/default index da76c9387..a2acbba04 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -570,17 +570,13 @@ TP_DIRPYRDENOISE_CHROMA;Chrominance TP_DIRPYRDENOISE_GAMMA;Gamma TP_DIRPYRDENOISE_LABEL;Directional pyramid noise reduction TP_DIRPYRDENOISE_LUMA;Luminance -TP_DIRPYREQUALIZER_CHROMACOARSEST;chroma coarsest -TP_DIRPYREQUALIZER_CHROMACONTRAST_MINUS;Contrast- -TP_DIRPYREQUALIZER_CHROMACONTRAST_PLUS;Contrast+ -TP_DIRPYREQUALIZER_CHROMAFINEST;chroma finest -TP_DIRPYREQUALIZER_CHROMANEUTRAL;Neutral -TP_DIRPYREQUALIZER_LUMACOARSEST;luma coarsest +TP_DIRPYREQUALIZER_LUMACOARSEST;Coarsest TP_DIRPYREQUALIZER_LUMACONTRAST_MINUS;Contrast- TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS;Contrast+ -TP_DIRPYREQUALIZER_LUMAFINEST;luma finest +TP_DIRPYREQUALIZER_LUMAFINEST;Finest TP_DIRPYREQUALIZER_LUMANEUTRAL;Neutral TP_DIRPYREQUALIZER_LABEL;Directional pyramid equalizer +TP_DIRPYREQUALIZER_THRESHOLD;Threshold TP_DISTORTION_AMOUNT;Amount TP_DISTORTION_LABEL;Distortion TP_EQUALIZER_CONTRAST_MINUS;Contrast- diff --git a/rtdata/options/options.lin b/rtdata/options/options.lin index e02431966..aa64fe988 100644 --- a/rtdata/options/options.lin +++ b/rtdata/options/options.lin @@ -65,8 +65,8 @@ SaveParamsToCache=true LoadParamsFromLocation=0 [GUI] -WindowWidth=1000 -WindowHeight=900 +WindowWidth=900 +WindowHeight=560 WindowMaximized=false FileBrowserHeight=250 ToolPanelWidth=300 diff --git a/rtdata/options/options.osx b/rtdata/options/options.osx index 005fd0064..a7c5e6ec3 100644 --- a/rtdata/options/options.osx +++ b/rtdata/options/options.osx @@ -65,8 +65,8 @@ SaveParamsToCache=true LoadParamsFromLocation=0 [GUI] -WindowWidth=1000 -WindowHeight=900 +WindowWidth=900 +WindowHeight=560 WindowMaximized=false FileBrowserHeight=250 ToolPanelWidth=300 diff --git a/rtdata/options/options.win b/rtdata/options/options.win index 9975d8e34..f589ba814 100644 --- a/rtdata/options/options.win +++ b/rtdata/options/options.win @@ -65,8 +65,8 @@ SaveParamsToCache=true LoadParamsFromLocation=0 [GUI] -WindowWidth=1000 -WindowHeight=900 +WindowWidth=900 +WindowHeight=560 WindowMaximized=false FileBrowserHeight=250 ToolPanelWidth=300 diff --git a/rtdata/themes/ClearLooks (Dark Orange) b/rtdata/themes/ClearLooks (Dark Orange) index 74f839aed..dc86995e6 100644 --- a/rtdata/themes/ClearLooks (Dark Orange) +++ b/rtdata/themes/ClearLooks (Dark Orange) @@ -23,6 +23,7 @@ style "clearlooks-default" { + font_name = "sans 8" GtkMenuItem::selected_shadow_type = none GtkWidget::interior_focus = 1 GtkButton::default_border = { 3, 3, 3, 3 } diff --git a/rtdata/themes/Dark b/rtdata/themes/Dark index 11e332b29..3d1d6dded 100644 --- a/rtdata/themes/Dark +++ b/rtdata/themes/Dark @@ -26,7 +26,7 @@ style "clearlooks-default" { - font_name = "tahoma 8" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkComboBox ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 0 diff --git a/rtdata/themes/Default b/rtdata/themes/Default index 9693e0ba5..600eeefa2 100644 --- a/rtdata/themes/Default +++ b/rtdata/themes/Default @@ -26,7 +26,7 @@ style "clearlooks-default" { -font_name = "tahoma 8" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 0 GtkPaned ::handle_size = 6 diff --git a/rtdata/themes/Gray b/rtdata/themes/Gray index 12e794db5..9a5cf0170 100644 --- a/rtdata/themes/Gray +++ b/rtdata/themes/Gray @@ -19,7 +19,7 @@ style "theme-default" { - font_name = "tahoma 12" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 1 diff --git a/rtdata/themes/Gray Textured b/rtdata/themes/Gray Textured index 1576fcba2..f906abd87 100644 --- a/rtdata/themes/Gray Textured +++ b/rtdata/themes/Gray Textured @@ -32,7 +32,7 @@ style "clearlooks-default" # change it to use an actual font, enter the full name of the font # here, along with optional style and size, e.g. # "Monaco Bold 15". - font_name = "Default" + font_name = "sans 10" GtkRange::trough_border = 0 GtkRange::slider_width = 14 diff --git a/rtdata/themes/Light b/rtdata/themes/Light index 92064a2a2..05e7d6621 100644 --- a/rtdata/themes/Light +++ b/rtdata/themes/Light @@ -23,7 +23,7 @@ style "clearlooks-default" { -font_name = "sans 8" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 0 GtkPaned ::handle_size = 6 diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index b1c4e4b68..86ca4a973 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -227,14 +227,16 @@ void RawImageSource::CA_correct_RT() { // block CA shifts blockwt = (float (*)) (buffer1); blockshifts = (float (*)[3][2]) (buffer1+(vblsz*hblsz*sizeof(float))); - - - + + int vctr=0, hctr=0; // Main algorithm: Tile loop //#pragma omp parallel for shared(image,height,width) private(top,left,indx,indx1) schedule(dynamic) - for (top=-border, vblock=1; top < height; top += TS-border2, vblock++) + for (top=-border, vblock=1; top < height; top += TS-border2, vblock++) { + hctr=0; + vctr++; for (left=-border, hblock=1; left < width; left += TS-border2, hblock++) { + hctr++; int bottom = MIN( top+TS,height+border); int right = MIN(left+TS, width+border); int rr1 = bottom - top; @@ -376,6 +378,8 @@ void RawImageSource::CA_correct_RT() { grblpfh[indx] = glpfh + 0.25*(2*rgb[indx][c]+rgb[indx+2][c]+rgb[indx-2][c]); } + for (c=0;c<3;c++) {areawt[0][c]=areawt[1][c]=0;} + // along line segments, find the point along each segment that minimizes the color variance // averaged over the tile; evaluate for up/down and left/right away from R/B grid point for (rr=8; rr < rr1-8; rr++) @@ -383,8 +387,6 @@ void RawImageSource::CA_correct_RT() { if (rgb[indx][c]>0.8*clip_pt || Gtmp[indx]>0.8*clip_pt) continue; - areawt[0][c]=areawt[1][c]=0; - //in linear interpolation, color differences are a quadratic function of interpolation position; //solve for the interpolation position that minimizes color difference variance over the tile @@ -393,24 +395,24 @@ void RawImageSource::CA_correct_RT() { deltgrb=(rgb[indx][c]-rgb[indx][1])-0.5*((rgb[indx-v4][c]-rgb[indx-v4][1])+(rgb[indx+v4][c]-rgb[indx+v4][1])); gradwt=fabs(0.25*rbhpfv[indx]+0.125*(rbhpfv[indx+2]+rbhpfv[indx-2]) );//*(grblpfv[indx-v2]+grblpfv[indx+v2])/(eps+0.1*grblpfv[indx-v2]+rblpfv[indx-v2]+0.1*grblpfv[indx+v2]+rblpfv[indx+v2]); - + if (gradwt>eps) { coeff[0][0][c] += gradwt*deltgrb*deltgrb; coeff[0][1][c] += gradwt*gdiff*deltgrb; coeff[0][2][c] += gradwt*gdiff*gdiff; - areawt[0][c]+=1; - + areawt[0][c]++; + } //horizontal gdiff=0.3125*(rgb[indx+1][1]-rgb[indx-1][1])+0.09375*(rgb[indx+1+TS][1]-rgb[indx-1+TS][1]+rgb[indx+1-TS][1]-rgb[indx-1-TS][1]); deltgrb=(rgb[indx][c]-rgb[indx][1])-0.5*((rgb[indx-4][c]-rgb[indx-4][1])+(rgb[indx+4][c]-rgb[indx+4][1])); gradwt=fabs(0.25*rbhpfh[indx]+0.125*(rbhpfh[indx+v2]+rbhpfh[indx-v2]) );//*(grblpfh[indx-2]+grblpfh[indx+2])/(eps+0.1*grblpfh[indx-2]+rblpfh[indx-2]+0.1*grblpfh[indx+2]+rblpfh[indx+2]); - + if (gradwt>eps) { coeff[1][0][c] += gradwt*deltgrb*deltgrb; coeff[1][1][c] += gradwt*gdiff*deltgrb; coeff[1][2][c] += gradwt*gdiff*gdiff; - areawt[1][c]+=1; - + areawt[1][c]++; + } // In Mathematica, // f[x_]=Expand[Total[Flatten[ @@ -419,8 +421,8 @@ void RawImageSource::CA_correct_RT() { } for (c=0; c<3; c+=2){ for (j=0; j<2; j++) {// vert/hor - - if (areawt[j][c]>0) { + //printf("hblock %d vblock %d j %d c %d areawt %d \n",hblock,vblock,j,c,areawt[j][c]); + if (areawt[j][c]>500) { CAshift[j][c]=coeff[j][1][c]/coeff[j][2][c]; blockwt[vblock*hblsz+hblock]= areawt[j][c];//*coeff[j][2][c]/(eps+coeff[j][0][c]) ; } else { @@ -467,6 +469,7 @@ void RawImageSource::CA_correct_RT() { if(plistener) plistener->setProgress(0.5*fabs((float)top/height)); } + } //end of diagnostic pass for (j=0; j<2; j++) @@ -541,14 +544,15 @@ void RawImageSource::CA_correct_RT() { if (SQR(blockshifts[(vblock)*hblsz+hblock][c][0])>4.0*blockvar[0][c] || SQR(blockshifts[(vblock)*hblsz+hblock][c][1])>4.0*blockvar[1][c]) continue; numblox[c] += 1; for (dir=0; dir<2; dir++) { - for (i=0; iclip_pt || Gtmp[indx]>clip_pt) continue; grbdiffold = rgb[indx][1]-rgb[indx][c]; - + //interpolate color difference from optical R/B locations to grid locations grbdiffinthfloor=(1-shifthfrac[c]/2)*grbdiff[indx]+(shifthfrac[c]/2)*grbdiff[indx-2*GRBdir[1][c]]; grbdiffinthceil=(1-shifthfrac[c]/2)*grbdiff[(rr-2*GRBdir[0][c])*TS+cc]+(shifthfrac[c]/2)*grbdiff[(rr-2*GRBdir[0][c])*TS+cc-2*GRBdir[1][c]]; diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index e1d1cd257..cfa804fa9 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -13,7 +13,7 @@ set (RTENGINESOURCEFILES colortemp.cc curves.cc dcraw.cc iccstore.cc dfmanager.c stdimagesource.cc myfile.cc iccjpeg.c hlmultipliers.cc improccoordinator.cc processingjob.cc rtthumbnail.cc utils.cc labimage.cc slicer.cc iplab2rgb.cc ipsharpen.cc iptransform.cc ipresize.cc - wavelet_dec.cc ipequalizer.cc dirpyrLab_denoise.cc dirpyrLab_equalizer.cc) + wavelet_dec.cc ipequalizer.cc dirpyrLab_denoise.cc dirpyrLab_equalizer.cc dirpyr_equalizer.cc) add_library (rtengine ${RTENGINESOURCEFILES}) #It may be nice to store library version too diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 58d7f5bc8..0c5c1a015 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -9382,29 +9382,29 @@ t5.set (); double d = tpp->defGain * image[i* ::width+j][1]; if (d>64000) continue; - avg_g += d*d*d*d*d*d; + avg_g += d; gn++; } if (FISRED(filter,i,j)) { double d = tpp->defGain * image[i* ::width+j][0]; if (d>64000) continue; - avg_r += d*d*d*d*d*d; + avg_r += d; rn++; } if (FISBLUE(filter,i,j)) { double d = tpp->defGain * image[i* ::width+j][2]; if (d>64000) continue; - avg_b += d*d*d*d*d*d; + avg_b += d; bn++; } } } - double reds = pow (avg_r/rn, 1.0/6.0) * tpp->camwbRed; - double greens = pow (avg_g/gn, 1.0/6.0) * tpp->camwbGreen; - double blues = pow (avg_b/bn, 1.0/6.0) * tpp->camwbBlue; + double reds = avg_r/rn * tpp->camwbRed; + double greens = avg_g/gn * tpp->camwbGreen; + double blues = avg_b/bn * tpp->camwbBlue; double rm = rgb_cam[0][0]*reds + rgb_cam[0][1]*greens + rgb_cam[0][2]*blues; double gm = rgb_cam[1][0]*reds + rgb_cam[1][1]*greens + rgb_cam[1][2]*blues; diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch index e00393219..826580dff 100644 --- a/rtengine/dcraw.patch +++ b/rtengine/dcraw.patch @@ -661,29 +661,29 @@ + double d = tpp->defGain * image[i* ::width+j][1]; + if (d>64000) + continue; -+ avg_g += d*d*d*d*d*d; ++ avg_g += d; + gn++; + } + if (FISRED(filter,i,j)) { + double d = tpp->defGain * image[i* ::width+j][0]; + if (d>64000) + continue; -+ avg_r += d*d*d*d*d*d; ++ avg_r += d; + rn++; + } + if (FISBLUE(filter,i,j)) { + double d = tpp->defGain * image[i* ::width+j][2]; + if (d>64000) + continue; -+ avg_b += d*d*d*d*d*d; ++ avg_b += d; + bn++; + } + } + } + -+ double reds = pow (avg_r/rn, 1.0/6.0) * tpp->camwbRed; -+ double greens = pow (avg_g/gn, 1.0/6.0) * tpp->camwbGreen; -+ double blues = pow (avg_b/bn, 1.0/6.0) * tpp->camwbBlue; ++ double reds = avg_r/rn * tpp->camwbRed; ++ double greens = avg_g/gn * tpp->camwbGreen; ++ double blues = avg_b/bn * tpp->camwbBlue; + + double rm = rgb_cam[0][0]*reds + rgb_cam[0][1]*greens + rgb_cam[0][2]*blues; + double gm = rgb_cam[1][0]*reds + rgb_cam[1][1]*greens + rgb_cam[1][2]*blues; diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc new file mode 100644 index 000000000..67ce8f1f0 --- /dev/null +++ b/rtengine/dirpyr_equalizer.cc @@ -0,0 +1,286 @@ +/* + * This file is part of RawTherapee. + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + * + * © 2010 Emil Martinec + * + */ + +//#include +#include +#include +#include +#include +#include +#include + +#ifdef _OPENMP +#include +#endif + +#define SQR(x) ((x)*(x)) +#define CLIPTO(a,b,c) ((a)>(b)?((a)<(c)?(a):(c)):(b)) +#define CLIPC(a) ((a)>-32000?((a)<32000?(a):32000):-32000) +#define CLIP(a) (CLIPTO(a,0,65535)) + + + +#define DIRWT(i1,j1,i,j) ( domker[(i1-i)/scale+halfwin][(j1-j)/scale+halfwin] * rangefn[abs((int)data_fine[i1][j1]-data_fine[i][j])] ) + +namespace rtengine { + + static const int maxlevel = 4; + static const float noise = 2000; + static const float thresh = 1000; + + //sequence of scales + static const int scales[8] = {1,2,4,8,16,32,64,128}; + + //sequence of scales + //static const int scales[8] = {1,2,3,6,15,21,28,36}; + //scale is spacing of directional averaging weights + + + void ImProcFunctions :: dirpyr_equalizer(unsigned short ** src, unsigned short ** dst, int srcwidth, int srcheight, const double * mult ) + { + int lastlevel=maxlevel; + + while (fabs(mult[lastlevel-1]-1)<0.001 && lastlevel>0) { + lastlevel--; + //printf("last level to process %d \n",lastlevel); + } + if (lastlevel==0) return; + + /*float gam = 2.0;//MIN(3.0, 0.1*fabs(c[4])/3.0+0.001); + float gamthresh = 0.03; + float gamslope = exp(log((double)gamthresh)/gam)/gamthresh; + unsigned short gamcurve[65536]; + for (int i=0; i<65536; i++) { + int g = (int)(CurveFactory::gamma((double)i/65535.0, gam, gamthresh, gamslope, 1.0, 0.0) * 65535.0); + //if (i<500) printf("%d %d \n",i,g); + gamcurve[i] = CLIP(g); + } + + + //#pragma omp parallel for if (multiThread) + for (int i=0; iH; i++) { + for (int j=0; jW; j++) { + src[i][j] = gamcurve[src[i][j] ]; + } + }*/ + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + int * rangefn = new int [0x20000]; + + int intfactor = 1024;//16384; + + + //set up range functions + + for (int i=0; i<0x10000; i++) { + rangefn[i] = (int)((thresh/((double)(i) + thresh))*intfactor); + //rangefn[i] = (int)(exp(-(double)abs(i)/(5*thresh))*(thresh/((double)(i) + thresh))*intfactor); + //rangefn[i] = (int)((thresh*thresh/((double)(i)*(double)(i) + thresh*thresh))*intfactor); + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + int level; + int ** buffer; + + unsigned short ** dirpyrlo[maxlevel]; + + + buffer = allocArray (srcwidth, srcheight); + + for (int i=0; i (srcwidth, srcheight); + + dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, rangefn, 0, scale, mult ); + + level = 1; + + while(level < lastlevel) + { + scale = scales[level]; + + dirpyrlo[level] = allocArray(srcwidth, srcheight); + + dirpyr_channel(dirpyrlo[level-1], dirpyrlo[level], srcwidth, srcheight, rangefn, level, scale, mult ); + + level ++; + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //initiate buffer for final image + for(int i = 0; i < srcheight; i++) + for(int j = 0; j < srcwidth; j++) { + + //copy pixels + buffer[i][j] = dirpyrlo[lastlevel-1][i][j]; + + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + for(int level = lastlevel - 1; level > 0; level--) + { + idirpyr_eq_channel(dirpyrlo[level], dirpyrlo[level-1], buffer, srcwidth, srcheight, level, mult ); + } + + + scale = scales[0]; + + idirpyr_eq_channel(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, mult ); + + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + /*float igam = 1/gam; + float igamthresh = gamthresh*gamslope; + float igamslope = 1/gamslope; + for (int i=0; i<65536; i++) { + int g = (int)(CurveFactory::gamma((float)i/65535.0, igam, igamthresh, igamslope, 1.0, 0.0) * 65535.0); + gamcurve[i] = CLIP(g); + }*/ + + + for (int i=0; iL[i][j] ]; + + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + for(int i = 0; i < lastlevel; i++) + { + freeArray(dirpyrlo[i], srcheight); + } + + freeArray(buffer, srcheight); + + delete [] rangefn; + + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + }; + + void ImProcFunctions::dirpyr_channel(unsigned short ** data_fine, unsigned short ** data_coarse, int width, int height, int * rangefn, int level, int scale, const double * mult ) + { + //scale is spacing of directional averaging weights + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + // calculate weights, compute directionally weighted average + + int halfwin=2; + int domker[5][5] = {{1,1,1,1,1},{1,2,2,2,1},{1,2,2,2,1},{1,2,2,2,1},{1,1,1,1,1}}; + + //generate domain kernel + if (level<2) { + halfwin = 1; + domker[1][1]=domker[1][2]=domker[2][1]=domker[2][2]=1; + } + + + int scalewin = halfwin*scale; + +#ifdef _OPENMP +#pragma omp parallel for +#endif + for(int i = 0; i < height; i++) { + for(int j = 0; j < width; j++) + { + float val=0; + float norm=0; + + for(int inbr=MAX(0,i-scalewin); inbr<=MIN(height-1,i+scalewin); inbr+=scale) { + for (int jnbr=MAX(0,j-scalewin); jnbr<=MIN(width-1,j+scalewin); jnbr+=scale) { + float dirwt = DIRWT(inbr, jnbr, i, j); + val += dirwt*data_fine[inbr][jnbr]; + norm += dirwt; + } + } + data_coarse[i][j]=val/norm;//low pass filter + } + } + + + + + }; + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + void ImProcFunctions::idirpyr_eq_channel(unsigned short ** data_coarse, unsigned short ** data_fine, int ** buffer, int width, int height, int level, const double * mult ) + { + int hipass; + + float noisehi = 1.33*noise*mult[4]/pow(3,level), noiselo = 0.66*noise*mult[4]/pow(3,level); + float * irangefn = new float [0x20000]; + + for (int i=0; i<0x20000; i++) { + if (abs(i-0x10000)>noisehi || mult[level]<1.0) { + irangefn[i] = mult[level] ; + } else { + if (abs(i-0x10000)getSpotWB (red, green, blue, tr); + currWB = ColorTemp (params.wb.temperature, params.wb.green); mProcessing.unlock (); - temp = ret.getTemp (); - tgreen = ret.getGreen (); + if (ret.getTemp() > 0) { + temp = ret.getTemp (); + tgreen = ret.getGreen (); + } else { + temp = currWB.getTemp (); + tgreen = currWB.getGreen (); + } } void ImProcCoordinator::getAutoCrop (double ratio, int &x, int &y, int &w, int &h) { diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 58c323b05..7b11e1a79 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -449,7 +449,9 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) { if (params->dirpyrequalizer.enabled && lab->W>=8 && lab->H>=8) { - dirpyrLab_equalizer(lab, lab, params->dirpyrequalizer.mult); + //dirpyrLab_equalizer(lab, lab, params->dirpyrequalizer.mult); + dirpyr_equalizer(lab->L, lab->L, lab->W, lab->H, params->dirpyrequalizer.mult); + } } diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index bfbdb98f0..d065cfac3 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -104,6 +104,10 @@ class ImProcFunctions { void dirpyr_eq(LabImage* data_coarse, LabImage* data_fine, int * rangefn, int level, int pitch, int scale, const double * mult ); void idirpyr_eq(LabImage* data_coarse, LabImage* data_fine, int *** buffer, int * irangefn, int level, int pitch, int scale, const double * mult ); + void dirpyr_equalizer(unsigned short ** src, unsigned short ** dst, int srcwidth, int srcheight, const double * mult );//Emil's directional pyramid equalizer + void dirpyr_channel(unsigned short ** data_fine, unsigned short ** data_coarse, int width, int height, int * rangefn, int level, int scale, const double * mult ); + void idirpyr_eq_channel(unsigned short ** data_coarse, unsigned short ** data_fine, int ** buffer, int width, int height, int level, const double * mult ); + Image8* lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, Glib::ustring profile); Image16* lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int ch, Glib::ustring profile); diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 295478d96..d3bf3ee53 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -175,10 +175,11 @@ void ProcParams::setDefaults () { equalizer.c[i] = 0; } dirpyrequalizer.enabled = false; - for(int i = 0; i < 8; i ++) + for(int i = 0; i < 4; i ++) { dirpyrequalizer.mult[i] = 1.0; } + dirpyrequalizer.mult[4] = 0.0; raw.df_autoselect = false; raw.ca_autocorrect = false; raw.hotdeadpix_filt = false; @@ -357,7 +358,7 @@ int ProcParams::save (Glib::ustring fname) const { // save directional pyramid equalizer parameters keyFile.set_boolean ("Directional Pyramid Equalizer", "Enabled", dirpyrequalizer.enabled); - for(int i = 0; i < 8; i++) + for(int i = 0; i < 5; i++) { std::stringstream ss; ss << "Mult" << i; @@ -630,7 +631,7 @@ if (keyFile.has_group ("Equalizer")) { // load directional pyramid equalizer parameters if (keyFile.has_group ("Directional Pyramid Equalizer")) { if (keyFile.has_key ("Directional Pyramid Equalizer", "Enabled")) dirpyrequalizer.enabled = keyFile.get_boolean ("Directional Pyramid Equalizer", "Enabled"); - for(int i = 0; i < 8; i ++) + for(int i = 0; i < 5; i ++) { std::stringstream ss; ss << "Mult" << i; @@ -700,7 +701,7 @@ bool operator==(const DirPyrEqualizerParams & a, const DirPyrEqualizerParams & b if(a.enabled != b.enabled) return false; - for(int i = 0; i < 8; i++) { + for(int i = 0; i < 5; i++) { if(a.mult[i] != b.mult[i]) return false; } diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 1833076b2..1b1cd4443 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1994,111 +1994,114 @@ int RawImageSource::getAEHistogram (unsigned int* histogram, int& histcompr) { } } return 1; -} - -ColorTemp RawImageSource::getAutoWB () { - - double avg_r = 0; - double avg_g = 0; - double avg_b = 0; - int rn = 0, gn = 0, bn = 0; - - if (fuji) { - for (int i=32; iheight-32; i++) { - int fw = ri->fuji_width; - int start = ABS(fw-i) + 32; - int end = MIN(ri->height+ri->width-fw-i, fw+i) - 32; - for (int j=start; jfilters) { - double d = CLIP(ri->defgain*rawData[i][3*j]); - if (d>64000) - continue; - avg_r += d*d*d*d*d*d; rn++; - d = CLIP(ri->defgain*rawData[i][3*j+1]); - if (d>64000) - continue; - avg_g += d*d*d*d*d*d; gn++; - d = CLIP(ri->defgain*rawData[i][3*j+2]); - if (d>64000) - continue; - avg_b += d*d*d*d*d*d; bn++; - } - else { - double d = CLIP(ri->defgain*rawData[i][j]); - if (d>64000) - continue; - double dp = d*d*d*d*d*d; - if (ISRED(ri,i,j)) { - avg_r += dp; - rn++; - } - else if (ISGREEN(ri,i,j)) { - avg_g += dp; - gn++; - } - else if (ISBLUE(ri,i,j)) { - avg_b += dp; - bn++; - } - } - } - } - } - else { - for (int i=32; iheight-32; i++) - for (int j=32; jwidth-32; j++) { - if (!ri->filters) { - double d = CLIP(ri->defgain*rawData[i][3*j]); - if (d>64000) - continue; - avg_r += d*d*d*d*d*d; rn++; - d = CLIP(ri->defgain*rawData[i][3*j+1]); - if (d>64000) - continue; - avg_g += d*d*d*d*d*d; gn++; - d = CLIP(ri->defgain*rawData[i][3*j+2]); - if (d>64000) - continue; - avg_b += d*d*d*d*d*d; bn++; - } - else { - double d = CLIP(ri->defgain*rawData[i][j]); - if (d>64000) - continue; - double dp = d*d*d*d*d*d; - if (ISRED(ri,i,j)) { - avg_r += dp; - rn++; - } - else if (ISGREEN(ri,i,j)) { - avg_g += dp; - gn++; - } - else if (ISBLUE(ri,i,j)) { - avg_b += dp; - bn++; - } - } - } - } - - printf ("AVG: %g %g %g\n", avg_r/rn, avg_g/gn, avg_b/bn); - -// double img_r, img_g, img_b; -// wb.getMultipliers (img_r, img_g, img_b); - -// return ColorTemp (pow(avg_r/rn, 1.0/6.0)*img_r, pow(avg_g/gn, 1.0/6.0)*img_g, pow(avg_b/bn, 1.0/6.0)*img_b); - - double reds = pow (avg_r/rn, 1.0/6.0) * camwb_red; - double greens = pow (avg_g/gn, 1.0/6.0) * camwb_green; - double blues = pow (avg_b/bn, 1.0/6.0) * camwb_blue; - - double rm = coeff[0][0]*reds + coeff[0][1]*greens + coeff[0][2]*blues; - double gm = coeff[1][0]*reds + coeff[1][1]*greens + coeff[1][2]*blues; - double bm = coeff[2][0]*reds + coeff[2][1]*greens + coeff[2][2]*blues; - - return ColorTemp (rm, gm, bm); -} +} + + ColorTemp RawImageSource::getAutoWB () { + + double avg_r = 0; + double avg_g = 0; + double avg_b = 0; + int rn = 0, gn = 0, bn = 0; + + if (fuji) { + for (int i=32; iheight-32; i++) { + int fw = ri->fuji_width; + int start = ABS(fw-i) + 32; + int end = MIN(ri->height+ri->width-fw-i, fw+i) - 32; + for (int j=start; jfilters) { + double d = CLIP(ri->defgain*ri->data[i][3*j]); + if (d>64000) + continue; + avg_r += d; rn++; + d = CLIP(ri->defgain*ri->data[i][3*j+1]); + if (d>64000) + continue; + avg_g += d; gn++; + d = CLIP(ri->defgain*ri->data[i][3*j+2]); + if (d>64000) + continue; + avg_b += d; bn++; + } + else { + double d = CLIP(ri->defgain*ri->data[i][j]); + if (d>64000) + continue; + double dp = d; + if (ISRED(ri,i,j)) { + avg_r += dp; + rn++; + } + else if (ISGREEN(ri,i,j)) { + avg_g += dp; + gn++; + } + else if (ISBLUE(ri,i,j)) { + avg_b += dp; + bn++; + } + } + } + } + } + else { + if (!ri->filters) { + for (int i=32; iheight-32; i++) + for (int j=32; jwidth-32; j++) { + double dr = CLIP(ri->defgain*ri->data[i][3*j]); + double dg = CLIP(ri->defgain*ri->data[i][3*j+1]); + double db = CLIP(ri->defgain*ri->data[i][3*j+2]); + if (dr>64000 || dg>64000 || db>64000) continue; + avg_r += dr; rn++; + avg_g += dg; + avg_b += db; + } + gn = rn; bn=rn; + } else { + //determine GRBG coset; (ey,ex) is the offset of the R subarray + int ey, ex; + if (ISGREEN(ri,0,0)) {//first pixel is G + if (ISRED(ri,0,1)) {ey=0; ex=1;} else {ey=1; ex=0;} + } else {//first pixel is R or B + if (ISRED(ri,0,0)) {ey=0; ex=0;} else {ey=1; ex=1;} + } + double d[2][2]; + for (int i=32; iheight-32; i+=2) + for (int j=32; jwidth-32; j+=2) { + //average a Bayer quartet if nobody is clipped + d[0][0] = CLIP(ri->defgain*ri->data[i][j]); + d[0][1] = CLIP(ri->defgain*ri->data[i][j+1]); + d[1][0] = CLIP(ri->defgain*ri->data[i+1][j]); + d[1][1] = CLIP(ri->defgain*ri->data[i+1][j+1]); + if ( d[0][0]>64000 || d[0][1]>64000 || d[1][0]>64000 || d[1][1]>64000 ) continue; + avg_r += d[ey][ex]; + avg_g += d[1-ey][ex] + d[ey][1-ex]; + avg_b += d[1-ey][1-ex]; + rn++; + } + gn = 2*rn; + bn = rn; + } + } + + printf ("AVG: %g %g %g\n", avg_r/rn, avg_g/gn, avg_b/bn); + + // double img_r, img_g, img_b; + // wb.getMultipliers (img_r, img_g, img_b); + + // return ColorTemp (pow(avg_r/rn, 1.0/6.0)*img_r, pow(avg_g/gn, 1.0/6.0)*img_g, pow(avg_b/bn, 1.0/6.0)*img_b); + + double reds = avg_r/rn * camwb_red; + double greens = avg_g/gn * camwb_green; + double blues = avg_b/bn * camwb_blue; + + double rm = coeff[0][0]*reds + coeff[0][1]*greens + coeff[0][2]*blues; + double gm = coeff[1][0]*reds + coeff[1][1]*greens + coeff[1][2]*blues; + double bm = coeff[2][0]*reds + coeff[2][1]*greens + coeff[2][2]*blues; + + return ColorTemp (rm, gm, bm); + } + void RawImageSource::transformPosition (int x, int y, int tran, int& ttx, int& tty) { @@ -2156,77 +2159,83 @@ void RawImageSource::transformPosition (int x, int y, int tran, int& ttx, int& t tty = ty; } } + ColorTemp RawImageSource::getSpotWB (std::vector red, std::vector green, std::vector& blue, int tran) { int x; int y; - int d[9][2] = {{0,0}, {-1,-1}, {-1,0}, {-1,1}, {0,-1}, {0,1}, {1,-1}, {1,0}, {1,1}}; double reds = 0, greens = 0, blues = 0; - int rn = 0, gn = 0, bn = 0; + int rn = 0; if (!ri->filters) { + int xmin, xmax, ymin, ymax; + int xr, xg, xb, yr, yg, yb; for (int i=0; i=0 && y>=0 && x=0 && y>=0 && x=0 && y>=0 && xdefgain*ri->data[y][3*x]>52500 || ri->defgain*ri->data[y][3*x+1]>52500 || ri->defgain*ri->data[y][3*x+2]>52500) continue; + xmin = MIN(xr,MIN(xg,xb)); + xmax = MAX(xr,MAX(xg,xb)); + ymin = MIN(yr,MIN(yg,yb)); + ymax = MAX(yr,MAX(yg,yb)); + if (xmin>=0 && ymin>=0 && xmaxdata[yr][3*xr]; + greens += ri->data[yg][3*xg+1]; + blues += ri->data[yb][3*xb+2]; + rn++; } } + + } else { + + int d[9][2] = {{0,0}, {-1,-1}, {-1,0}, {-1,1}, {0,-1}, {0,1}, {1,-1}, {1,0}, {1,1}}; + int rloc, gloc, bloc, rnbrs, gnbrs, bnbrs; + for (int i=0; i=0 && yv>=0 && xvdata[yv][xv]; + rnbrs++; + continue; + } + if (ISGREEN(ri,yv,xv) && xv>=0 && yv>=0 && xvdata[yv][xv]; + gnbrs++; + continue; + } + if (ISBLUE(ri,yv,xv) && xv>=0 && yv>=0 && xvdata[yv][xv]; + bnbrs++; + continue; + } + } + rloc /= rnbrs; gloc /= gnbrs; bloc /= bnbrs; + if (rloc*ri->defgain<64000 && gloc*ri->defgain<64000 && bloc*ri->defgain<64000) { + reds += rloc; greens += gloc; blues += bloc; rn++; + } + //transformPosition (green[i].x, green[i].y, tran, x, y);//these are redundant now ??? if not, repeat for these blocks same as for red[] + //transformPosition (blue[i].x, blue[i].y, tran, x, y); + } } - else { - for (int i=0; i=0 && yv>=0 && xv=0 && yv>=0 && xv=0 && yv>=0 && xvheight-1; i++) for (int j=1; jwidth-1; j++) { int ofs = 3*(i*img->width + j); - if (img->data[ofs]>250 || img->data[ofs+1]>250 || img->data[ofs+2]>250) + int rtmp=img->data[ofs], gtmp=img->data[ofs+1], btmp=img->data[ofs+2]; + if (rtmp>64000 || gtmp>64000 || btmp>64000) continue; - avg_r += StdImageSource::intpow((double)img->data[ofs]*256, p); - avg_g += StdImageSource::intpow((double)img->data[ofs+1]*256, p); - avg_b += StdImageSource::intpow((double)img->data[ofs+2]*256, p); + avg_r += rtmp; + avg_g += gtmp; + avg_b += btmp; n++; } - ColorTemp::mul2temp (pow(avg_r/n, 1.0/p), pow(avg_g/n, 1.0/p), pow(avg_b/n, 1.0/p), tpp->autowbTemp, tpp->autowbGreen); + if (n>0) + ColorTemp::mul2temp (avg_r/n, avg_g/n, avg_b/n, tpp->autowbTemp, tpp->autowbGreen); delete img; tpp->init (); diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index abc862081..16096580a 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -475,7 +475,8 @@ ColorTemp StdImageSource::getAutoWB () { avg_b += intpow((double)img->b[i][j], p); n++; } - return ColorTemp (pow(avg_r/n, 1.0/p), pow(avg_g/n, 1.0/p), pow(avg_b/n, 1.0/p)); + return ColorTemp (avg_r/n, avg_g/n, avg_b/n); + //return ColorTemp (pow(avg_r/n, 1.0/p), pow(avg_g/n, 1.0/p), pow(avg_b/n, 1.0/p)); } void StdImageSource::transformPixel (int x, int y, int tran, int& tx, int& ty) { diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index e42834067..c0988ccae 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -92,7 +92,7 @@ CropWindow::CropWindow (ImageArea* parent, rtengine::StagedImageProcessor* ipc_) minWidth = bsw + iw + 2*sideBorderWidth; - setSize (300, 300); + setSize (100, 100); cropHandler.newImage (ipc_); cropHandler.setPosition (0,0); cropHandler.setEnabled (true); diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index 3cad8853b..06630b951 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -60,56 +60,24 @@ DirPyrEqualizer::DirPyrEqualizer () : ToolPanel() { ss << " (" << M("TP_DIRPYREQUALIZER_LUMAFINEST") << ")"; if(i == 3) ss << " (" << M("TP_DIRPYREQUALIZER_LUMACOARSEST") << ")"; - - multiplier[i] = new Adjuster (ss.str(), 0, 4, 0.01, 1.0); + multiplier[i] = new Adjuster (ss.str(), 0, 4, 0.01, 1.0); multiplier[i]->setAdjusterListener(this); pack_start(*multiplier[i]); } - - show_all_children (); - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Gtk::HSeparator *separator3 = Gtk::manage (new Gtk::HSeparator()); pack_start(*separator3, Gtk::PACK_SHRINK, 2); - - Gtk::HBox * buttonBox2 = Gtk::manage (new Gtk::HBox()); - pack_start(*buttonBox2, Gtk::PACK_SHRINK, 2); - Gtk::Button * chromacontrastMinusButton = Gtk::manage (new Gtk::Button(M("TP_DIRPYREQUALIZER_CHROMACONTRAST_MINUS"))); - buttonBox2->pack_start(*chromacontrastMinusButton, Gtk::PACK_SHRINK, 2); - chromacontrastMinusPressedConn = chromacontrastMinusButton->signal_pressed().connect( sigc::mem_fun(*this, &DirPyrEqualizer::chromacontrastMinusPressed)); - - Gtk::Button * chromaneutralButton = Gtk::manage (new Gtk::Button(M("TP_DIRPYREQUALIZER_CHROMANEUTRAL"))); - buttonBox2->pack_start(*chromaneutralButton, Gtk::PACK_SHRINK, 2); - chromaneutralPressedConn = chromaneutralButton->signal_pressed().connect( sigc::mem_fun(*this, &DirPyrEqualizer::chromaneutralPressed)); - - Gtk::Button * chromacontrastPlusButton = Gtk::manage (new Gtk::Button(M("TP_DIRPYREQUALIZER_CHROMACONTRAST_PLUS"))); - buttonBox2->pack_start(*chromacontrastPlusButton, Gtk::PACK_SHRINK, 2); - chromacontrastPlusPressedConn = chromacontrastPlusButton->signal_pressed().connect( sigc::mem_fun(*this, &DirPyrEqualizer::chromacontrastPlusPressed)); - - buttonBox2->show_all_children(); - - Gtk::HSeparator *separator4 = Gtk::manage (new Gtk::HSeparator()); - pack_start(*separator4, Gtk::PACK_SHRINK, 2); - - for(int i = 0; i < 4; i++) - { - std::stringstream ss; - ss << i; - if(i == 0) - ss << " (" << M("TP_DIRPYREQUALIZER_CHROMAFINEST") << ")"; - if(i == 3) - ss << " (" << M("TP_DIRPYREQUALIZER_CHROMACOARSEST") << ")"; - - multiplier[i+4] = new Adjuster (ss.str(), 0, 4, 0.01, 1.0); - multiplier[i+4]->setAdjusterListener(this); - pack_start(*multiplier[i+4]); - } + std::stringstream ss; + ss << M("TP_DIRPYREQUALIZER_THRESHOLD") ; + multiplier[4] = new Adjuster (ss.str(), 0, 1, 0.01, 0.0); + multiplier[4]->setAdjusterListener(this); + pack_start(*multiplier[4]); + show_all_children (); - + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% } DirPyrEqualizer::~DirPyrEqualizer () { @@ -124,7 +92,7 @@ void DirPyrEqualizer::read (const ProcParams* pp, const ParamsEdited* pedited) { enabled->set_inconsistent (!pedited->dirpyrequalizer.enabled); - for(int i = 0; i < 8; i++) { + for(int i = 0; i < 5; i++) { multiplier[i]->setEditedState (pedited->dirpyrequalizer.mult[i] ? Edited : UnEdited); } } @@ -134,7 +102,7 @@ void DirPyrEqualizer::read (const ProcParams* pp, const ParamsEdited* pedited) { enaConn.block (false); lastEnabled = pp->dirpyrequalizer.enabled; - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 5; i++) { multiplier[i]->setValue(pp->dirpyrequalizer.mult[i]); } @@ -145,7 +113,7 @@ void DirPyrEqualizer::write (ProcParams* pp, ParamsEdited* pedited) { pp->dirpyrequalizer.enabled = enabled->get_active (); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 5; i++) { pp->dirpyrequalizer.mult[i] = multiplier[i]->getValue(); } @@ -153,7 +121,7 @@ void DirPyrEqualizer::write (ProcParams* pp, ParamsEdited* pedited) { pedited->dirpyrequalizer.enabled = !enabled->get_inconsistent(); - for(int i = 0; i < 8; i++) { + for(int i = 0; i < 5; i++) { pedited->dirpyrequalizer.mult[i] = multiplier[i]->getEditedState(); } } @@ -161,17 +129,17 @@ void DirPyrEqualizer::write (ProcParams* pp, ParamsEdited* pedited) { void DirPyrEqualizer::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 5; i++) { multiplier[i]->setDefault(defParams->dirpyrequalizer.mult[i]); } if (pedited) { - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 5; i++) { multiplier[i]->setDefaultEditedState(pedited->dirpyrequalizer.mult[i] ? Edited : UnEdited); } } else { - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 5; i++) { multiplier[i]->setDefaultEditedState(Irrelevant); } } @@ -181,7 +149,7 @@ void DirPyrEqualizer::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 5; i++) { multiplier[i]->showEditedCB(); } } @@ -192,7 +160,7 @@ void DirPyrEqualizer::adjusterChanged (Adjuster* a, double newval) { std::stringstream ss; ss << "("; int i; - for (i = 0; i < 8; i++) { + for (i = 0; i < 5; i++) { if (i > 0) { ss << ", "; } @@ -235,14 +203,6 @@ void DirPyrEqualizer::lumaneutralPressed () { } } -void DirPyrEqualizer::chromaneutralPressed () { - - for (int i = 4; i < 8; i++) { - multiplier[i]->setValue(1.0); - adjusterChanged(multiplier[i], 1.0); - } -} - void DirPyrEqualizer::lumacontrastPlusPressed () { @@ -253,14 +213,6 @@ void DirPyrEqualizer::lumacontrastPlusPressed () { } } -void DirPyrEqualizer::chromacontrastPlusPressed () { - - for (int i = 4; i < 8; i++) { - float inc = 0.05 * (8 - i); - multiplier[i]->setValue(multiplier[i]->getValue() + inc); - adjusterChanged(multiplier[i], multiplier[i]->getValue()); - } -} void DirPyrEqualizer::lumacontrastMinusPressed () { @@ -271,11 +223,4 @@ void DirPyrEqualizer::lumacontrastMinusPressed () { } } -void DirPyrEqualizer::chromacontrastMinusPressed () { - - for (int i = 4; i < 8; i++) { - float inc = -0.05 * (8 - i); - multiplier[i]->setValue(multiplier[i]->getValue() + inc); - adjusterChanged(multiplier[i], multiplier[i]->getValue()); - } -} + diff --git a/rtgui/dirpyrequalizer.h b/rtgui/dirpyrequalizer.h index ba7976a96..ddad93034 100644 --- a/rtgui/dirpyrequalizer.h +++ b/rtgui/dirpyrequalizer.h @@ -30,15 +30,12 @@ class DirPyrEqualizer : public Gtk::VBox, public AdjusterListener, public ToolPa protected: Gtk::CheckButton * enabled; - Adjuster* multiplier[8]; + Adjuster* multiplier[5]; sigc::connection enaConn; sigc::connection lumaneutralPressedConn; sigc::connection lumacontrastPlusPressedConn; sigc::connection lumacontrastMinusPressedConn; - sigc::connection chromaneutralPressedConn; - sigc::connection chromacontrastPlusPressedConn; - sigc::connection chromacontrastMinusPressedConn; bool lastEnabled; @@ -57,9 +54,6 @@ public: void lumaneutralPressed (); void lumacontrastPlusPressed (); void lumacontrastMinusPressed (); - void chromaneutralPressed (); - void chromacontrastPlusPressed (); - void chromacontrastMinusPressed (); }; #endif diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 4b5ace20c..4eba917f3 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -40,6 +40,7 @@ EditorPanel::EditorPanel () : beforePreviewHandler(NULL), beforeIarea(NULL), par // build left side panel leftbox = new Gtk::VBox (); leftbox->set_border_width (4); + leftbox->set_size_request(100,250); histogramPanel = Gtk::manage (new HistogramPanel ()); histogramPanel->set_size_request (-1, 150); @@ -122,6 +123,8 @@ EditorPanel::EditorPanel () : beforePreviewHandler(NULL), beforeIarea(NULL), par // build right side panel vboxright = new Gtk::VBox (false, 0); + vboxright->set_size_request(100,250); + vboxright->set_border_width (4); vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 4); vboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); @@ -187,12 +190,14 @@ EditorPanel::EditorPanel () : beforePreviewHandler(NULL), beforeIarea(NULL), par } Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ()); + vbfr->set_size_request(100,250); vbfr->add (*editbox); hpanedl->pack2(*vbfr, true, true); hpanedr->pack1(*hpanedl, true, true); hpanedr->pack2(*vboxright, false, true); - //hpanedr->set_position(options.toolPanelWidth); + hpanedl->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::leftPaneButtonReleased) ); + hpanedr->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::rightPaneButtonReleased) ); pack_start (*hpanedr); show_all (); @@ -263,6 +268,43 @@ EditorPanel::~EditorPanel () { delete saveAsDialog; } +void EditorPanel::leftPaneButtonReleased(GdkEventButton *event) { + if (event->button == 1) { + // Button 1 released : it's a resize + options.historyPanelWidth = hpanedl->get_position(); + } + /*else if (event->button == 3) { + }*/ +} + +void EditorPanel::rightPaneButtonReleased(GdkEventButton *event) { + if (event->button == 1) { + int winW, winH; + parent->get_size(winW, winH); + // Button 1 released : it's a resize + options.toolPanelWidth = winW - hpanedr->get_position(); + } + /*else if (event->button == 3) { + }*/ +} + +void EditorPanel::setAspect () { + int winW, winH; + parent->get_size(winW, winH); + hpanedl->set_position(options.historyPanelWidth); + hpanedr->set_position(winW - options.toolPanelWidth); + // initialize components + if (info->get_active() != options.showInfo) + info->set_active (options.showInfo); +} + +void EditorPanel::on_realize () { + + Gtk::VBox::on_realize (); + // This line is needed to avoid autoexpansion of the window :-/ + vboxright->set_size_request (options.toolPanelWidth, -1); +} + void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) { // initialize everything @@ -849,12 +891,10 @@ bool EditorPanel::idle_sentToGimp(ProgressConnector *pc,rtengine::IImage16* return false; } +/* void EditorPanel::saveOptions () { - - //options.historyPanelWidth = hpanedl->get_position ();//older code - //options.toolPanelWidth = vboxright->get_width ();//older code - //options.toolPanelWidth = hpanedr->get_position ();//Hombre's change which screws up OSX build } +*/ void EditorPanel::historyBeforeLineChanged (const rtengine::procparams::ProcParams& params) { diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 2b9d3394e..d870a7c33 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -104,6 +104,10 @@ class EditorPanel : public Gtk::VBox, virtual ~EditorPanel (); void open (Thumbnail* tmb, rtengine::InitialImage* isrc); + void setAspect (); + void on_realize (); + void leftPaneButtonReleased(GdkEventButton *event); + void rightPaneButtonReleased(GdkEventButton *event); void setParent (RTWindow* p) { parent = p; } @@ -138,7 +142,7 @@ class EditorPanel : public Gtk::VBox, Glib::ustring getFileName (); bool handleShortcutKey (GdkEventKey* event); - void saveOptions (); + //void saveOptions (); }; #endif diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 43349670b..dfe67ac77 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -38,6 +38,7 @@ FilePanel::FilePanel () : parent(NULL) { recentBrowser = new RecentBrowser (); placespaned = new Gtk::VPaned (); + placespaned->set_size_request(50,100); placespaned->set_position (options.dirBrowserHeight); Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ()); @@ -47,10 +48,11 @@ FilePanel::FilePanel () : parent(NULL) { placespaned->pack1 (*placesBrowser, false, true); placespaned->pack2 (*obox, true, true); - dirpaned->pack1 (*placespaned, true, true); + dirpaned->pack1 (*placespaned, false, true); tpc = new BatchToolPanelCoordinator (this); fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar()); + fileCatalog->set_size_request(50,150); dirpaned->pack2 (*fileCatalog, true, true); placesBrowser->setDirBrowserRemoteInterface (dirBrowser); @@ -61,6 +63,7 @@ FilePanel::FilePanel () : parent(NULL) { fileCatalog->setFileSelectionListener (this); rightBox = new Gtk::HBox (); + rightBox->set_size_request(50,100); rightNotebook = new Gtk::Notebook (); Gtk::VBox* taggingBox = new Gtk::VBox (); @@ -88,8 +91,8 @@ FilePanel::FilePanel () : parent(NULL) { Gtk::Label* tagLab = new Gtk::Label (M("MAIN_TAB_TAGGING")); tagLab->set_angle (90); - Gtk::VPaned* tpcPaned = new Gtk::VPaned (); - tpcPaned->pack1 (*tpc->toolPanelNotebook, true, true); + tpcPaned = new Gtk::VPaned (); + tpcPaned->pack1 (*tpc->toolPanelNotebook, false, true); tpcPaned->pack2 (*history, true, true); rightNotebook->append_page (*tpcPaned, *devLab); @@ -99,9 +102,7 @@ FilePanel::FilePanel () : parent(NULL) { rightBox->pack_start (*rightNotebook); pack1(*dirpaned, true, true); - pack2(*rightBox, true, true); - - //set_position(options.browserToolPanelWidth);////Hombre's change which screws up OSX build + pack2(*rightBox, false, true); fileCatalog->setFileSelectionChangeListener (tpc); @@ -111,6 +112,15 @@ FilePanel::FilePanel () : parent(NULL) { show_all (); } +void FilePanel::setAspect () { + int winW, winH; + parent->get_size(winW, winH); + placespaned->set_position(options.dirBrowserHeight); + dirpaned->set_position(options.dirBrowserWidth); + tpcPaned->set_position(options.browserToolPanelHeight); + set_position(winW - options.browserToolPanelWidth); +} + void FilePanel::init () { dirBrowser->fillDirTree (); @@ -161,9 +171,12 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnectorget_position (); - //options.dirBrowserHeight = placespaned->get_position (); - //options.browserToolPanelWidth = get_position(); + int winW, winH; + parent->get_size(winW, winH); + options.dirBrowserWidth = dirpaned->get_position (); + options.dirBrowserHeight = placespaned->get_position (); + options.browserToolPanelWidth = winW - get_position(); + options.browserToolPanelHeight = tpcPaned->get_position (); if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="") options.startupPath = fileCatalog->lastSelectedDir (); fileCatalog->closeDir (); diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 9dff610be..bfdf38cf4 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -45,6 +45,7 @@ class FilePanel : public Gtk::HPaned, RecentBrowser* recentBrowser; FileCatalog* fileCatalog; // filecatalog is the file browser with the button bar above it Gtk::HBox* rightBox; + Gtk::VPaned* tpcPaned; BatchToolPanelCoordinator* tpc; History* history; FilterPanel* filterPanel; @@ -58,6 +59,7 @@ class FilePanel : public Gtk::HPaned, void setParent (RTWindow* p) { parent = p; } void init (); // dont call it directly, the constructor calls it as idle source + void setAspect(); void open (const Glib::ustring& d); // open a file or a directory void refreshEditedState (const std::set& efiles) { fileCatalog->refreshEditedState (efiles); } diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index c1196e9b4..7fcf536dd 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -26,7 +26,6 @@ ImageArea::ImageArea (ImageAreaPanel* p) : parent(p) { - showInfo = false; infotext = ""; cropgl = NULL; pmlistener = NULL; @@ -121,8 +120,8 @@ void ImageArea::setInfoText (Glib::ustring text) { void ImageArea::infoEnabled (bool e) { - if (showInfo!=e) { - showInfo = e; + if (options.showInfo!=e) { + options.showInfo = e; queue_draw (); } } @@ -148,7 +147,7 @@ bool ImageArea::on_expose_event(GdkEventExpose* event) { if (mainCropWindow) mainCropWindow->expose (cr); - if (showInfo==true && infotext!="") { + if (options.showInfo==true && infotext!="") { int fnw, fnh; ilayout->get_pixel_size (fnw, fnh); window->draw_pixbuf (get_style()->get_base_gc (Gtk::STATE_NORMAL), ipixbuf, 0, 0, 4, 4, fnw+8, fnh+8, Gdk::RGB_DITHER_NONE, 0, 0); diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index 9abe97d84..08e1386fc 100644 --- a/rtgui/imagearea.h +++ b/rtgui/imagearea.h @@ -37,7 +37,6 @@ class ImageArea : public Gtk::DrawingArea, public CropWindowListener { protected: - bool showInfo; Glib::ustring infotext; Glib::RefPtr ilayout; Glib::RefPtr deglayout; diff --git a/rtgui/options.cc b/rtgui/options.cc index 2c243356b..16ac7aaed 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -38,8 +38,8 @@ const char *DefaultLanguage = "English (US)"; void Options::setDefaults () { - windowWidth = 1000; - windowHeight = 600; + windowWidth = 900; + windowHeight = 560; windowMaximized = false; firstRun = true; savesParamsAtExit = true; @@ -50,7 +50,7 @@ void Options::setDefaults () { saveFormat.tiffBits = 8; saveFormat.tiffUncompressed = true; saveFormat.saveParams = false; - savePathTemplate = "\%p1/converted/\%f"; + savePathTemplate = "%p1/converted/%f"; savePathFolder = ""; saveUsePathTemplate = true; defProfRaw = "default"; @@ -63,6 +63,7 @@ void Options::setDefaults () { dirBrowserHeight = 150; toolPanelWidth = 300; browserToolPanelWidth = 300; + browserToolPanelHeight = 300; historyPanelWidth = 150; lastScale = 4; lastCropSize = 1; @@ -239,12 +240,13 @@ if (keyFile.has_group ("GUI")) { if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth"); if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight"); if (keyFile.has_key ("GUI", "WindowMaximized")) windowMaximized = keyFile.get_boolean ("GUI", "WindowMaximized"); - if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); - if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); - if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth"); - if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight"); - if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); - if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); + if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); + if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); + if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth"); + if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight"); + if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); + if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); + if (keyFile.has_key ("GUI", "BrowserToolPanelHeight"))browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight"); if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth"); if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale"); if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); @@ -367,6 +369,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_integer ("GUI", "SaveAsDialogHeight", saveAsDialogHeight); keyFile.set_integer ("GUI", "ToolPanelWidth", toolPanelWidth); keyFile.set_integer ("GUI", "BrowserToolPanelWidth", browserToolPanelWidth); + keyFile.set_integer ("GUI", "BrowserToolPanelHeight", browserToolPanelHeight); keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth); keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); keyFile.set_integer ("GUI", "LastCropSize", lastCropSize); diff --git a/rtgui/options.h b/rtgui/options.h index b0a929adc..8ae2c9bd3 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -66,6 +66,7 @@ class Options { int saveAsDialogHeight; int toolPanelWidth; int browserToolPanelWidth; + int browserToolPanelHeight; int historyPanelWidth; int windowWidth; int windowHeight; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index e59f49ebb..2a62f0e1a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -132,7 +132,7 @@ void ParamsEdited::set (bool v) { equalizer.enabled = v; dirpyrequalizer.enabled = v; - for(int i = 0; i < 8; i++) + for(int i = 0; i < 5; i++) { equalizer.c[i] = v; dirpyrequalizer.mult[i] = v; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 4c104dd85..1310d9c84 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -42,6 +42,8 @@ PartialPasteDlg::PartialPasteDlg () { lumaden = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LUMADENOISE"))); lumacurve = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LUMACURVE"))); sh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHADOWSHIGHLIGHTS"))); + dirpyreq = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_DIRPYREQUALIZER"))); + waveq = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_WAVELETEQUALIZER"))); // options in color: colormixer = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_COLORMIXER"))); @@ -87,6 +89,8 @@ PartialPasteDlg::PartialPasteDlg () { vboxes[1]->pack_start (*lumaden, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*lumacurve, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*sh, Gtk::PACK_SHRINK, 2); + vboxes[1]->pack_start (*dirpyreq, Gtk::PACK_SHRINK, 2); + vboxes[1]->pack_start (*waveq, Gtk::PACK_SHRINK, 2); vboxes[2]->pack_start (*color, Gtk::PACK_SHRINK, 2); vboxes[2]->pack_start (*hseps[2], Gtk::PACK_SHRINK, 2); @@ -150,6 +154,8 @@ PartialPasteDlg::PartialPasteDlg () { lumadenConn = lumaden->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); lumacurveConn = lumacurve->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + dirpyreqConn = dirpyreq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); + waveqConn = waveq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*luminance, &Gtk::CheckButton::set_inconsistent), true)); colormixerConn = colormixer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); colorshiftConn = colorshift->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); @@ -201,6 +207,8 @@ void PartialPasteDlg::luminanceToggled () { lumadenConn.block (true); lumacurveConn.block (true); shConn.block (true); + dirpyreqConn.block (true); + waveqConn.block (true); luminance->set_inconsistent (false); @@ -209,12 +217,16 @@ void PartialPasteDlg::luminanceToggled () { lumaden->set_active (luminance->get_active ()); lumacurve->set_active (luminance->get_active ()); sh->set_active (luminance->get_active ()); + dirpyreq->set_active (luminance->get_active ()); + waveq->set_active (luminance->get_active ()); sharpenConn.block (false); impdenConn.block (false); lumadenConn.block (false); lumacurveConn.block (false); shConn.block (false); + dirpyreqConn.block (false); + waveqConn.block (false); } void PartialPasteDlg::colorToggled () { @@ -306,6 +318,8 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dst, const r if (lumaden->get_active ()) dst->lumaDenoise = src->lumaDenoise; if (lumacurve->get_active ()) dst->lumaCurve = src->lumaCurve; if (sh->get_active ()) dst->sh = src->sh; + if (dirpyreq->get_active ()) dst->dirpyrequalizer = src->dirpyrequalizer; + if (waveq->get_active ()) dst->equalizer = src->equalizer; if (colormixer->get_active ()) dst->chmixer = src->chmixer; if (colorshift->get_active ()) dst->colorShift = src->colorShift; diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index bede56698..3c4dcb152 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -44,6 +44,8 @@ class PartialPasteDlg : public Gtk::Dialog { Gtk::CheckButton* lumaden; Gtk::CheckButton* lumacurve; Gtk::CheckButton* sh; + Gtk::CheckButton* dirpyreq; + Gtk::CheckButton* waveq; // options in color: Gtk::CheckButton* colormixer; @@ -71,7 +73,7 @@ class PartialPasteDlg : public Gtk::Dialog { sigc::connection basicConn, luminanceConn, colorConn, lensConn, compositionConn, metaicmConn; sigc::connection wbConn, exposureConn, hlrecConn; - sigc::connection sharpenConn, impdenConn, lumadenConn, lumacurveConn, shConn; + sigc::connection sharpenConn, impdenConn, lumadenConn, lumacurveConn, shConn, dirpyreqConn, waveqConn; sigc::connection colormixerConn, colorshiftConn, colorboostConn, colordenConn, dirpyrdenConn; sigc::connection distortionConn, cacorrConn, vignettingConn; sigc::connection coarserotConn, finerotConn, cropConn, resizeConn; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 37e619dcd..0fd85a304 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -47,6 +47,7 @@ RTWindow::RTWindow () { mainNB = Gtk::manage (new Gtk::Notebook ()); mainNB->set_scrollable (true); + mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) ); fpanel = new FilePanel (); fpanel->setParent (this); @@ -108,9 +109,30 @@ void RTWindow::on_realize () { Gtk::Window::on_realize (); + fpanel->setAspect(); + cursorManager.init (get_window()); } +bool RTWindow::on_my_window_state_event(GdkEventWindowState* event) { + if (!event->new_window_state) { + // Window mode + options.windowMaximized = false; + } + else if (event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED|GDK_WINDOW_STATE_FULLSCREEN)) { + // Fullscreen mode + options.windowMaximized = true; + } + return true; +} + +void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) { + if (page_num > 1) { + EditorPanel *ep = (EditorPanel *)mainNB->get_nth_page(page_num); + ep->setAspect(); + } +} + void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { ep->setParent (this); @@ -133,7 +155,9 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { hb->pack_end (*closeb); hb->set_spacing (2); hb->show_all (); + mainNB->append_page (*ep, *hb); + //ep->setAspect (); mainNB->set_current_page (mainNB->page_num (*ep)); mainNB->set_tab_reorderable (*ep, true); @@ -144,7 +168,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { void RTWindow::remEditorPanel (EditorPanel* ep) { - ep->saveOptions (); + //ep->saveOptions (); epanels.erase (ep->getFileName()); filesEdited.erase (ep->getFileName ()); fpanel->refreshEditedState (filesEdited); @@ -222,14 +246,10 @@ bool RTWindow::on_delete_event(GdkEventAny* event) { options.fbArrangement = fileBrowser->getFileCatalog()->getArrangement (); options.firstRun = false; */ - Gdk::WindowState state = get_window()->get_state(); - if (!(state & (Gdk::WINDOW_STATE_MAXIMIZED | Gdk::WINDOW_STATE_FULLSCREEN))) { + if (!options.windowMaximized) { options.windowWidth = get_width(); options.windowHeight = get_height(); - options.windowMaximized = false; } - else - options.windowMaximized = true; Options::save (); hide(); diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 6ec0b1114..aa0db4048 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -52,7 +52,9 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{ bool keyPressed (GdkEventKey* event); bool on_delete_event(GdkEventAny* event); - + bool on_my_window_state_event(GdkEventWindowState* event); + void on_mainNB_switch_page(GtkNotebookPage* page, guint page_num); + void imageDeveloped (Glib::ustring fname); // called by the batchqueue when it finishes an image void showPreferences (); void on_realize (); diff --git a/tools/osx/make-app-bundle b/tools/osx/make-app-bundle index b10504343..25ee1013e 100755 --- a/tools/osx/make-app-bundle +++ b/tools/osx/make-app-bundle @@ -29,7 +29,7 @@ ETC=${MACOS}/etc LIB=${MACOS}/lib SHARE=${MACOS}/share RELEASE=release -DMG=${RELEASE}/rawtherapee_osx105_`date "+%Y-%m-%d"`_release-3.0-a1+`hg log | head -1 | cut -f 4 -d ' ' | sed 's/:/-/g'`.dmg +DMG=${RELEASE}/rawtherapee_osx105_`date +%F`_`hg parents --template '{latesttag}+{latesttagdistance}-{node|short}'`.dmg EXECUTABLE=rt #Find where MacPorts is installed. We take a known binary (cmake), which is in /bin, and