summaryrefslogtreecommitdiff
path: root/graphics/qtpfsgui/qtpfsgui-1.9.2-trunk.patch
blob: b817317b1af2cac85959581a4ed5a140a0e423dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Index: trunk/qtpfsgui/src/Fileformat/pfsoutldrimage.cpp
===================================================================
--- trunk/qtpfsgui/src/Fileformat/pfsoutldrimage.cpp	(revision 319)
+++ trunk/qtpfsgui/src/Fileformat/pfsoutldrimage.cpp	(working copy)
@@ -62,9 +62,9 @@
 			*(data + 2 + (y*width+x)*4) = ( clamp( (*R)( x, y )*255.f, 0, 255) );
 			*(data + 3 + (y*width+x)*4) = 0xff;
 			} else {
-			*(data + 3 + (y*width+x)*4) = ( clamp( (*B)( x, y )*255.f, 0, 255) );
+			*(data + 3 + (y*width+x)*4) = ( clamp( (*R)( x, y )*255.f, 0, 255) );
 			*(data + 2 + (y*width+x)*4) = ( clamp( (*G)( x, y )*255.f, 0, 255) );
-			*(data + 1 + (y*width+x)*4) = ( clamp( (*R)( x, y )*255.f, 0, 255) );
+			*(data + 1 + (y*width+x)*4) = ( clamp( (*B)( x, y )*255.f, 0, 255) );
 			*(data + 0 + (y*width+x)*4) = 0xff;
 			}
 		}
Index: trunk/qtpfsgui/src/Common/gamma_and_levels.cpp
===================================================================
--- trunk/qtpfsgui/src/Common/gamma_and_levels.cpp	(revision 319)
+++ trunk/qtpfsgui/src/Common/gamma_and_levels.cpp	(working copy)
@@ -189,12 +189,21 @@
 		return;
 	}
 
-	//increment bins
-	for (int i=0; i<data.width()*data.height(); i+=accuracy) {
-		int v=qGray(*((QRgb*)(data.bits())+i));
-		assert(v>=0 && v<=255);
-		P[v] += 1;
-	}
+// 	if (data.format()==QImage::Format_Indexed8) {
+// 		//increment bins
+// 		for (int i=0; i<data.width()*data.height(); i+=accuracy) {
+// 			const unsigned char v=*((const unsigned char*)(data.bits())+i);
+// 			P[v] += 1;
+// 		}
+// 		
+// 	} else {
+		//increment bins
+		for (int i=0; i<data.width()*data.height(); i+=accuracy) {
+			int v=qGray(*((QRgb*)(data.bits())+i));
+			assert(v>=0 && v<=255);
+			P[v] += 1;
+		}
+// 	}
 
 	//find max
 	float max=-1;
Index: trunk/qtpfsgui/src/Common/commandline.cpp
===================================================================
--- trunk/qtpfsgui/src/Common/commandline.cpp	(revision 319)
+++ trunk/qtpfsgui/src/Common/commandline.cpp	(working copy)
@@ -378,7 +378,7 @@
 	if (!saveHdrFilename.isEmpty()) {
 		VERBOSEPRINT("Saving to file %1.",saveHdrFilename);
 		QFileInfo qfi(saveHdrFilename);
-		const char* encodedName=QFile::encodeName(qfi.filePath()).constData();
+		char* encodedName=strdup(QFile::encodeName(qfi.filePath()).constData());
 		if (qfi.suffix().toUpper()=="EXR") {
 			writeEXRfile(HDR,encodedName);
 		} else if (qfi.suffix().toUpper()=="HDR") {
@@ -397,6 +397,7 @@
 		} else {
 			error("Error, please specify a supported HDR file format.");
 		}
+		free(encodedName);
 	} else {
 		VERBOSEPRINT("NOT Saving HDR image to file. %1","");
 	}
Index: trunk/qtpfsgui/src/Common/options.cpp
===================================================================
--- trunk/qtpfsgui/src/Common/options.cpp	(revision 319)
+++ trunk/qtpfsgui/src/Common/options.cpp	(working copy)
@@ -60,8 +60,9 @@
 		if (!settings.contains(KEY_EXTERNAL_DCRAW_OPTIONS))
 			settings.setValue(KEY_EXTERNAL_DCRAW_OPTIONS,"-T");
 		dcraw_options=settings.value(KEY_EXTERNAL_DCRAW_OPTIONS).toStringList();
