xref: /AOO41X/main/offapi/com/sun/star/graphic/XGraphicRasterizer.idl (revision a39ee16adf1128b4f16bc78e3c26e4489d7a3a0a)
1*ebfcd9afSAndrew Rist/**************************************************************
2*ebfcd9afSAndrew Rist *
3*ebfcd9afSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*ebfcd9afSAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*ebfcd9afSAndrew Rist * distributed with this work for additional information
6*ebfcd9afSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*ebfcd9afSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*ebfcd9afSAndrew Rist * "License"); you may not use this file except in compliance
9*ebfcd9afSAndrew Rist * with the License.  You may obtain a copy of the License at
10*ebfcd9afSAndrew Rist *
11*ebfcd9afSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*ebfcd9afSAndrew Rist *
13*ebfcd9afSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*ebfcd9afSAndrew Rist * software distributed under the License is distributed on an
15*ebfcd9afSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ebfcd9afSAndrew Rist * KIND, either express or implied.  See the License for the
17*ebfcd9afSAndrew Rist * specific language governing permissions and limitations
18*ebfcd9afSAndrew Rist * under the License.
19*ebfcd9afSAndrew Rist *
20*ebfcd9afSAndrew Rist *************************************************************/
21*ebfcd9afSAndrew Rist
22cdf0e10cSrcweir#ifndef com_sun_star_graphic_XGraphicRasterizer_idl
23cdf0e10cSrcweir#define com_sun_star_graphic_XGraphicRasterizer_idl
24cdf0e10cSrcweir
25cdf0e10cSrcweir#include <com/sun/star/io/XInputStream.idl>
26cdf0e10cSrcweir#include <com/sun/star/graphic/XGraphic.idl>
27cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValues.idl>
28cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
29cdf0e10cSrcweir#include <com/sun/star/awt/Size.idl>
30cdf0e10cSrcweir
31cdf0e10cSrcweirmodule com { module sun { module star { module graphic
32cdf0e10cSrcweir{
33cdf0e10cSrcweir
34cdf0e10cSrcweir/** This interfaces exposes the initialize and a rasterize method to
35cdf0e10cSrcweir    rasterize a given data stream to a pixel graphic
36cdf0e10cSrcweir  */
37cdf0e10cSrcweirinterface XGraphicRasterizer : ::com::sun::star::uno::XInterface
38cdf0e10cSrcweir{
39cdf0e10cSrcweir    /** Initializing the rasterizer
40cdf0e10cSrcweir
41cdf0e10cSrcweir        <p>This method could also be used to determine, if
42cdf0e10cSrcweir        the provided data is able to be rasterized by the
43cdf0e10cSrcweir        implementation. The implementation should take care of
44cdf0e10cSrcweir        this feature as well as setting the default image size in
45cdf0e10cSrcweir        pixel within the given output parameter.</p>
46cdf0e10cSrcweir
47cdf0e10cSrcweir		@param DataStream
48cdf0e10cSrcweir			The input stream of data that should be rasterized
49cdf0e10cSrcweir
50cdf0e10cSrcweir		@param DPI_X
51cdf0e10cSrcweir			The horizontal resolution of the callers device in pixel per inch. This
52cdf0e10cSrcweir            value is needed to calculate the correct dimensions of the graphic to be
53cdf0e10cSrcweir            rasterized. If a value of <value>0</value> is given, a horizontal default
54cdf0e10cSrcweir            resolution of 72 DPI is used.
55cdf0e10cSrcweir
56cdf0e10cSrcweir		@param DPI_Y
57cdf0e10cSrcweir			The vertical resolution of the callers device in pixel per inch. This
58cdf0e10cSrcweir            value is needed to calculate the correct dimensions of the graphic to be
59cdf0e10cSrcweir            rasterized. If a value of <value>0</value> is given, a vertical default
60cdf0e10cSrcweir            resolution of 72 DPI is used.
61cdf0e10cSrcweir
62cdf0e10cSrcweir        @param DefaultSizePixel
63cdf0e10cSrcweir            The default rendering size in pixel of the underlying graphics
64cdf0e10cSrcweir            data may be available after the call via this output parameter.
65cdf0e10cSrcweir
66cdf0e10cSrcweir            In case no default size can be determined during initialization,
67cdf0e10cSrcweir            a default pixel size of 0,0 is returned. In this case, the caller
68cdf0e10cSrcweir            needs to assume a default pixel size, appropriate for the calling
69cdf0e10cSrcweir            context.
70cdf0e10cSrcweir
71cdf0e10cSrcweir        @returns
72cdf0e10cSrcweir            A boolean value indicating if rasterizing of the given data is
73cdf0e10cSrcweir            possible at all and if the initialization process happened
74cdf0e10cSrcweir            successfully.
75cdf0e10cSrcweir
76cdf0e10cSrcweir		@see com::sun::star::io::XInputStream
77cdf0e10cSrcweir        @see com::sun::star::awt::Size
78cdf0e10cSrcweir    */
79cdf0e10cSrcweir    boolean initializeData( [in] com::sun::star::io::XInputStream DataStream,
80cdf0e10cSrcweir                            [in] unsigned long DPI_X,
81cdf0e10cSrcweir                            [in] unsigned long DPI_Y,
82cdf0e10cSrcweir                            [out] com::sun::star::awt::Size DefaultSizePixel );
83cdf0e10cSrcweir
84cdf0e10cSrcweir	/** Rasterizing the initialized data into a <type>XGraphic</type> container.
85cdf0e10cSrcweir
86cdf0e10cSrcweir        <p>The <type>XGraphic</type> container will contain a pixel
87cdf0e10cSrcweir        type graphic after a successful rasterization process</p>
88cdf0e10cSrcweir
89cdf0e10cSrcweir        <p>In case of any fault during the rasterization process,
90cdf0e10cSrcweir        the <type>XGraphic</type> container will be empty afterwards and
91cdf0e10cSrcweir        the method will return false</p>
92cdf0e10cSrcweir
93cdf0e10cSrcweir		@param Width
94cdf0e10cSrcweir			The width in pixel of the graphic to be rasterized.
95cdf0e10cSrcweir            This parameter is used without taking other transformation
96cdf0e10cSrcweir            values into account.
97cdf0e10cSrcweir
98cdf0e10cSrcweir		@param Height
99cdf0e10cSrcweir			The height in pixel of the graphic to be rasterized.
100cdf0e10cSrcweir            This parameter is used without taking other transformation
101cdf0e10cSrcweir            values into account.
102cdf0e10cSrcweir
103cdf0e10cSrcweir		@param RotateAngle
104cdf0e10cSrcweir			The rotation angle of the graphic to be rasterized.
105cdf0e10cSrcweir            This parameter is used without taking other transformation
106cdf0e10cSrcweir            values into account. The rotation is applied after scaling
107cdf0e10cSrcweir            and shearing the original image.
108cdf0e10cSrcweir
109cdf0e10cSrcweir		@param ShearXAngle
110cdf0e10cSrcweir			The horizontal shear angle of the graphic to be rasterized.
111cdf0e10cSrcweir            This parameter is used without taking other transformation
112cdf0e10cSrcweir            values into account. The shearing is applied after scaling
113cdf0e10cSrcweir            and before rotation of the image.
114cdf0e10cSrcweir
115cdf0e10cSrcweir		@param ShearYAngle
116cdf0e10cSrcweir			The vertical shear angle of the graphic to be rasterized.
117cdf0e10cSrcweir            This parameter is used without taking other transformation
118cdf0e10cSrcweir            values into account. The shearing is applied after scaling
119cdf0e10cSrcweir            and before rotation of the image.
120cdf0e10cSrcweir
121cdf0e10cSrcweir		@param RasterizeProperties
122cdf0e10cSrcweir			Additional properties for special needs (undefined by now)
123cdf0e10cSrcweir
124cdf0e10cSrcweir		@param Graphic
125cdf0e10cSrcweir			An interface to a graphic container into which the given data
126cdf0e10cSrcweir            should be rasterized.
127cdf0e10cSrcweir
128cdf0e10cSrcweir        @returns com::sun::star::graphic::XGraphic
129cdf0e10cSrcweir            An interface to a graphic container that holds the rasterized pixel data
130cdf0e10cSrcweir
131cdf0e10cSrcweir		@see com::sun::star::beans::PropertyValues
132cdf0e10cSrcweir        @see com::sun::star::graphic::XGraphic
133cdf0e10cSrcweir	*/
134cdf0e10cSrcweir	com::sun::star::graphic::XGraphic rasterize( [in] unsigned long Width,
135cdf0e10cSrcweir                                                 [in] unsigned long Height,
136cdf0e10cSrcweir                                                 [in] double RotateAngle,
137cdf0e10cSrcweir                                                 [in] double ShearAngle_X,
138cdf0e10cSrcweir                                                 [in] double ShearAngle_Y,
139cdf0e10cSrcweir                                                 [in] com::sun::star::beans::PropertyValues RasterizeProperties );
140cdf0e10cSrcweir};
141cdf0e10cSrcweir
142cdf0e10cSrcweir} ; } ; } ; } ;
143cdf0e10cSrcweir
144cdf0e10cSrcweir#endif
145