1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
21 #define INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/processor3d/defaultprocessor3d.hxx>
26 #include <vcl/bitmapex.hxx>
32 namespace drawinglayer
{
34 class SdrSceneAttribute
;
35 class SdrLightingAttribute
;
36 class MaterialAttribute3D
;
39 class ViewInformation2D
;
43 class ZBufferRasterConverter3D
;
44 class RasterPrimitive3D
;
46 namespace drawinglayer
51 This 3D renderer derived from DefaultProcessor3D renders all feeded primitives to a 2D
52 raster bitmap using a Z-Buffer based approach. It is able to supersample and to handle
55 class ZBufferProcessor3D
: public DefaultProcessor3D
58 /// the raster target, a Z-Buffer
59 basegfx::BZPixelRaster
* mpBZPixelRaster
;
61 /// inverse of EyeToView for rasterconversion with evtl. Phong shading
62 basegfx::B3DHomMatrix maInvEyeToView
;
64 /// The raster converter for Z-Buffer
65 ZBufferRasterConverter3D
* mpZBufferRasterConverter3D
;
67 /* AA value. Defines how many oversamples will be used in X and Y. Values 0, 1
68 will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
70 sal_uInt16 mnAntiAlialize
;
72 /* remembered RasterPrimitive3D's which need to be painted back to front
73 for transparent 3D parts
75 std::vector
< RasterPrimitive3D
>* mpRasterPrimitive3Ds
;
77 // rasterconversions for filled and non-filled polygons
79 virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D
& rMaterial
, const basegfx::B3DPolygon
& rHairline
) const SAL_OVERRIDE
;
80 virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D
& rMaterial
, const basegfx::B3DPolyPolygon
& rFill
) const SAL_OVERRIDE
;
84 const geometry::ViewInformation3D
& rViewInformation3D
,
85 const geometry::ViewInformation2D
& rViewInformation2D
,
86 const attribute::SdrSceneAttribute
& rSdrSceneAttribute
,
87 const attribute::SdrLightingAttribute
& rSdrLightingAttribute
,
90 const basegfx::B2DRange
& rVisiblePart
,
91 sal_uInt16 nAntiAlialize
);
92 virtual ~ZBufferProcessor3D();
96 /// get the result as bitmapEx
97 BitmapEx
getBitmapEx() const;
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */