equal
deleted
inserted
replaced
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
91 if(!buffer2) |
91 if(!buffer2) |
92 { |
92 { |
93 delete[] buffer1; |
93 delete[] buffer1; |
94 return KErrNoMemory; |
94 return KErrNoMemory; |
95 } |
95 } |
96 TPtr8 scanLine2(buffer1, scanLineLength2, scanLineLength2); |
96 TPtr8 scanLine2(buffer2, scanLineLength2, scanLineLength2); |
97 |
97 |
98 //Perform scanline to scanline comparison without comparison mask |
98 //Perform scanline to scanline comparison without comparison mask |
99 for(TInt y=0; y<localSize.iHeight; y++) |
99 for(TInt y=0; y<localSize.iHeight; y++) |
100 { |
100 { |
101 aBitmap1.GetScanLine(scanLine1, localPoint1+TPoint(0,y), localSize.iWidth, ERgb); |
101 aBitmap1.GetScanLine(scanLine1, localPoint1+TPoint(0,y), localSize.iWidth, ERgb); |
107 //so perform pixel by pixel comparison using mask |
107 //so perform pixel by pixel comparison using mask |
108 TRgb pixel1, pixel2; |
108 TRgb pixel1, pixel2; |
109 for(TInt x=0; x<localSize.iWidth; x++) |
109 for(TInt x=0; x<localSize.iWidth; x++) |
110 { |
110 { |
111 pixel1 = *(((TRgb*)buffer1) + x); |
111 pixel1 = *(((TRgb*)buffer1) + x); |
112 pixel2 = *(((TRgb*)buffer1) + x); |
112 pixel2 = *(((TRgb*)buffer2) + x); |
113 |
113 |
114 if( (pixel1.Internal()& aComparisonMask) != (pixel2.Internal()& aComparisonMask)) |
114 if( (pixel1.Internal()& aComparisonMask) != (pixel2.Internal()& aComparisonMask)) |
115 { |
115 { |
116 RDebug::Print(_L("x = %d y = %d pixel1= %x pixel2 = %x"), x, y, pixel1.Internal(), pixel2.Internal()); |
116 RDebug::Print(_L("x = %d y = %d pixel1= %x pixel2 = %x"), x, y, pixel1.Internal(), pixel2.Internal()); |
117 delete[] buffer2; |
117 delete[] buffer2; |