1*4bfbcde8SAndrew Rist /**************************************************************
2*4bfbcde8SAndrew Rist  *
3*4bfbcde8SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*4bfbcde8SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*4bfbcde8SAndrew Rist  * distributed with this work for additional information
6*4bfbcde8SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*4bfbcde8SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*4bfbcde8SAndrew Rist  * "License"); you may not use this file except in compliance
9*4bfbcde8SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*4bfbcde8SAndrew Rist  *
11*4bfbcde8SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*4bfbcde8SAndrew Rist  *
13*4bfbcde8SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*4bfbcde8SAndrew Rist  * software distributed under the License is distributed on an
15*4bfbcde8SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*4bfbcde8SAndrew Rist  * KIND, either express or implied.  See the License for the
17*4bfbcde8SAndrew Rist  * specific language governing permissions and limitations
18*4bfbcde8SAndrew Rist  * under the License.
19*4bfbcde8SAndrew Rist  *
20*4bfbcde8SAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
23cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
24cdf0e10cSrcweir 
25090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h>
26cdf0e10cSrcweir #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace drawinglayer
31cdf0e10cSrcweir {
32cdf0e10cSrcweir 	namespace primitive2d
33cdf0e10cSrcweir 	{
34cdf0e10cSrcweir         /** TransparencePrimitive2D class
35cdf0e10cSrcweir 
36cdf0e10cSrcweir             This is the basic primitive for applying freely defined transparence
37cdf0e10cSrcweir             to freely defined content. The basic idea is to associate a content
38cdf0e10cSrcweir             which is defined as a sequence of primitives and hold as child content
39cdf0e10cSrcweir             in the GroupPrimitive2D with a transparence channel also defined as a sequence
40cdf0e10cSrcweir             of primitives and hold in the transparence member.
41cdf0e10cSrcweir 
42cdf0e10cSrcweir             The basic definition is to use the transparence content as transparence-Mask by
43cdf0e10cSrcweir             interpreting the transparence-content not as RGB, but as Luminance transparence mask
44cdf0e10cSrcweir             using the common RGB_to_luminance definition as e.g. used by VCL.
45cdf0e10cSrcweir 
46cdf0e10cSrcweir             The defining geometry is the Range of the child primitive sequence,
47cdf0e10cSrcweir             this means the renderers will/shall use this geometric information for
48cdf0e10cSrcweir             rendering, not the transparent one. The transparent one should/will be clipped
49cdf0e10cSrcweir             accordingly.
50cdf0e10cSrcweir          */
51090f0eb8SEike Rathke 		class DRAWINGLAYER_DLLPUBLIC TransparencePrimitive2D : public GroupPrimitive2D
52cdf0e10cSrcweir 		{
53cdf0e10cSrcweir 		private:
54cdf0e10cSrcweir             /// The transparence-Mask who's RGB-Values are interpreted as Luminance
55cdf0e10cSrcweir 			Primitive2DSequence						maTransparence;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 		public:
58cdf0e10cSrcweir             /** constructor
59cdf0e10cSrcweir 
60cdf0e10cSrcweir                 @param rChildren
61cdf0e10cSrcweir                 The content which is defined to have a transparency. The
62cdf0e10cSrcweir                 range of this primitive is defined by this content
63cdf0e10cSrcweir 
64cdf0e10cSrcweir                 @param rTransparence
65cdf0e10cSrcweir                 The definition of the Transparence-channel for this primitive. It
66cdf0e10cSrcweir                 will be interpreted as mask by interpreting as gray values
67cdf0e10cSrcweir                 using the common RGB_to_luminance definitions
68cdf0e10cSrcweir              */
69cdf0e10cSrcweir 			TransparencePrimitive2D(
70cdf0e10cSrcweir 				const Primitive2DSequence& rChildren,
71cdf0e10cSrcweir 				const Primitive2DSequence& rTransparence);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 			/// data read access
getTransparence() const74cdf0e10cSrcweir 			const Primitive2DSequence& getTransparence() const { return maTransparence; }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 			/// compare operator
77cdf0e10cSrcweir 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 			/// provide unique ID
80cdf0e10cSrcweir 			DeclPrimitrive2DIDBlock()
81cdf0e10cSrcweir 		};
82cdf0e10cSrcweir 	} // end of namespace primitive2d
83cdf0e10cSrcweir } // end of namespace drawinglayer
84cdf0e10cSrcweir 
85cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
86cdf0e10cSrcweir 
87cdf0e10cSrcweir #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
88cdf0e10cSrcweir 
89cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
90cdf0e10cSrcweir // eof
91