equal
deleted
inserted
replaced
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2009 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". |
14 // |
14 // |
15 |
15 |
16 /** |
16 /** |
17 @file |
17 @file |
18 @test |
18 @test |
|
19 @internalComponent - Internal Symbian test code |
19 */ |
20 */ |
20 |
21 |
21 #include "graphicsimagecomparison.h" |
22 #include "graphicsimagecomparison.h" |
22 |
23 |
23 /** |
24 /** |
91 if(!buffer2) |
92 if(!buffer2) |
92 { |
93 { |
93 delete[] buffer1; |
94 delete[] buffer1; |
94 return KErrNoMemory; |
95 return KErrNoMemory; |
95 } |
96 } |
96 TPtr8 scanLine2(buffer2, scanLineLength2, scanLineLength2); |
97 TPtr8 scanLine2(buffer1, scanLineLength2, scanLineLength2); |
97 |
98 |
98 //Perform scanline to scanline comparison without comparison mask |
99 //Perform scanline to scanline comparison without comparison mask |
99 for(TInt y=0; y<localSize.iHeight; y++) |
100 for(TInt y=0; y<localSize.iHeight; y++) |
100 { |
101 { |
101 aBitmap1.GetScanLine(scanLine1, localPoint1+TPoint(0,y), localSize.iWidth, ERgb); |
102 aBitmap1.GetScanLine(scanLine1, localPoint1+TPoint(0,y), localSize.iWidth, ERgb); |
107 //so perform pixel by pixel comparison using mask |
108 //so perform pixel by pixel comparison using mask |
108 TRgb pixel1, pixel2; |
109 TRgb pixel1, pixel2; |
109 for(TInt x=0; x<localSize.iWidth; x++) |
110 for(TInt x=0; x<localSize.iWidth; x++) |
110 { |
111 { |
111 pixel1 = *(((TRgb*)buffer1) + x); |
112 pixel1 = *(((TRgb*)buffer1) + x); |
112 pixel2 = *(((TRgb*)buffer2) + x); |
113 pixel2 = *(((TRgb*)buffer1) + x); |
113 |
114 |
114 if( (pixel1.Internal()& aComparisonMask) != (pixel2.Internal()& aComparisonMask)) |
115 if( (pixel1.Internal()& aComparisonMask) != (pixel2.Internal()& aComparisonMask)) |
115 { |
116 { |
116 RDebug::Print(_L("x = %d y = %d pixel1= %x pixel2 = %x"), x, y, pixel1.Internal(), pixel2.Internal()); |
117 RDebug::Print(_L("x = %d y = %d pixel1= %x pixel2 = %x"), x, y, pixel1.Internal(), pixel2.Internal()); |
117 delete[] buffer2; |
118 delete[] buffer2; |