summaryrefslogtreecommitdiff
path: root/basegfx/inc/basegfx/raster
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 22:56:55 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 22:56:55 +0000
commitf83e555c3497b6addb82b312bb22438ca433daf9 (patch)
tree1a4e037cefd8217a173b1cff4ca6641f7f252f50 /basegfx/inc/basegfx/raster
parent6f769fb8aaab1f899b3ca4551f6a8df2953cd938 (diff)
INTEGRATION: CWS aw033 (1.1.2); FILE ADDED
2008/08/19 16:43:44 cl 1.1.2.4: fixed license files 2008/08/13 09:34:39 aw 1.1.2.3: #i39532# exchanged memcpy with rtl_zeroMemory for fedora build 2008/05/27 14:08:44 aw 1.1.2.2: #i39532# changes DEV300 m12 resync corrections 2006/05/12 11:29:59 aw 1.1.2.1: code for primitive support
Diffstat (limited to 'basegfx/inc/basegfx/raster')
-rw-r--r--basegfx/inc/basegfx/raster/bzpixelraster.hxx100
1 files changed, 100 insertions, 0 deletions
diff --git a/basegfx/inc/basegfx/raster/bzpixelraster.hxx b/basegfx/inc/basegfx/raster/bzpixelraster.hxx
new file mode 100644
index 000000000000..f0bbad04d4ab
--- /dev/null
+++ b/basegfx/inc/basegfx/raster/bzpixelraster.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bzpixelraster.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _BGFX_RASTER_BZPIXELRASTER_HXX
+#define _BGFX_RASTER_BZPIXELRASTER_HXX
+
+#include <basegfx/raster/bpixelraster.hxx>
+#include <rtl/memory.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ class BZPixelRaster : public BPixelRaster
+ {
+ protected:
+ // additionally, host a ZBuffer
+ sal_uInt16* mpZBuffer;
+
+ public:
+ // reset
+ void resetZ()
+ {
+ reset();
+ rtl_zeroMemory(mpZBuffer, sizeof(sal_uInt16) * mnCount);
+ }
+
+ // constructor/destructor
+ BZPixelRaster(sal_uInt32 nWidth, sal_uInt32 nHeight)
+ : BPixelRaster(nWidth, nHeight),
+ mpZBuffer(new sal_uInt16[mnCount])
+ {
+ rtl_zeroMemory(mpZBuffer, sizeof(sal_uInt16) * mnCount);
+ }
+
+ ~BZPixelRaster()
+ {
+ delete [] mpZBuffer;
+ }
+
+ // data access read only
+ const sal_uInt16& getZ(sal_uInt32 nIndex) const
+ {
+#ifdef DBG_UTIL
+ if(nIndex >= mnCount)
+ {
+ OSL_ENSURE(false, "getZ: Access out of range (!)");
+ return mpZBuffer[0L];
+ }
+#endif
+ return mpZBuffer[nIndex];
+ }
+
+ // data access read/write
+ sal_uInt16& getZ(sal_uInt32 nIndex)
+ {
+#ifdef DBG_UTIL
+ if(nIndex >= mnCount)
+ {
+ OSL_ENSURE(false, "getZ: Access out of range (!)");
+ return mpZBuffer[0L];
+ }
+#endif
+ return mpZBuffer[nIndex];
+ }
+ };
+} // end of namespace basegfx
+
+#endif /* _BGFX_RASTER_BZPIXELRASTER_HXX */