Second batch of correction to lower the number of GCC warnings
This commit is contained in:
parent
02dac0425d
commit
76285ea74d
@ -106,8 +106,8 @@ void RawImageSource::CA_correct_RT() {
|
|||||||
#define PIX_SORT(a,b) { if ((a)>(b)) {temp=(a);(a)=(b);(b)=temp;} }
|
#define PIX_SORT(a,b) { if ((a)>(b)) {temp=(a);(a)=(b);(b)=temp;} }
|
||||||
#define SQR(x) ((x)*(x))
|
#define SQR(x) ((x)*(x))
|
||||||
|
|
||||||
//static const float pre_mul[3] = {MIN(ri->red_multiplier,ri->green_multiplier), ri->green_multiplier, \
|
/*static const float pre_mul[3] = {MIN(ri->red_multiplier,ri->green_multiplier), ri->green_multiplier, \
|
||||||
MIN(ri->blue_multiplier,ri->green_multiplier)};
|
MIN(ri->blue_multiplier,ri->green_multiplier)};*/
|
||||||
|
|
||||||
static const float clip_pt = ri->defgain;
|
static const float clip_pt = ri->defgain;
|
||||||
|
|
||||||
|
@ -793,15 +793,15 @@ void RawImageSource::amaze_demosaic_RT() {
|
|||||||
rbvarp = epssq + (gausseven[0]*(Dgrbpsq1[indx-v1]+Dgrbpsq1[indx-1]+Dgrbpsq1[indx+1]+Dgrbpsq1[indx+v1]) + \
|
rbvarp = epssq + (gausseven[0]*(Dgrbpsq1[indx-v1]+Dgrbpsq1[indx-1]+Dgrbpsq1[indx+1]+Dgrbpsq1[indx+v1]) + \
|
||||||
gausseven[1]*(Dgrbpsq1[indx-v2-1]+Dgrbpsq1[indx-v2+1]+Dgrbpsq1[indx-2-v1]+Dgrbpsq1[indx+2-v1]+ \
|
gausseven[1]*(Dgrbpsq1[indx-v2-1]+Dgrbpsq1[indx-v2+1]+Dgrbpsq1[indx-2-v1]+Dgrbpsq1[indx+2-v1]+ \
|
||||||
Dgrbpsq1[indx-2+v1]+Dgrbpsq1[indx+2+v1]+Dgrbpsq1[indx+v2-1]+Dgrbpsq1[indx+v2+1]));
|
Dgrbpsq1[indx-2+v1]+Dgrbpsq1[indx+2+v1]+Dgrbpsq1[indx+v2-1]+Dgrbpsq1[indx+v2+1]));
|
||||||
//rbvarp -= SQR( (gausseven[0]*(Dgrbp1[indx-v1]+Dgrbp1[indx-1]+Dgrbp1[indx+1]+Dgrbp1[indx+v1]) + \
|
/*rbvarp -= SQR( (gausseven[0]*(Dgrbp1[indx-v1]+Dgrbp1[indx-1]+Dgrbp1[indx+1]+Dgrbp1[indx+v1]) + \
|
||||||
gausseven[1]*(Dgrbp1[indx-v2-1]+Dgrbp1[indx-v2+1]+Dgrbp1[indx-2-v1]+Dgrbp1[indx+2-v1]+ \
|
gausseven[1]*(Dgrbp1[indx-v2-1]+Dgrbp1[indx-v2+1]+Dgrbp1[indx-2-v1]+Dgrbp1[indx+2-v1]+ \
|
||||||
Dgrbp1[indx-2+v1]+Dgrbp1[indx+2+v1]+Dgrbp1[indx+v2-1]+Dgrbp1[indx+v2+1])));
|
Dgrbp1[indx-2+v1]+Dgrbp1[indx+2+v1]+Dgrbp1[indx+v2-1]+Dgrbp1[indx+v2+1])));*/
|
||||||
rbvarm = epssq + (gausseven[0]*(Dgrbmsq1[indx-v1]+Dgrbmsq1[indx-1]+Dgrbmsq1[indx+1]+Dgrbmsq1[indx+v1]) + \
|
rbvarm = epssq + (gausseven[0]*(Dgrbmsq1[indx-v1]+Dgrbmsq1[indx-1]+Dgrbmsq1[indx+1]+Dgrbmsq1[indx+v1]) + \
|
||||||
gausseven[1]*(Dgrbmsq1[indx-v2-1]+Dgrbmsq1[indx-v2+1]+Dgrbmsq1[indx-2-v1]+Dgrbmsq1[indx+2-v1]+ \
|
gausseven[1]*(Dgrbmsq1[indx-v2-1]+Dgrbmsq1[indx-v2+1]+Dgrbmsq1[indx-2-v1]+Dgrbmsq1[indx+2-v1]+ \
|
||||||
Dgrbmsq1[indx-2+v1]+Dgrbmsq1[indx+2+v1]+Dgrbmsq1[indx+v2-1]+Dgrbmsq1[indx+v2+1]));
|
Dgrbmsq1[indx-2+v1]+Dgrbmsq1[indx+2+v1]+Dgrbmsq1[indx+v2-1]+Dgrbmsq1[indx+v2+1]));
|
||||||
//rbvarm -= SQR( (gausseven[0]*(Dgrbm1[indx-v1]+Dgrbm1[indx-1]+Dgrbm1[indx+1]+Dgrbm1[indx+v1]) + \
|
/*rbvarm -= SQR( (gausseven[0]*(Dgrbm1[indx-v1]+Dgrbm1[indx-1]+Dgrbm1[indx+1]+Dgrbm1[indx+v1]) + \
|
||||||
gausseven[1]*(Dgrbm1[indx-v2-1]+Dgrbm1[indx-v2+1]+Dgrbm1[indx-2-v1]+Dgrbm1[indx+2-v1]+ \
|
gausseven[1]*(Dgrbm1[indx-v2-1]+Dgrbm1[indx-v2+1]+Dgrbm1[indx-2-v1]+Dgrbm1[indx+2-v1]+ \
|
||||||
Dgrbm1[indx-2+v1]+Dgrbm1[indx+2+v1]+Dgrbm1[indx+v2-1]+Dgrbm1[indx+v2+1])));
|
Dgrbm1[indx-2+v1]+Dgrbm1[indx+2+v1]+Dgrbm1[indx+v2-1]+Dgrbm1[indx+v2+1])));*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -751,6 +751,7 @@ bool Thumbnail::readImage (const Glib::ustring& fname) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Thumbnail::readData (const Glib::ustring& fname) {
|
bool Thumbnail::readData (const Glib::ustring& fname) {
|
||||||
|
@ -222,42 +222,42 @@ FAPictureModeInterpreter faPictureModeInterpreter;
|
|||||||
|
|
||||||
|
|
||||||
const TagAttrib fujiAttribs[] = {
|
const TagAttrib fujiAttribs[] = {
|
||||||
0, 1, 0, 0, 0x0000, "Version", &stdInterpreter,
|
{0, 1, 0, 0, 0x0000, "Version", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter,
|
{0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter,
|
{0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter,
|
{0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter},
|
||||||
0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter,
|
{0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter},
|
||||||
0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter,
|
{0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter},
|
||||||
0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter,
|
{0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter},
|
||||||
0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter,
|
{0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter,
|
{0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter},
|
||||||
0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter,
|
{0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter,
|
{0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter},
|
||||||
0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter,
|
{0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter},
|
||||||
0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter,
|
{0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter,
|
{0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter},
|
||||||
0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter,
|
{0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter},
|
||||||
0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter,
|
{0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter,
|
{0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter},
|
||||||
0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter,
|
{0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter},
|
||||||
0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter,
|
{0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter},
|
||||||
0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter,
|
{0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter,
|
{0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter},
|
||||||
0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter,
|
{0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter},
|
||||||
0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter,
|
{0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter},
|
||||||
0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter,
|
{0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter},
|
||||||
0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter,
|
{0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter},
|
||||||
0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter,
|
{0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter},
|
||||||
0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter,
|
{0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter},
|
||||||
0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter,
|
{0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter,
|
{0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter,
|
{0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter,
|
{0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter,
|
{0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter,
|
{0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter,
|
{0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter},
|
||||||
0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter,
|
{0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter},
|
||||||
-1, 0, 0, 0, 0, "", NULL};
|
{-1, 0, 0, 0, 0, "", NULL}};
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -158,9 +158,10 @@ class NAAFInfoInterpreter : public Interpreter {
|
|||||||
else if (aff&512)
|
else if (aff&512)
|
||||||
if (af.str()=="") af << "Far Left";
|
if (af.str()=="") af << "Far Left";
|
||||||
else af << ", Far Left";
|
else af << ", Far Left";
|
||||||
else if (aff&1024)
|
else if (aff&1024) {
|
||||||
if (af.str()=="") af << "Far Right";
|
if (af.str()=="") af << "Far Right";
|
||||||
else af << ", Far Right";
|
else af << ", Far Right";
|
||||||
|
}
|
||||||
|
|
||||||
str << "AFPointsInFocus = " << af.str();
|
str << "AFPointsInFocus = " << af.str();
|
||||||
return str.str();
|
return str.str();
|
||||||
|
@ -946,7 +946,7 @@ public:
|
|||||||
case 2: str << "AF-C";break;
|
case 2: str << "AF-C";break;
|
||||||
case 3: str << "AF-A";break;
|
case 3: str << "AF-A";break;
|
||||||
}
|
}
|
||||||
if( c & 0xF0 == 0) str << ", Point Selection Auto";
|
if( (c & 0xF0) == 0) str << ", Point Selection Auto";
|
||||||
else if( c & 0x20 ) str << ", Fixed Center Point Selected";
|
else if( c & 0x20 ) str << ", Fixed Center Point Selected";
|
||||||
else if( c & 0x10 ) str << ", Point Selected";
|
else if( c & 0x10 ) str << ", Point Selected";
|
||||||
return str.str();
|
return str.str();
|
||||||
|
@ -85,7 +85,7 @@ void CACorrection::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void CACorrection::setAdjusterBehavior (bool badd) {
|
void CACorrection::setAdjusterBehavior (bool badd) {
|
||||||
|
|
||||||
if (!vAdd && badd || vAdd && !badd) {
|
if ((!vAdd && badd) || (vAdd && !badd)) {
|
||||||
red->setLimits (-0.005, 0.005, 0.0001, 0);
|
red->setLimits (-0.005, 0.005, 0.0001, 0);
|
||||||
blue->setLimits (-0.005, 0.005, 0.0001, 0);
|
blue->setLimits (-0.005, 0.005, 0.0001, 0);
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ void ColorBoost::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void ColorBoost::setAdjusterBehavior (bool bcbadd) {
|
void ColorBoost::setAdjusterBehavior (bool bcbadd) {
|
||||||
|
|
||||||
if (!cbAdd && bcbadd || cbAdd && !bcbadd)
|
if ((!cbAdd && bcbadd) || (cbAdd && !bcbadd))
|
||||||
colorboost->setLimits (-100, 100, 1, 0);
|
colorboost->setLimits (-100, 100, 1, 0);
|
||||||
|
|
||||||
cbAdd = bcbadd;
|
cbAdd = bcbadd;
|
||||||
|
@ -90,10 +90,10 @@ void ColorShift::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void ColorShift::setAdjusterBehavior (bool baadd, bool bbadd) {
|
void ColorShift::setAdjusterBehavior (bool baadd, bool bbadd) {
|
||||||
|
|
||||||
if (!aAdd && baadd || aAdd && !baadd)
|
if ((!aAdd && baadd) || (aAdd && !baadd))
|
||||||
ashift->setLimits (-25, 25, 0.1, 0);
|
ashift->setLimits (-25, 25, 0.1, 0);
|
||||||
|
|
||||||
if (!bAdd && bbadd || bAdd && !bbadd)
|
if ((!bAdd && bbadd) || (bAdd && !bbadd))
|
||||||
bshift->setLimits (-25, 25, 0.1, 0);
|
bshift->setLimits (-25, 25, 0.1, 0);
|
||||||
|
|
||||||
aAdd = baadd;
|
aAdd = baadd;
|
||||||
|
@ -31,21 +31,21 @@ struct ZoomStep {
|
|||||||
int czoom;
|
int czoom;
|
||||||
};
|
};
|
||||||
|
|
||||||
ZoomStep zoomSteps[] = {"10%", 0.1, 10,
|
ZoomStep zoomSteps[] = {{"10%", 0.1, 10},
|
||||||
"12.5%", 0.125, 8,
|
{"12.5%", 0.125, 8},
|
||||||
"16.6%", 1.0/6.0, 6,
|
{"16.6%", 1.0/6.0, 6},
|
||||||
"20%", 0.2, 5,
|
{"20%", 0.2, 5},
|
||||||
"25%", 0.25, 4,
|
{"25%", 0.25, 4},
|
||||||
"33%", 1.0/3.0, 3,
|
{"33%", 1.0/3.0, 3},
|
||||||
"50%", 0.5, 2,
|
{"50%", 0.5, 2},
|
||||||
"100%", 1.0, 1000,
|
{"100%", 1.0, 1000},
|
||||||
"200%", 2.0, 2000,
|
{"200%", 2.0, 2000},
|
||||||
"300%", 3.0, 3000,
|
{"300%", 3.0, 3000},
|
||||||
"400%", 4.0, 4000,
|
{"400%", 4.0, 4000},
|
||||||
"500%", 5.0, 5000,
|
{"500%", 5.0, 5000},
|
||||||
"600%", 6.0, 6000,
|
{"600%", 6.0, 6000},
|
||||||
"700%", 7.0, 7000,
|
{"700%", 7.0, 7000},
|
||||||
"800%", 8.0, 8000};
|
{"800%", 8.0, 8000}};
|
||||||
#define MAXZOOMSTEPS 14
|
#define MAXZOOMSTEPS 14
|
||||||
#define ZOOM11INDEX 7
|
#define ZOOM11INDEX 7
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void Distortion::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void Distortion::setAdjusterBehavior (bool bvadd) {
|
void Distortion::setAdjusterBehavior (bool bvadd) {
|
||||||
|
|
||||||
if (!distAdd && bvadd || distAdd && !bvadd)
|
if ((!distAdd && bvadd) || (distAdd && !bvadd))
|
||||||
distor->setLimits (-0.5, 0.5, 0.001, 0);
|
distor->setLimits (-0.5, 0.5, 0.001, 0);
|
||||||
|
|
||||||
distAdd = bvadd;
|
distAdd = bvadd;
|
||||||
|
@ -260,9 +260,9 @@ void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring
|
|||||||
selectedDirectory = dir->get_parse_name();
|
selectedDirectory = dir->get_parse_name();
|
||||||
fileNameList = getFileList ();
|
fileNameList = getFileList ();
|
||||||
|
|
||||||
for (int i=0; i<fileNameList.size(); i++) {
|
for (unsigned int i=0; i<fileNameList.size(); i++) {
|
||||||
Glib::RefPtr<Gio::File> f = Gio::File::create_for_path(fileNameList[i]);
|
Glib::RefPtr<Gio::File> f = Gio::File::create_for_path(fileNameList[i]);
|
||||||
if (f->get_parse_name() != openfile) // if we opened a file at the beginning dont add it again
|
if (f->get_parse_name() != openfile) // if we opened a file at the beginning don't add it again
|
||||||
checkAndAddFile (f);
|
checkAndAddFile (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,10 +326,10 @@ void FileCatalog::previewReady (FileBrowserEntry* fdn) {
|
|||||||
dirEFS.shutterFrom = cfs->shutter;
|
dirEFS.shutterFrom = cfs->shutter;
|
||||||
if (cfs->shutter > dirEFS.shutterTo)
|
if (cfs->shutter > dirEFS.shutterTo)
|
||||||
dirEFS.shutterTo = cfs->shutter;
|
dirEFS.shutterTo = cfs->shutter;
|
||||||
if (cfs->iso>0 && cfs->iso < dirEFS.isoFrom)
|
if (cfs->iso>0 && (int)cfs->iso < dirEFS.isoFrom)
|
||||||
dirEFS.isoFrom = cfs->iso;
|
dirEFS.isoFrom = (int)cfs->iso;
|
||||||
if (cfs->iso>0 && cfs->iso > dirEFS.isoTo)
|
if (cfs->iso>0 && (int)cfs->iso > dirEFS.isoTo)
|
||||||
dirEFS.isoTo = cfs->iso;
|
dirEFS.isoTo = (int)cfs->iso;
|
||||||
if (cfs->focalLen < dirEFS.focalFrom)
|
if (cfs->focalLen < dirEFS.focalFrom)
|
||||||
dirEFS.focalFrom = cfs->focalLen;
|
dirEFS.focalFrom = cfs->focalLen;
|
||||||
if (cfs->focalLen > dirEFS.focalTo)
|
if (cfs->focalLen > dirEFS.focalTo)
|
||||||
@ -423,7 +423,7 @@ void FileCatalog::_openImage (std::vector<Thumbnail*> tmb) {
|
|||||||
if (enabled && listener!=NULL) {
|
if (enabled && listener!=NULL) {
|
||||||
previewLoader.stop ();
|
previewLoader.stop ();
|
||||||
thumbImageUpdater.stop ();
|
thumbImageUpdater.stop ();
|
||||||
for (int i=0; i<tmb.size(); i++) {
|
for (unsigned int i=0; i<tmb.size(); i++) {
|
||||||
if (editedFiles.find (tmb[i]->getFileName())==editedFiles.end())
|
if (editedFiles.find (tmb[i]->getFileName())==editedFiles.end())
|
||||||
listener->fileSelected (tmb[i]);
|
listener->fileSelected (tmb[i]);
|
||||||
tmb[i]->decreaseRef ();
|
tmb[i]->decreaseRef ();
|
||||||
@ -453,7 +453,7 @@ void FileCatalog::openRequested (std::vector<Thumbnail*> tmb) {
|
|||||||
FCOIParams* params = new FCOIParams;
|
FCOIParams* params = new FCOIParams;
|
||||||
params->catalog = this;
|
params->catalog = this;
|
||||||
params->tmb = tmb;
|
params->tmb = tmb;
|
||||||
for (int i=0; i<tmb.size(); i++)
|
for (unsigned int i=0; i<tmb.size(); i++)
|
||||||
tmb[i]->increaseRef ();
|
tmb[i]->increaseRef ();
|
||||||
g_idle_add (fcopenimg, params);
|
g_idle_add (fcopenimg, params);
|
||||||
}
|
}
|
||||||
@ -467,7 +467,7 @@ void FileCatalog::deleteRequested (std::vector<FileBrowserEntry*> tbe) {
|
|||||||
msd.set_secondary_text(Glib::ustring::compose (M("FILEBROWSER_DELETEDLGMSG"), tbe.size()));
|
msd.set_secondary_text(Glib::ustring::compose (M("FILEBROWSER_DELETEDLGMSG"), tbe.size()));
|
||||||
|
|
||||||
if (msd.run()==Gtk::RESPONSE_YES) {
|
if (msd.run()==Gtk::RESPONSE_YES) {
|
||||||
for (int i=0; i<tbe.size(); i++) {
|
for (unsigned int i=0; i<tbe.size(); i++) {
|
||||||
Glib::ustring fname = tbe[i]->filename;
|
Glib::ustring fname = tbe[i]->filename;
|
||||||
// remove from browser
|
// remove from browser
|
||||||
FileBrowserEntry* t = fileBrowser->delEntry (fname);
|
FileBrowserEntry* t = fileBrowser->delEntry (fname);
|
||||||
@ -492,7 +492,7 @@ void FileCatalog::developRequested (std::vector<FileBrowserEntry*> tbe) {
|
|||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
thumbImageUpdater.stop ();
|
thumbImageUpdater.stop ();
|
||||||
for (int i=0; i<tbe.size(); i++) {
|
for (unsigned int i=0; i<tbe.size(); i++) {
|
||||||
rtengine::procparams::ProcParams params = tbe[i]->thumbnail->getProcParams();
|
rtengine::procparams::ProcParams params = tbe[i]->thumbnail->getProcParams();
|
||||||
rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (tbe[i]->filename, tbe[i]->thumbnail->getType()==FT_Raw, params);
|
rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (tbe[i]->filename, tbe[i]->thumbnail->getType()==FT_Raw, params);
|
||||||
double tmpscale;
|
double tmpscale;
|
||||||
@ -519,7 +519,7 @@ void FileCatalog::renameRequested (std::vector<FileBrowserEntry*> tbe) {
|
|||||||
|
|
||||||
RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel());
|
RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel());
|
||||||
|
|
||||||
for (int i=0; i<tbe.size(); i++) {
|
for (unsigned int i=0; i<tbe.size(); i++) {
|
||||||
renameDlg->initName (Glib::path_get_basename (tbe[i]->filename), tbe[i]->thumbnail->getCacheImageData());
|
renameDlg->initName (Glib::path_get_basename (tbe[i]->filename), tbe[i]->thumbnail->getCacheImageData());
|
||||||
|
|
||||||
Glib::ustring ofname = tbe[i]->filename;
|
Glib::ustring ofname = tbe[i]->filename;
|
||||||
@ -683,7 +683,7 @@ void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b) {
|
|||||||
for (int i=0; i<5; i++) {
|
for (int i=0; i<5; i++) {
|
||||||
bool active_now, active_before;
|
bool active_now, active_before;
|
||||||
active_now = bRank[i]->get_active();
|
active_now = bRank[i]->get_active();
|
||||||
active_before = buttons & (1 << i+2);
|
active_before = buttons & (1 << (i+2));
|
||||||
if ( active_now && !active_before) bRank[i]->set_image (*iranked[i]);
|
if ( active_now && !active_before) bRank[i]->set_image (*iranked[i]);
|
||||||
else if (!active_now && active_before) bRank[i]->set_image (*igranked[i]);
|
else if (!active_now && active_before) bRank[i]->set_image (*igranked[i]);
|
||||||
}
|
}
|
||||||
@ -743,16 +743,16 @@ int FileCatalog::reparseDirectory () {
|
|||||||
// check if a thumbnailed file has been deleted
|
// check if a thumbnailed file has been deleted
|
||||||
const std::vector<ThumbBrowserEntryBase*>& t = fileBrowser->getEntries ();
|
const std::vector<ThumbBrowserEntryBase*>& t = fileBrowser->getEntries ();
|
||||||
std::vector<Glib::ustring> fileNamesToDel;
|
std::vector<Glib::ustring> fileNamesToDel;
|
||||||
for (int i=0; i<t.size(); i++)
|
for (unsigned int i=0; i<t.size(); i++)
|
||||||
if (!Glib::file_test (t[i]->filename, Glib::FILE_TEST_EXISTS))
|
if (!Glib::file_test (t[i]->filename, Glib::FILE_TEST_EXISTS))
|
||||||
fileNamesToDel.push_back (t[i]->filename);
|
fileNamesToDel.push_back (t[i]->filename);
|
||||||
for (int i=0; i<fileNamesToDel.size(); i++) {
|
for (unsigned int i=0; i<fileNamesToDel.size(); i++) {
|
||||||
delete fileBrowser->delEntry (fileNamesToDel[i]);
|
delete fileBrowser->delEntry (fileNamesToDel[i]);
|
||||||
cacheMgr.deleteEntry (fileNamesToDel[i]);
|
cacheMgr.deleteEntry (fileNamesToDel[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if a new file has been added
|
// check if a new file has been added
|
||||||
for (int i=0; i<nfileNameList.size(); i++) {
|
for (unsigned int i=0; i<nfileNameList.size(); i++) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int j=0; j<fileNameList.size(); j++)
|
for (int j=0; j<fileNameList.size(); j++)
|
||||||
if (nfileNameList[i]==fileNameList[j]) {
|
if (nfileNameList[i]==fileNameList[j]) {
|
||||||
@ -799,7 +799,7 @@ void FileCatalog::checkAndAddFile (Glib::RefPtr<Gio::File> file) {
|
|||||||
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info(file);
|
Glib::RefPtr<Gio::FileInfo> info = safe_query_file_info(file);
|
||||||
if (info && info->get_file_type() != Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || !options.fbShowHidden)) {
|
if (info && info->get_file_type() != Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || !options.fbShowHidden)) {
|
||||||
int lastdot = info->get_name().find_last_of ('.');
|
int lastdot = info->get_name().find_last_of ('.');
|
||||||
if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){
|
if (options.is_extention_enabled(lastdot!=(int)Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){
|
||||||
previewLoader.add (DirEntry (file->get_parse_name()));
|
previewLoader.add (DirEntry (file->get_parse_name()));
|
||||||
previewsToLoad++;
|
previewsToLoad++;
|
||||||
}
|
}
|
||||||
@ -817,7 +817,7 @@ void FileCatalog::addAndOpenFile (const Glib::ustring& fname) {
|
|||||||
if( !info )
|
if( !info )
|
||||||
return;
|
return;
|
||||||
int lastdot = info->get_name().find_last_of ('.');
|
int lastdot = info->get_name().find_last_of ('.');
|
||||||
if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){
|
if (options.is_extention_enabled(lastdot!=(int)Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){
|
||||||
// if supported, load thumbnail first
|
// if supported, load thumbnail first
|
||||||
Thumbnail* tmb = cacheMgr.getEntry (file->get_parse_name());
|
Thumbnail* tmb = cacheMgr.getEntry (file->get_parse_name());
|
||||||
if (tmb) {
|
if (tmb) {
|
||||||
@ -837,7 +837,7 @@ void FileCatalog::emptyTrash () {
|
|||||||
|
|
||||||
const std::vector<ThumbBrowserEntryBase*> t = fileBrowser->getEntries ();
|
const std::vector<ThumbBrowserEntryBase*> t = fileBrowser->getEntries ();
|
||||||
std::vector<FileBrowserEntry*> toDel;
|
std::vector<FileBrowserEntry*> toDel;
|
||||||
for (int i=0; i<t.size(); i++)
|
for (unsigned int i=0; i<t.size(); i++)
|
||||||
if (((FileBrowserEntry*)t[i])->thumbnail->getStage()==1)
|
if (((FileBrowserEntry*)t[i])->thumbnail->getStage()==1)
|
||||||
toDel.push_back (((FileBrowserEntry*)t[i]));
|
toDel.push_back (((FileBrowserEntry*)t[i]));
|
||||||
deleteRequested (toDel);
|
deleteRequested (toDel);
|
||||||
@ -846,7 +846,7 @@ void FileCatalog::emptyTrash () {
|
|||||||
|
|
||||||
bool FileCatalog::trashIsEmpty () {
|
bool FileCatalog::trashIsEmpty () {
|
||||||
const std::vector<ThumbBrowserEntryBase*> t = fileBrowser->getEntries ();
|
const std::vector<ThumbBrowserEntryBase*> t = fileBrowser->getEntries ();
|
||||||
for (int i=0; i<t.size(); i++)
|
for (unsigned int i=0; i<t.size(); i++)
|
||||||
if (((FileBrowserEntry*)t[i])->thumbnail->getStage()==1)
|
if (((FileBrowserEntry*)t[i])->thumbnail->getStage()==1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -129,9 +129,9 @@ void LCurve::setBatchMode (bool batchMode) {
|
|||||||
|
|
||||||
void LCurve::setAdjusterBehavior (bool bradd, bool contradd) {
|
void LCurve::setAdjusterBehavior (bool bradd, bool contradd) {
|
||||||
|
|
||||||
if (!brAdd && bradd || brAdd && !bradd)
|
if ((!brAdd && bradd) || (brAdd && !bradd))
|
||||||
brightness->setLimits (-100, 100, 1, 0);
|
brightness->setLimits (-100, 100, 1, 0);
|
||||||
if (!contrAdd && contradd || contrAdd && !contradd)
|
if ((!contrAdd && contradd) || (contrAdd && !contradd))
|
||||||
contrast->setLimits (-100, 100, 1, 0);
|
contrast->setLimits (-100, 100, 1, 0);
|
||||||
|
|
||||||
brAdd = bradd;
|
brAdd = bradd;
|
||||||
|
@ -38,7 +38,7 @@ bool MultiLangMgr::load (Glib::ustring fname, MultiLangMgr* fb) {
|
|||||||
|
|
||||||
char* buffer = new char[2048];
|
char* buffer = new char[2048];
|
||||||
|
|
||||||
while (buffer = fgets (buffer, 2048, f)) {
|
while ((buffer = fgets (buffer, 2048, f))) {
|
||||||
// find separator
|
// find separator
|
||||||
int seppos = 0;
|
int seppos = 0;
|
||||||
while (buffer[seppos]!=0 && buffer[seppos]!=';')
|
while (buffer[seppos]!=0 && buffer[seppos]!=';')
|
||||||
|
378
rtgui/mycurve.cc
378
rtgui/mycurve.cc
@ -68,7 +68,7 @@ std::vector<double> MyCurve::get_vector (int veclen) {
|
|||||||
double prev =- 1.0;
|
double prev =- 1.0;
|
||||||
int active = 0;
|
int active = 0;
|
||||||
int firstact = -1;
|
int firstact = -1;
|
||||||
for (int i = 0; i < curve.x.size(); ++i)
|
for (int i = 0; i < (int)curve.x.size(); ++i)
|
||||||
if (curve.x[i] > prev) {
|
if (curve.x[i] > prev) {
|
||||||
if (firstact < 0)
|
if (firstact < 0)
|
||||||
firstact = i;
|
firstact = i;
|
||||||
@ -154,8 +154,8 @@ void MyCurve::draw (int handle) {
|
|||||||
|
|
||||||
// histogram in the background
|
// histogram in the background
|
||||||
if (bghistvalid) {
|
if (bghistvalid) {
|
||||||
// find heighest bin
|
// find highest bin
|
||||||
int histheight = 0;
|
unsigned int histheight = 0;
|
||||||
for (int i=0; i<256; i++)
|
for (int i=0; i<256; i++)
|
||||||
if (bghist[i]>histheight)
|
if (bghist[i]>histheight)
|
||||||
histheight = bghist[i];
|
histheight = bghist[i];
|
||||||
@ -165,7 +165,7 @@ void MyCurve::draw (int handle) {
|
|||||||
cr->move_to (RADIUS, innerHeight-1+RADIUS);
|
cr->move_to (RADIUS, innerHeight-1+RADIUS);
|
||||||
cr->set_source_rgb (0.75, 0.75, 0.75);
|
cr->set_source_rgb (0.75, 0.75, 0.75);
|
||||||
for (int i=0; i<256; i++) {
|
for (int i=0; i<256; i++) {
|
||||||
double val = bghist[i] * (double)(innerHeight-2) / histheight;
|
double val = bghist[i] * (double)(innerHeight-2) / (double)histheight;
|
||||||
if (val>innerHeight-1)
|
if (val>innerHeight-1)
|
||||||
val = innerHeight-1;
|
val = innerHeight-1;
|
||||||
if (i>0)
|
if (i>0)
|
||||||
@ -275,204 +275,206 @@ bool MyCurve::handleEvents (GdkEvent* event) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case Gdk::CONFIGURE:
|
case Gdk::CONFIGURE:
|
||||||
if (pixmap)
|
if (pixmap)
|
||||||
pixmap.clear ();
|
pixmap.clear ();
|
||||||
|
retval = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case Gdk::EXPOSE:
|
case Gdk::EXPOSE:
|
||||||
if (!pixmap) {
|
if (!pixmap) {
|
||||||
pixmap = Gdk::Pixmap::create (get_window(), get_allocation().get_width(), get_allocation().get_height());
|
pixmap = Gdk::Pixmap::create (get_window(), get_allocation().get_width(), get_allocation().get_height());
|
||||||
interpolate ();
|
interpolate ();
|
||||||
}
|
}
|
||||||
draw (lit_point);
|
draw (lit_point);
|
||||||
break;
|
retval = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case Gdk::BUTTON_PRESS:
|
case Gdk::BUTTON_PRESS:
|
||||||
if (curve.type!=Parametric) {
|
if (curve.type!=Parametric) {
|
||||||
if (event->button.button == 1) {
|
if (event->button.button == 1) {
|
||||||
buttonPressed = true;
|
buttonPressed = true;
|
||||||
add_modal_grab ();
|
add_modal_grab ();
|
||||||
|
|
||||||
// get the pointer position
|
// get the pointer position
|
||||||
getCursorPosition(event);
|
getCursorPosition(event);
|
||||||
findClosestPoint();
|
findClosestPoint();
|
||||||
|
|
||||||
new_type = CSMove;
|
new_type = CSMove;
|
||||||
if (distanceX > minDistanceX) {
|
if (distanceX > minDistanceX) {
|
||||||
/* insert a new control point */
|
/* insert a new control point */
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
if (clampedX > curve.x[closest_point])
|
if (clampedX > curve.x[closest_point])
|
||||||
++closest_point;
|
++closest_point;
|
||||||
}
|
|
||||||
itx = curve.x.begin();
|
|
||||||
ity = curve.y.begin();
|
|
||||||
for (int i=0; i<closest_point; i++) { itx++; ity++; }
|
|
||||||
curve.x.insert (itx, 0);
|
|
||||||
curve.y.insert (ity, 0);
|
|
||||||
num++;
|
|
||||||
|
|
||||||
// the graph is refreshed only if a new point is created (snaped to a pixel)
|
|
||||||
curve.x[closest_point] = clampedX;
|
|
||||||
curve.y[closest_point] = clampedY;
|
|
||||||
|
|
||||||
interpolate ();
|
|
||||||
draw (closest_point);
|
|
||||||
notifyListener ();
|
|
||||||
}
|
}
|
||||||
grab_point = closest_point;
|
|
||||||
lit_point = closest_point;
|
|
||||||
ugpX = curve.x[closest_point];
|
|
||||||
ugpY = curve.y[closest_point];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
retval = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Gdk::BUTTON_RELEASE:
|
|
||||||
if (curve.type!=Parametric) {
|
|
||||||
if (event->button.button == 1) {
|
|
||||||
buttonPressed = false;
|
|
||||||
}
|
|
||||||
if (!buttonPressed) {
|
|
||||||
/* get the pointer position */
|
|
||||||
getCursorPosition(event);
|
|
||||||
findClosestPoint();
|
|
||||||
|
|
||||||
remove_modal_grab ();
|
|
||||||
int previous_lit_point = lit_point;
|
|
||||||
/* delete inactive points: */
|
|
||||||
itx = curve.x.begin();
|
itx = curve.x.begin();
|
||||||
ity = curve.y.begin();
|
ity = curve.y.begin();
|
||||||
for (src = dst = 0; src < num; ++src)
|
for (int i=0; i<closest_point; i++) { itx++; ity++; }
|
||||||
if (curve.x[src] >= 0.0) {
|
curve.x.insert (itx, 0);
|
||||||
curve.x[dst] = curve.x[src];
|
curve.y.insert (ity, 0);
|
||||||
curve.y[dst] = curve.y[src];
|
num++;
|
||||||
++dst;
|
|
||||||
++itx;
|
// the graph is refreshed only if a new point is created (snaped to a pixel)
|
||||||
++ity;
|
curve.x[closest_point] = clampedX;
|
||||||
}
|
curve.y[closest_point] = clampedY;
|
||||||
if (dst < src) {
|
|
||||||
curve.x.erase (itx, curve.x.end());
|
interpolate ();
|
||||||
curve.y.erase (ity, curve.y.end());
|
draw (closest_point);
|
||||||
if (!curve.x.size()) {
|
notifyListener ();
|
||||||
curve.x.push_back (0);
|
}
|
||||||
curve.y.push_back (0);
|
grab_point = closest_point;
|
||||||
interpolate ();
|
lit_point = closest_point;
|
||||||
draw (lit_point);
|
ugpX = curve.x[closest_point];
|
||||||
}
|
ugpY = curve.y[closest_point];
|
||||||
|
}
|
||||||
|
if (buttonPressed) retval = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Gdk::BUTTON_RELEASE:
|
||||||
|
if (curve.type!=Parametric) {
|
||||||
|
if (buttonPressed && event->button.button == 1) {
|
||||||
|
buttonPressed = false;
|
||||||
|
/* get the pointer position */
|
||||||
|
getCursorPosition(event);
|
||||||
|
findClosestPoint();
|
||||||
|
|
||||||
|
remove_modal_grab ();
|
||||||
|
int previous_lit_point = lit_point;
|
||||||
|
/* delete inactive points: */
|
||||||
|
itx = curve.x.begin();
|
||||||
|
ity = curve.y.begin();
|
||||||
|
for (src = dst = 0; src < num; ++src)
|
||||||
|
if (curve.x[src] >= 0.0) {
|
||||||
|
curve.x[dst] = curve.x[src];
|
||||||
|
curve.y[dst] = curve.y[src];
|
||||||
|
++dst;
|
||||||
|
++itx;
|
||||||
|
++ity;
|
||||||
}
|
}
|
||||||
if (distanceX <= minDistanceX) {
|
if (dst < src) {
|
||||||
new_type = CSMove;
|
curve.x.erase (itx, curve.x.end());
|
||||||
lit_point = closest_point;
|
curve.y.erase (ity, curve.y.end());
|
||||||
}
|
if (!curve.x.size()) {
|
||||||
else {
|
curve.x.push_back (0);
|
||||||
new_type = CSPlus;
|
curve.y.push_back (0);
|
||||||
lit_point = -1;
|
interpolate ();
|
||||||
}
|
|
||||||
if (lit_point != previous_lit_point)
|
|
||||||
draw (lit_point);
|
draw (lit_point);
|
||||||
grab_point = -1;
|
}
|
||||||
retval = true;
|
}
|
||||||
|
if (distanceX <= minDistanceX) {
|
||||||
|
new_type = CSMove;
|
||||||
|
lit_point = closest_point;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
new_type = CSPlus;
|
||||||
|
lit_point = -1;
|
||||||
|
}
|
||||||
|
if (lit_point != previous_lit_point)
|
||||||
|
draw (lit_point);
|
||||||
|
grab_point = -1;
|
||||||
|
retval = true;
|
||||||
|
notifyListener ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Gdk::LEAVE_NOTIFY:
|
||||||
|
// Pointer can LEAVE even when dragging the point, so we don't modify the cursor in this case
|
||||||
|
// The cursor will have to LEAVE another time after the drag...
|
||||||
|
if (!buttonPressed)
|
||||||
|
if (grab_point == -1) {
|
||||||
|
new_type = CSArrow;
|
||||||
|
lit_point = -1;
|
||||||
|
draw (lit_point);
|
||||||
|
}
|
||||||
|
retval = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Gdk::MOTION_NOTIFY:
|
||||||
|
if (curve.type == Linear || curve.type == Spline || curve.type == NURBS) {
|
||||||
|
// get the pointer position
|
||||||
|
getCursorPosition(event);
|
||||||
|
|
||||||
|
if (grab_point == -1) {
|
||||||
|
// there's no point currently being moved
|
||||||
|
int previous_lit_point = lit_point;
|
||||||
|
findClosestPoint();
|
||||||
|
if (distanceX <= minDistanceX) {
|
||||||
|
new_type = CSMove;
|
||||||
|
lit_point = closest_point;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
new_type = CSPlus;
|
||||||
|
lit_point = -1;
|
||||||
|
}
|
||||||
|
if (lit_point != previous_lit_point)
|
||||||
|
draw (lit_point);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// a point is being moved
|
||||||
|
|
||||||
|
// bounds of the grabbed point
|
||||||
|
double leftBound = (grab_point == 0 ) ? 0. : curve.x[grab_point-1];
|
||||||
|
double rightBound = (grab_point == num-1) ? 1. : curve.x[grab_point+1];
|
||||||
|
double const bottomBound = 0.;
|
||||||
|
double const topBound = 1.;
|
||||||
|
|
||||||
|
double leftDeletionBound = leftBound - minDistanceX;
|
||||||
|
double rightDeletionBound = rightBound + minDistanceX;
|
||||||
|
double bottomDeletionBound = bottomBound - minDistanceY;
|
||||||
|
double topDeletionBound = topBound + minDistanceY;
|
||||||
|
|
||||||
|
// we memorize the previous position of the point, for optimization purpose
|
||||||
|
double prevPosX = curve.x[grab_point];
|
||||||
|
double prevPosY = curve.y[grab_point];
|
||||||
|
|
||||||
|
// we memorize the previous position of the point, for optimization purpose
|
||||||
|
ugpX += deltaX;
|
||||||
|
ugpY += deltaY;
|
||||||
|
|
||||||
|
// handling limitations along X axis
|
||||||
|
if (ugpX >= rightDeletionBound && (grab_point > 0 && grab_point < (num-1))) {
|
||||||
|
curve.x[grab_point] = -1.;
|
||||||
|
}
|
||||||
|
else if (ugpX <= leftDeletionBound && (grab_point > 0 && grab_point < (num-1))) {
|
||||||
|
curve.x[grab_point] = -1.;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// nextPosX is in bounds
|
||||||
|
curve.x[grab_point] = CLAMP(ugpX, leftBound, rightBound);
|
||||||
|
|
||||||
|
// Handling limitations along Y axis
|
||||||
|
if (ugpY >= topDeletionBound && grab_point != 0 && grab_point != num-1) {
|
||||||
|
curve.x[grab_point] = -1.;
|
||||||
|
}
|
||||||
|
else if (ugpY <= bottomDeletionBound && grab_point != 0 && grab_point != num-1) {
|
||||||
|
curve.x[grab_point] = -1.;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// nextPosY is in the bounds
|
||||||
|
curve.y[grab_point] = CLAMP(ugpY, 0.0, 1.0);
|
||||||
|
|
||||||
|
if (curve.x[grab_point] != prevPosX || curve.y[grab_point] != prevPosY) {
|
||||||
|
// we recalculate the curve only if we have to
|
||||||
|
interpolate ();
|
||||||
|
draw (lit_point);
|
||||||
notifyListener ();
|
notifyListener ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
|
||||||
case Gdk::LEAVE_NOTIFY:
|
retval = true;
|
||||||
// Pointer can LEAVE even when dragging the point, so we don't modify the cursor in this case
|
break;
|
||||||
// The cursor will have to LEAVE another time after the drag...
|
|
||||||
if (!buttonPressed)
|
|
||||||
if (grab_point == -1) {
|
|
||||||
new_type = CSArrow;
|
|
||||||
lit_point = -1;
|
|
||||||
draw (lit_point);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Gdk::MOTION_NOTIFY:
|
default:
|
||||||
if (curve.type == Linear || curve.type == Spline || curve.type == NURBS) {
|
break;
|
||||||
// get the pointer position
|
}
|
||||||
getCursorPosition(event);
|
if (new_type != cursor_type) {
|
||||||
|
cursor_type = new_type;
|
||||||
if (grab_point == -1) {
|
cursorManager.setCursor(cursor_type);
|
||||||
// there's no point currently being moved
|
}
|
||||||
int previous_lit_point = lit_point;
|
return retval;
|
||||||
findClosestPoint();
|
|
||||||
if (distanceX <= minDistanceX) {
|
|
||||||
new_type = CSMove;
|
|
||||||
lit_point = closest_point;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
new_type = CSPlus;
|
|
||||||
lit_point = -1;
|
|
||||||
}
|
|
||||||
if (lit_point != previous_lit_point)
|
|
||||||
draw (lit_point);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// a point is being moved
|
|
||||||
|
|
||||||
// bounds of the grabbed point
|
|
||||||
double leftBound = (grab_point == 0 ) ? 0. : curve.x[grab_point-1];
|
|
||||||
double rightBound = (grab_point == num-1) ? 1. : curve.x[grab_point+1];
|
|
||||||
double const bottomBound = 0.;
|
|
||||||
double const topBound = 1.;
|
|
||||||
|
|
||||||
double leftDeletionBound = leftBound - minDistanceX;
|
|
||||||
double rightDeletionBound = rightBound + minDistanceX;
|
|
||||||
double bottomDeletionBound = bottomBound - minDistanceY;
|
|
||||||
double topDeletionBound = topBound + minDistanceY;
|
|
||||||
|
|
||||||
// we memorize the previous position of the point, for optimization purpose
|
|
||||||
double prevPosX = curve.x[grab_point];
|
|
||||||
double prevPosY = curve.y[grab_point];
|
|
||||||
|
|
||||||
// we memorize the previous position of the point, for optimization purpose
|
|
||||||
ugpX += deltaX;
|
|
||||||
ugpY += deltaY;
|
|
||||||
|
|
||||||
// handling limitations along X axis
|
|
||||||
if (ugpX >= rightDeletionBound && (grab_point > 0 && grab_point < (num-1))) {
|
|
||||||
curve.x[grab_point] = -1.;
|
|
||||||
}
|
|
||||||
else if (ugpX <= leftDeletionBound && (grab_point > 0 && grab_point < (num-1))) {
|
|
||||||
curve.x[grab_point] = -1.;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
// nextPosX is in bounds
|
|
||||||
curve.x[grab_point] = CLAMP(ugpX, leftBound, rightBound);
|
|
||||||
|
|
||||||
// Handling limitations along Y axis
|
|
||||||
if (ugpY >= topDeletionBound && grab_point != 0 && grab_point != num-1) {
|
|
||||||
curve.x[grab_point] = -1.;
|
|
||||||
}
|
|
||||||
else if (ugpY <= bottomDeletionBound && grab_point != 0 && grab_point != num-1) {
|
|
||||||
curve.x[grab_point] = -1.;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
// nextPosY is in the bounds
|
|
||||||
curve.y[grab_point] = CLAMP(ugpY, 0.0, 1.0);
|
|
||||||
|
|
||||||
if (curve.x[grab_point] != prevPosX || curve.y[grab_point] != prevPosY) {
|
|
||||||
// we recalculate the curve only if we have to
|
|
||||||
interpolate ();
|
|
||||||
draw (lit_point);
|
|
||||||
notifyListener ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
retval = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (new_type != cursor_type) {
|
|
||||||
cursor_type = new_type;
|
|
||||||
cursorManager.setCursor(cursor_type);
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyCurve::getCursorPosition(GdkEvent* event) {
|
void MyCurve::getCursorPosition(GdkEvent* event) {
|
||||||
|
@ -84,7 +84,7 @@ void PerspCorrection::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void PerspCorrection::setAdjusterBehavior (bool badd) {
|
void PerspCorrection::setAdjusterBehavior (bool badd) {
|
||||||
|
|
||||||
if (!vAdd && badd || vAdd && !badd) {
|
if ((!vAdd && badd) || (vAdd && !badd)) {
|
||||||
// horiz->setLimits (-0.005, 0.005, 0.0001, 0);
|
// horiz->setLimits (-0.005, 0.005, 0.0001, 0);
|
||||||
// vert->setLimits (-0.005, 0.005, 0.0001, 0);
|
// vert->setLimits (-0.005, 0.005, 0.0001, 0);
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) {
|
|||||||
get_window()->set_cursor (*cCropMoving);
|
get_window()->set_cursor (*cCropMoving);
|
||||||
else
|
else
|
||||||
get_window()->set_cursor (*cNormal);
|
get_window()->set_cursor (*cNormal);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PreviewWindow::on_button_press_event (GdkEventButton* event) {
|
bool PreviewWindow::on_button_press_event (GdkEventButton* event) {
|
||||||
@ -201,6 +201,7 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event) {
|
|||||||
}
|
}
|
||||||
get_window()->set_cursor (*cCropMoving);
|
get_window()->set_cursor (*cCropMoving);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PreviewWindow::on_button_release_event (GdkEventButton* event) {
|
bool PreviewWindow::on_button_release_event (GdkEventButton* event) {
|
||||||
@ -213,4 +214,5 @@ bool PreviewWindow::on_button_release_event (GdkEventButton* event) {
|
|||||||
get_window()->set_cursor (*cNormal);
|
get_window()->set_cursor (*cNormal);
|
||||||
mainCropWin->remoteMoveReady ();
|
mainCropWin->remoteMoveReady ();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ void Rotate::setBatchMode (bool batchMode) {
|
|||||||
|
|
||||||
void Rotate::setAdjusterBehavior (bool brotadd) {
|
void Rotate::setAdjusterBehavior (bool brotadd) {
|
||||||
|
|
||||||
if (!degAdd && brotadd || degAdd && !brotadd)
|
if ((!degAdd && brotadd) || (degAdd && !brotadd))
|
||||||
degree->setLimits (-45, 45, 0.01, 0);
|
degree->setLimits (-45, 45, 0.01, 0);
|
||||||
|
|
||||||
degAdd = brotadd;
|
degAdd = brotadd;
|
||||||
|
@ -347,9 +347,9 @@ void ToneCurve::setAdjusterBehavior (bool expadd, bool bradd, bool blackadd, boo
|
|||||||
black->setLimits (0, 16384, 1, 0);
|
black->setLimits (0, 16384, 1, 0);
|
||||||
else if (blackAdd && !blackadd)
|
else if (blackAdd && !blackadd)
|
||||||
black->setLimits (0, 32768, 1, 0);
|
black->setLimits (0, 32768, 1, 0);
|
||||||
if (!brAdd && bradd || brAdd && !bradd)
|
if ((!brAdd && bradd) || (brAdd && !bradd))
|
||||||
brightness->setLimits (-100, 100, 1, 0);
|
brightness->setLimits (-100, 100, 1, 0);
|
||||||
if (!contrAdd && contradd || contrAdd && !contradd)
|
if ((!contrAdd && contradd) || (contrAdd && !contradd))
|
||||||
contrast->setLimits (-100, 100, 1, 0);
|
contrast->setLimits (-100, 100, 1, 0);
|
||||||
|
|
||||||
expAdd = expadd;
|
expAdd = expadd;
|
||||||
|
@ -77,7 +77,7 @@ void Vignetting::adjusterChanged (Adjuster* a, double newval) {
|
|||||||
|
|
||||||
void Vignetting::setAdjusterBehavior (bool bvadd) {
|
void Vignetting::setAdjusterBehavior (bool bvadd) {
|
||||||
|
|
||||||
if (!vigAdd && bvadd || vigAdd && !bvadd)
|
if ((!vigAdd && bvadd) || (vigAdd && !bvadd))
|
||||||
amount->setLimits (-100, 100, 1, 0);
|
amount->setLimits (-100, 100, 1, 0);
|
||||||
|
|
||||||
vigAdd = bvadd;
|
vigAdd = bvadd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user