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