1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_rendering_Texture_idl__
24#define __com_sun_star_rendering_Texture_idl__
25
26#ifndef __com_sun_star_geometry_AffineMatrix2D_idl__
27#include <com/sun/star/geometry/AffineMatrix2D.idl>
28#endif
29#ifndef __com_sun_star_rendering_StrokeAttributes_idl__
30#include <com/sun/star/rendering/StrokeAttributes.idl>
31#endif
32
33module com { module sun { module star { module rendering {
34
35published interface XBitmap;
36published interface XParametricPolyPolygon2D;
37
38/** Contains all information needed to define a texture.<p>
39
40    This structure contains all information necessary to define a
41    texture. A texture describes the filled area of polygonal shapes,
42    providing its own transformation matrix, repeat mode, and
43    transparency.<p>
44
45    To achieve uniformity, if this texture has a bitmap set, it is
46    scaled in such a way that it will cover the same [0,1]x[0,1] box
47    as the hatch and the gradient. The transformation member can then
48    be used to scale the complete texture as it fits suit.<p>
49
50    @since OpenOffice 2.0
51 */
52published struct Texture
53{
54    /** Texture transformation from texture to primitive space.<p>
55
56        This member allows arbitrary transformations of the texture,
57        relative to the textured primitive. Thus, the total
58        transformation from the [0,1]x[0,1] texture space to the
59        device coordinate space is the concatenation of texture,
60        render state, and view state transformation (with only render
61        state and view state transformation being applied to the
62        textured primitive).<p>
63     */
64    ::com::sun::star::geometry::AffineMatrix2D	AffineTransform;
65
66    //-------------------------------------------------------------------------
67
68    /** Overall transparency of the texturing.<p>
69
70        The valid range for this value is [0,1], where 0 denotes
71        complete transparency, and 1 denotes fully opaque.<p>
72     */
73    double					                    Alpha;
74
75    //-------------------------------------------------------------------------
76
77    /** Specifies the number of parameterized polygons used for the texture.<p>
78
79        This member specifies the number of polygons the parametric
80        polygon interface is queried. The continuous range [0,1] of
81        the XParametricPolyPolygon::getOutline() method is divided up
82        into numberOfHatchPolygons equal parts, and for everyone of
83        these parts, the start of the interval is plugged into the
84        getOutline method. For example, if numberOfHatchPolygons is 2,
85        then getOutline is called twice, once with 0.0 and once with
86        0.5. Use this parameter to control the density of the
87        hatching.<p>
88     */
89    long					                    NumberOfHatchPolygons;
90
91    //-------------------------------------------------------------------------
92
93    /** Texture bitmap.<p>
94
95        This member can be used together with gradient and hatching.<p>
96
97        The bitmap is scaled to a one-by-one rectangle, to cover the
98        same area as both the gradient and the hatching.<p>
99    */
100    XBitmap					                    Bitmap;
101
102    //-------------------------------------------------------------------------
103
104    /** Texture gradient.<p>
105
106        This member can be used together with bitmap and hatching. The
107        parametric polygons color value is used to fill the returned
108        polygonal outlines.<p>
109     */
110    XParametricPolyPolygon2D                    Gradient;
111
112    //-------------------------------------------------------------------------
113
114    /** Texture hatching.<p>
115
116        This member can be used together with bitmap and gradient. The
117        parametric polygons color value is used to stroke the returned
118        polygonal outlines.<p>
119     */
120    XParametricPolyPolygon2D                    Hatching;
121
122    //-------------------------------------------------------------------------
123
124    /** Specifies the stroke attributes used for hatching.<p>
125
126        Use 0.0 as the strokeWidth here to indicate hair lines.<p>
127     */
128    StrokeAttributes		                    HatchAttributes;
129
130    //-------------------------------------------------------------------------
131
132    /** Repeat mode of the texture, x direction.<p>
133
134        The repeat mode is separated into x and y direction, this is
135        the x direction part. Permissible values are from the
136        <type>TexturingMode</type> constants.<p>
137    */
138    byte				                        RepeatModeX;
139
140    /** Repeat mode of the texture, y direction.<p>
141
142        The repeat mode is separated into x and y direction, this is
143        the y direction part. Permissible values are from the
144        <type>TexturingMode</type> constants.<p>
145    */
146    byte				                        RepeatModeY;
147
148};
149
150}; }; }; };
151
152#endif
153