-		if (!settings.contains(KEY_EXTERNAL_AIS_OPTIONS))
-			settings.setValue(KEY_EXTERNAL_AIS_OPTIONS,"-a aligned_");
+		//bug 2001032, remove spurious default QString "-a aligned_" value set by ver 1.9.2
+		if (!settings.contains(KEY_EXTERNAL_AIS_OPTIONS) || settings.value(KEY_EXTERNAL_AIS_OPTIONS).toString()=="-a aligned_")
+			settings.setValue(KEY_EXTERNAL_AIS_OPTIONS, QStringList() << "-a" << "aligned_");
 		align_image_stack_options=settings.value(KEY_EXTERNAL_AIS_OPTIONS).toStringList();
 	settings.endGroup();
 
Index: trunk/qtpfsgui/src/Threads/loadHdrThread.cpp
===================================================================
--- trunk/qtpfsgui/src/Threads/loadHdrThread.cpp	(revision 319)
+++ trunk/qtpfsgui/src/Threads/loadHdrThread.cpp	(working copy)
@@ -58,7 +58,7 @@
 	QString extension = qfi.suffix().toUpper();
 	bool rawinput = (rawextensions.indexOf(extension)!=-1);
 	try {
-		const char* encodedFileName=QFile::encodeName(qfi.filePath()).constData();
+		char* encodedFileName=strdup(QFile::encodeName(qfi.filePath()).constData());
 		if (extension=="EXR") {
 			hdrpfsframe = readEXRfile(encodedFileName);
 		} else if (extension=="HDR") {
@@ -123,6 +123,7 @@
 			emit load_failed(tr("ERROR: File %1 has unsupported extension.").arg(fname));
 			return;
 		}
+		free(encodedFileName);
 #if 0
 		pfs::Channel *R,*G,*B;
 		hdrpfsframe->getRGBChannels( R, G, B );
Index: trunk/qtpfsgui/src/HdrCreation/HdrCreationManager.cpp
===================================================================
--- trunk/qtpfsgui/src/HdrCreation/HdrCreationManager.cpp	(revision 319)
+++ trunk/qtpfsgui/src/HdrCreation/HdrCreationManager.cpp	(working copy)
@@ -261,7 +261,7 @@
 		clearlists(false);
 		for (int i=0;i<fileList.size();i++) {
 			//align_image_stack can only output tiff files
-			const char* fname=QFile::encodeName(QString(qtpfsgui_options->tempfilespath + "/aligned_" + QString("%1").arg(i,4,10,QChar('0'))+".tif")).constData();
+			char* fname=strdup(QFile::encodeName(QString(qtpfsgui_options->tempfilespath + "/aligned_" + QString("%1").arg(i,4,10,QChar('0'))+".tif")).constData());
 			//qDebug("HCM: Loading back file name=%s", fname);
 			TiffReader reader(fname);
 			//if 8bit ldr tiff
@@ -279,6 +279,7 @@
 				listmdrB.push_back(B);
 			}
 			QFile::remove(fname);
+			free(fname);
 		}
 		QFile::remove(QString(qtpfsgui_options->tempfilespath + "/hugin_debug_optim_results.txt"));
 		emit finishedAligning();
Index: trunk/qtpfsgui/src/MainWindow/mainWindow.cpp
===================================================================
--- trunk/qtpfsgui/src/MainWindow/mainWindow.cpp	(revision 319)
+++ trunk/qtpfsgui/src/MainWindow/mainWindow.cpp	(working copy)
@@ -192,7 +192,8 @@
 		QString fname=(fd->selectedFiles()).at(0);
 		if(!fname.isEmpty()) {
 			QFileInfo qfi(fname);
-			const char* encodedName=QFile::encodeName(qfi.filePath()).constData();
+			QString absoluteFileName=qfi.absoluteFilePath();
+			char* encodedName=strdup(QFile::encodeName(absoluteFileName).constData());
 			// if the new dir, the one just chosen by the user, is different from the one stored in the settings, update the settings.
 			if (RecentDirHDRSetting != qfi.path() )
 				// update internal field variable
@@ -219,10 +220,11 @@
 				delete fd;
 				return;
 			}
-			setCurrentFile(fname);
+			free(encodedName);
+			setCurrentFile(absoluteFileName);
 			currenthdr->NeedsSaving=false;
-			currenthdr->filename=fname;
-			currenthdr->setWindowTitle(fname);
+			currenthdr->filename=absoluteFileName;
+			currenthdr->setWindowTitle(absoluteFileName);
 		}
 	} //if (fd->exec())
 	delete fd;