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