[Rawstudio-commit] rawspeed r62 - RawSpeed

Klaus Post klauspost at gmail.com
Thu Feb 12 19:07:34 CET 2009


Author: post
Date: 2009-02-12 19:07:33 +0100 (Thu, 12 Feb 2009)
New Revision: 62

Modified:
   RawSpeed/ArwDecoder.cpp
   RawSpeed/NefDecoder.cpp
   RawSpeed/PefDecoder.cpp
Log:
- Fixed CFA patterns on a few Nikon, Sony & Pentax cameras.

Modified: RawSpeed/ArwDecoder.cpp
===================================================================
--- RawSpeed/ArwDecoder.cpp	2009-02-12 17:36:48 UTC (rev 61)
+++ RawSpeed/ArwDecoder.cpp	2009-02-12 18:07:33 UTC (rev 62)
@@ -1,22 +1,22 @@
 #include "StdAfx.h"
 #include "ArwDecoder.h"
-/* 
-    RawSpeed - RAW file decoder.
-
-    Copyright (C) 2009 Klaus Post
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
+/* 
+    RawSpeed - RAW file decoder.
+
+    Copyright (C) 2009 Klaus Post
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
     http://www.klauspost.com
@@ -167,7 +167,7 @@
     ThrowRDE("CR2 Decoder: Model name found");
 
   string model = data[0]->getEntry(MODEL)->getString();
-  if (!model.compare("DSLR-A700"))
-    mRaw->cfa.setCFA(CFA_GREEN2, CFA_BLUE, CFA_RED, CFA_GREEN);
+
+//  printf("Model:\"%s\"\n",model.c_str());
   
 }
\ No newline at end of file

Modified: RawSpeed/NefDecoder.cpp
===================================================================
--- RawSpeed/NefDecoder.cpp	2009-02-12 17:36:48 UTC (rev 61)
+++ RawSpeed/NefDecoder.cpp	2009-02-12 18:07:33 UTC (rev 62)
@@ -1,22 +1,22 @@
 #include "StdAfx.h"
 #include "NefDecoder.h"
-/* 
-    RawSpeed - RAW file decoder.
-
-    Copyright (C) 2009 Klaus Post
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
+/* 
+    RawSpeed - RAW file decoder.
+
+    Copyright (C) 2009 Klaus Post
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
     http://www.klauspost.com
@@ -114,19 +114,19 @@
   return mRaw;
 }
 
-/*
-Figure out if a NEF file is compressed.  These fancy heuristics
-are only needed for the D100, thanks to a bug in some cameras
-that tags all images as "compressed".
-*/
-gboolean NefDecoder::D100IsCompressed(guint offset)
-{
-  const guchar *test = mFile->getData(offset);
-  gint i;
-
-  for (i=15; i < 256; i+=16)
-    if (test[i]) return true;
-  return false;
+/*
+Figure out if a NEF file is compressed.  These fancy heuristics
+are only needed for the D100, thanks to a bug in some cameras
+that tags all images as "compressed".
+*/
+gboolean NefDecoder::D100IsCompressed(guint offset)
+{
+  const guchar *test = mFile->getData(offset);
+  gint i;
+
+  for (i=15; i < 256; i+=16)
+    if (test[i]) return true;
+  return false;
 } 
 
 void NefDecoder::DecodeUncompressed() {
@@ -224,7 +224,8 @@
   if (!model.compare("NIKON D2H")  ||
       !model.compare("NIKON D40X") ||
       !model.compare("NIKON D60") ||
-      !model.compare("NIKON D90") ) 
+      !model.compare("NIKON D90") ||
+      !model.compare("NIKON D80") )
   {
     mRaw->cfa.setCFA(CFA_GREEN2, CFA_BLUE, CFA_RED, CFA_GREEN);   
   }
@@ -239,7 +240,8 @@
     !model.compare("NIKON D1H") ||
     !model.compare("NIKON D40")  ||
     !model.compare("NIKON D50") ||
-    !model.compare("NIKON D70s"))  
+    !model.compare("NIKON D70s") ||  
+    !model.compare("NIKON D70") )
   {
     mRaw->cfa.setCFA(CFA_BLUE, CFA_GREEN, CFA_GREEN2, CFA_RED);
   }

Modified: RawSpeed/PefDecoder.cpp
===================================================================
--- RawSpeed/PefDecoder.cpp	2009-02-12 17:36:48 UTC (rev 61)
+++ RawSpeed/PefDecoder.cpp	2009-02-12 18:07:33 UTC (rev 62)
@@ -1,22 +1,22 @@
 #include "StdAfx.h"
 #include "PefDecoder.h"
-/* 
-    RawSpeed - RAW file decoder.
-
-    Copyright (C) 2009 Klaus Post
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
+/* 
+    RawSpeed - RAW file decoder.
+
+    Copyright (C) 2009 Klaus Post
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
     http://www.klauspost.com
@@ -72,5 +72,16 @@
 void PefDecoder::decodeMetaData()
 {
   mRaw->cfa.setCFA(CFA_RED, CFA_GREEN, CFA_GREEN2, CFA_BLUE);
+  vector<TiffIFD*> data = mRootIFD->getIFDsWithTag(MODEL);
 
+  if (data.empty())
+    ThrowRDE("PEF Decoder: Model name found");
+
+  string model(data[0]->getEntry(MODEL)->getString());
+  //printf("Model:\"%s\"\n",model.c_str());
+
+  if (!model.compare("PENTAX K20D        "))
+  {
+    mRaw->cfa.setCFA(CFA_BLUE, CFA_GREEN, CFA_GREEN2, CFA_RED);
+  }
 }
\ No newline at end of file




More information about the Rawstudio-commit mailing list