Author: post
Date: 2013-04-20 19:44:08 +0200 (Sat, 20 Apr 2013)
New Revision: 535

Modified:
   RawSpeed/DngOpcodes.cpp
Log:
Be sure we are adding uncropped positions as bad pixels.

Modified: RawSpeed/DngOpcodes.cpp
===================================================================
--- RawSpeed/DngOpcodes.cpp     2013-04-17 20:43:56 UTC (rev 534)
+++ RawSpeed/DngOpcodes.cpp     2013-04-20 17:44:08 UTC (rev 535)
@@ -135,12 +135,14 @@
 
 void OpcodeFixBadPixelsConstant::apply( RawImage &in, RawImage &out, int 
startY, int endY )
 {
+  iPoint2D crop = in->getCropOffset();
+  uint32 offset = crop.x | (crop.y << 16);
   vector<uint32> bad_pos;
   for (int y = startY; y < endY; y ++) {
     ushort16* src = (ushort16*)out->getData(0, y);
     for (int x = 0; x < in->dim.x; x++) {
       if (src[x]== mValue) {
-        bad_pos.push_back(((uint32)x | (uint32)y<<16));
+        bad_pos.push_back(offset + ((uint32)x | (uint32)y<<16));
       }
     }
   }
@@ -192,7 +194,12 @@
 
 void OpcodeFixBadPixelsList::apply( RawImage &in, RawImage &out, int startY, 
int endY )
 {
-  out->mBadPixelPositions.insert(out->mBadPixelPositions.end(), 
bad_pos.begin(), bad_pos.end());
+  iPoint2D crop = in->getCropOffset();
+  uint32 offset = crop.x | (crop.y << 16);
+  for (vector<uint32>::iterator i=bad_pos.begin(); i != bad_pos.end(); i++) {
+    uint32 pos = offset + (*i);
+    out->mBadPixelPositions.push_back(pos);
+  }
 }
 
  /***************** OpcodeTrimBounds   ****************/


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

Reply via email to