Author: post
Date: 2013-09-20 22:09:56 +0200 (Fri, 20 Sep 2013)
New Revision: 583

Modified:
   RawSpeed/ArwDecoder.cpp
   RawSpeed/NefDecoder.cpp
   RawSpeed/NikonDecompressor.cpp
   RawSpeed/NikonDecompressor.h
Log:
ARW, NEF, DNG: Allow uncorrected values.

Modified: RawSpeed/ArwDecoder.cpp
===================================================================
--- RawSpeed/ArwDecoder.cpp     2013-09-20 20:06:01 UTC (rev 582)
+++ RawSpeed/ArwDecoder.cpp     2013-09-20 20:09:56 UTC (rev 583)
@@ -241,7 +241,10 @@
           if (p > 0x7ff)
             p = 0x7ff;
         }
-        dest[x+i*2] = curve[p << 1];
+        if (uncorrectedRawValues)
+          dest[x+i*2] = p;
+        else
+          dest[x+i*2] = curve[p << 1];
       }
       x += x & 1 ? 31 : 1;  // Skip to next 32 pixels
     }

Modified: RawSpeed/NefDecoder.cpp
===================================================================
--- RawSpeed/NefDecoder.cpp     2013-09-20 20:06:01 UTC (rev 582)
+++ RawSpeed/NefDecoder.cpp     2013-09-20 20:09:56 UTC (rev 583)
@@ -113,7 +113,7 @@
 
   try {
     NikonDecompressor decompressor(mFile, mRaw);
-
+    decompressor.uncorrectedRawValues = uncorrectedRawValues;
     ByteStream* metastream;
     if (getHostEndianness() == data[0]->endian)
       metastream = new ByteStream(meta->getData(), meta->count);

Modified: RawSpeed/NikonDecompressor.cpp
===================================================================
--- RawSpeed/NikonDecompressor.cpp      2013-09-20 20:06:01 UTC (rev 582)
+++ RawSpeed/NikonDecompressor.cpp      2013-09-20 20:09:56 UTC (rev 583)
@@ -80,7 +80,7 @@
   uint32 csize = metadata->getShort();
   if (csize  > 1)
     step = _max / (csize - 1);
-  if (v0 == 68 && v1 == 32 && step > 0) {
+  if (v0 == 68 && v1 == 32 && step > 0 && !uncorrectedRawValues) {
     for (uint32 i = 0; i < csize; i++)
       curve[i*step] = metadata->getShort();
     for (int i = 0; i < _max; i++)
@@ -88,7 +88,7 @@
                   curve[i-i%step+step] * (i % step)) / step;
     metadata->setAbsoluteOffset(562);
     split = metadata->getShort();
-  } else if (v0 != 70 && csize <= 0x4001) {
+  } else if (v0 != 70 && csize <= 0x4001 && !uncorrectedRawValues) {
     for (uint32 i = 0; i < csize; i++) {
       curve[i] = metadata->getShort();
     }

Modified: RawSpeed/NikonDecompressor.h
===================================================================
--- RawSpeed/NikonDecompressor.h        2013-09-20 20:06:01 UTC (rev 582)
+++ RawSpeed/NikonDecompressor.h        2013-09-20 20:09:56 UTC (rev 583)
@@ -35,6 +35,7 @@
 public:
   virtual ~NikonDecompressor(void);
   void DecompressNikon(ByteStream *meta, uint32 w, uint32 h, uint32 bitsPS, 
uint32 offset, uint32 size);
+  bool uncorrectedRawValues;
 private:
   void initTable(uint32 huffSelect);
   int HuffDecodeNikon();


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

Reply via email to