Author: post
Date: 2009-10-05 17:07:10 +0200 (Mon, 05 Oct 2009)
New Revision: 155

Modified:
   RawSpeed/RawDecoder.cpp
   RawSpeed/Rw2Decoder.cpp
   cameras.xml
Log:
- Added support for Panasonic DMC-FZ35 (only 4:3 mode).
- Made "mode" non-optional for Panasonic cameras to avoid unneeded code 
maintenance.
- Fixed Win32 threads.


Modified: RawSpeed/RawDecoder.cpp
===================================================================
--- RawSpeed/RawDecoder.cpp     2009-09-29 18:26:02 UTC (rev 154)
+++ RawSpeed/RawDecoder.cpp     2009-10-05 15:07:10 UTC (rev 155)
@@ -176,10 +176,16 @@
 }
 
 void RawDecoder::startThreads() {
-  guint threads = rs_get_number_of_processor_cores();
+  guint threads;
+#ifdef WIN32
+  threads = pthread_num_processors_np();
+#else
+  // FIXME: Don't depend on Rawstudio.
+  threads = rs_get_number_of_processor_cores(); 
+#endif
   int y_offset = 0;
   int y_per_thread = (mRaw->dim.y + threads - 1) / threads;
-  RawDecoderThread t[threads];
+  RawDecoderThread *t = new RawDecoderThread[threads];
 
   pthread_attr_t attr;
 
@@ -202,6 +208,7 @@
       errors.push_back(t[i].error);
     }
   }
+  delete[] t;
 }
 
 void RawDecoder::decodeThreaded(RawDecoderThread * t) {

Modified: RawSpeed/Rw2Decoder.cpp
===================================================================
--- RawSpeed/Rw2Decoder.cpp     2009-09-29 18:26:02 UTC (rev 154)
+++ RawSpeed/Rw2Decoder.cpp     2009-10-05 15:07:10 UTC (rev 155)
@@ -163,16 +163,14 @@
     ratio = (float)mRaw->dim.x / (float)mRaw->dim.y;
   }
 
-  if (!model.compare("DMC-LX3") || !model.compare("DMC-G1") || 
!model.compare("DMC-GH1") || !model.compare("DMC-GF1")) {
-    if (almostEqualRelative(ratio, 16.0f / 9.0f, 0.02f))
-      return "16:9";
-    if (almostEqualRelative(ratio, 3.0f / 2.0f, 0.02f))
-      return "3:2";
-    if (almostEqualRelative(ratio, 4.0f / 3.0f, 0.02f))
-      return "4:3";
-    if (almostEqualRelative(ratio, 1.0f, 0.02f))
-      return "1:1";
-  }
+  if (almostEqualRelative(ratio, 16.0f / 9.0f, 0.02f))
+    return "16:9";
+  if (almostEqualRelative(ratio, 3.0f / 2.0f, 0.02f))
+    return "3:2";
+  if (almostEqualRelative(ratio, 4.0f / 3.0f, 0.02f))
+    return "4:3";
+  if (almostEqualRelative(ratio, 1.0f, 0.02f))
+    return "1:1";
 
   return "";
 }

Modified: cameras.xml
===================================================================
--- cameras.xml 2009-09-29 18:26:02 UTC (rev 154)
+++ cameras.xml 2009-10-05 15:07:10 UTC (rev 155)
@@ -683,7 +683,7 @@
     <Crop x="0" y="0" width="4094" height="3082"/>
     <Sensor black="55" white="4095"/>
   </Camera>
-  <Camera make="Panasonic" model = "DMC-FX150">
+  <Camera make="Panasonic" model = "DMC-FX150" mode = "4:3">
     <CFA width="2" height="2">
       <Color x="0" y="0">BLUE</Color><Color x="1" y="0">GREEN</Color>
       <Color x="0" y="1">GREEN</Color><Color x="1" y="1">RED</Color>
@@ -691,7 +691,7 @@
     <Crop x="0" y="0" width="4429" height="3324"/>
     <Sensor black="15" white="3986"/>
   </Camera>
-  <Camera make="Panasonic" model = "DMC-FZ28">
+  <Camera make="Panasonic" model = "DMC-FZ28" mode = "4:3">
     <CFA width="2" height="2">
       <Color x="0" y="0">BLUE</Color><Color x="1" y="0">GREEN</Color>
       <Color x="0" y="1">GREEN</Color><Color x="1" y="1">RED</Color>
@@ -731,8 +731,16 @@
     <Crop x="0" y="0" width="-28" height="0"/>
     <Sensor black="0" white="5111"/>
   </Camera>
-  <Camera make="Panasonic" model = "DMC-FZ38">
+  <Camera make="Panasonic" model = "DMC-FZ35" mode="4:3">
     <CFA width="2" height="2">
+      <Color x="0" y="0">GREEN</Color><Color x="1" y="0">BLUE</Color>
+      <Color x="0" y="1">RED</Color><Color x="1" y="1">GREEN</Color>
+    </CFA>
+    <Crop x="0" y="0" width="-44" height="0"/>
+    <Sensor black="0" white="4800"/>
+  </Camera>
+  <Camera make="Panasonic" model = "DMC-FZ38" mode = "4:3">
+    <CFA width="2" height="2">
       <Color x="0" y="0">BLUE</Color><Color x="1" y="0">GREEN</Color>
       <Color x="0" y="1">GREEN</Color><Color x="1" y="1">RED</Color>
     </CFA>


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to