summaryrefslogtreecommitdiff
path: root/basebmp/test
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2006-06-07 13:27:36 +0000
committerThorsten Behrens <thb@openoffice.org>2006-06-07 13:27:36 +0000
commit4999aa5c72de27ffd28944a2f56d68933ce1ee52 (patch)
tree2dd7c12c96b8cc9e33e5893e0b46878d1223fb83 /basebmp/test
parent0ef3a9bf3418c03f350df5f91c9c623018c715cb (diff)
#i65904# Finished xor and mask support; corrected Color handling
Diffstat (limited to 'basebmp/test')
-rw-r--r--basebmp/test/basictest.cxx25
-rw-r--r--basebmp/test/bmpdemo.cxx9
2 files changed, 26 insertions, 8 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx
index d4c2c4d9b2b8..8e33561303f6 100644
--- a/basebmp/test/basictest.cxx
+++ b/basebmp/test/basictest.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: basictest.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: thb $ $Date: 2006-06-02 13:57:25 $
+ * last change: $Author: thb $ $Date: 2006-06-07 14:27:36 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -43,11 +43,20 @@
#include <basebmp/color.hxx>
#include <basebmp/scanlineformats.hxx>
#include <basebmp/bitmapdevice.hxx>
+#include <basebmp/debug.hxx>
+#include "tools.hxx"
+
+#include <iostream>
+#include <fstream>
using namespace ::basebmp;
namespace
{
+/*
+ std::ofstream output("32bpp_test.dump");
+ debugDump( mpDevice32bpp, output );
+*/
class BasicTest : public CppUnit::TestFixture
{
@@ -100,23 +109,27 @@ public:
const basegfx::B2IPoint aPt5(100000,100000);
pDevice->setPixel( aPt5, aCol3, DrawMode_PAINT );
- // 8bpp
+ // 8bit alpha
{
pDevice = createBitmapDevice( aSize,
true,
Format::EIGHT_BIT_GRAY );
- const Color aCol4(0x01);
+ const Color aCol4(0x010101);
pDevice->setPixel( aPt, aCol4, DrawMode_PAINT );
+
+ std::ofstream output("32bpp_test.dump");
+ debugDump( pDevice, output );
+
CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #4",
pDevice->getPixel(aPt) == aCol4);
- const Color aCol5(0x0F);
+ const Color aCol5(0x0F0F0F);
pDevice->setPixel( aPt2, aCol5, DrawMode_PAINT );
CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #5",
pDevice->getPixel(aPt2) == aCol5);
- const Color aCol6(0xFF);
+ const Color aCol6(0xFFFFFF);
pDevice->setPixel( aPt3, aCol6, DrawMode_PAINT );
CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #6",
pDevice->getPixel(aPt3) == aCol6);
diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx
index 99e9a5b14464..a35a36201187 100644
--- a/basebmp/test/bmpdemo.cxx
+++ b/basebmp/test/bmpdemo.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: bmpdemo.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: thb $ $Date: 2006-06-02 13:57:25 $
+ * last change: $Author: thb $ $Date: 2006-06-07 14:27:36 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1012,6 +1012,11 @@ void TestWindow::Paint( const Rectangle& rRect )
basegfx::tools::importFromSvgD( aPoly, aSvg );
const basebmp::Color aCol(0xFFFFFFFF);
pBmp->clear(basebmp::Color(0));
+
+ const basegfx::B2IPoint aPt(3,3);
+ const basebmp::Color aCol4(0x01);
+ pBmp->setPixel( aPt, aCol4, basebmp::DrawMode_PAINT );
+
pBmp->fillPolyPolygon(
aPoly,
aCol,