xref: /AOO41X/main/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx (revision 2694e8342f8da7abb15ff7dcb61e2de5a28d6b30)
1 /*************************************************************************
2  *
3  *  OpenOffice.org - a multi-platform office productivity suite
4  *
5  *  $RCSfile: alphaprimitive2d.hxx,v $
6  *
7  *  $Revision: 1.3 $
8  *
9  *  last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
10  *
11  *  The Contents of this file are made available subject to
12  *  the terms of GNU Lesser General Public License Version 2.1.
13  *
14  *
15  *    GNU Lesser General Public License Version 2.1
16  *    =============================================
17  *    Copyright 2005 by Sun Microsystems, Inc.
18  *    901 San Antonio Road, Palo Alto, CA 94303, USA
19  *
20  *    This library is free software; you can redistribute it and/or
21  *    modify it under the terms of the GNU Lesser General Public
22  *    License version 2.1, as published by the Free Software Foundation.
23  *
24  *    This library is distributed in the hope that it will be useful,
25  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27  *    Lesser General Public License for more details.
28  *
29  *    You should have received a copy of the GNU Lesser General Public
30  *    License along with this library; if not, write to the Free Software
31  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32  *    MA  02111-1307  USA
33  *
34  ************************************************************************/
35 
36 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
37 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
38 
39 #include <drawinglayer/drawinglayerdllapi.h>
40 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
41 
42 //////////////////////////////////////////////////////////////////////////////
43 
44 namespace drawinglayer
45 {
46 	namespace primitive2d
47 	{
48         /** TransparencePrimitive2D class
49 
50             This is the basic primitive for applying freely defined transparence
51             to freely defined content. The basic idea is to associate a content
52             which is defined as a sequence of primitives and hold as child content
53             in the GroupPrimitive2D with a transparence channel also defined as a sequence
54             of primitives and hold in the transparence member.
55 
56             The basic definition is to use the transparence content as transparence-Mask by
57             interpreting the transparence-content not as RGB, but as Luminance transparence mask
58             using the common RGB_to_luminance definition as e.g. used by VCL.
59 
60             The defining geometry is the Range of the child primitive sequence,
61             this means the renderers will/shall use this geometric information for
62             rendering, not the transparent one. The transparent one should/will be clipped
63             accordingly.
64          */
65 		class DRAWINGLAYER_DLLPUBLIC TransparencePrimitive2D : public GroupPrimitive2D
66 		{
67 		private:
68             /// The transparence-Mask who's RGB-Values are interpreted as Luminance
69 			Primitive2DSequence						maTransparence;
70 
71 		public:
72             /** constructor
73 
74                 @param rChildren
75                 The content which is defined to have a transparency. The
76                 range of this primitive is defined by this content
77 
78                 @param rTransparence
79                 The definition of the Transparence-channel for this primitive. It
80                 will be interpreted as mask by interpreting as gray values
81                 using the common RGB_to_luminance definitions
82              */
83 			TransparencePrimitive2D(
84 				const Primitive2DSequence& rChildren,
85 				const Primitive2DSequence& rTransparence);
86 
87 			/// data read access
88 			const Primitive2DSequence& getTransparence() const { return maTransparence; }
89 
90 			/// compare operator
91 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
92 
93 			/// provide unique ID
94 			DeclPrimitrive2DIDBlock()
95 		};
96 	} // end of namespace primitive2d
97 } // end of namespace drawinglayer
98 
99 //////////////////////////////////////////////////////////////////////////////
100 
101 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
102 
103 //////////////////////////////////////////////////////////////////////////////
104 // eof
105