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 *
24 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
25 *
26 * Copyright 2000, 2010 Oracle and/or its affiliates.
27 *
28 * OpenOffice.org - a multi-platform office productivity suite
29 *
30 * This file is part of OpenOffice.org.
31 *
32 * OpenOffice.org is free software: you can redistribute it and/or modify
33 * it under the terms of the GNU Lesser General Public License version 3
34 * only, as published by the Free Software Foundation.
35 *
36 * OpenOffice.org is distributed in the hope that it will be useful,
37 * but WITHOUT ANY WARRANTY; without even the implied warranty of
38 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
39 * GNU Lesser General Public License version 3 for more details
40 * (a copy is included in the LICENSE file that accompanied this code).
41 *
42 * You should have received a copy of the GNU Lesser General Public License
43 * version 3 along with OpenOffice.org.  If not, see
44 * <http://www.openoffice.org/license.html>
45 * for a copy of the LGPLv3 License.
46 *
47 ************************************************************************/
48
49#ifndef com_sun_star_graphic_XGraphicRasterizer_idl
50#define com_sun_star_graphic_XGraphicRasterizer_idl
51
52#include <com/sun/star/io/XInputStream.idl>
53#include <com/sun/star/graphic/XGraphic.idl>
54#include <com/sun/star/beans/PropertyValues.idl>
55#include <com/sun/star/beans/XPropertySet.idl>
56#include <com/sun/star/awt/Size.idl>
57
58module com { module sun { module star { module graphic
59{
60
61/** This interfaces exposes the initialize and a rasterize method to
62    rasterize a given data stream to a pixel graphic
63  */
64interface XGraphicRasterizer : ::com::sun::star::uno::XInterface
65{
66    /** Initializing the rasterizer
67
68        <p>This method could also be used to determine, if
69        the provided data is able to be rasterized by the
70        implementation. The implementation should take care of
71        this feature as well as setting the default image size in
72        pixel within the given output parameter.</p>
73
74		@param DataStream
75			The input stream of data that should be rasterized
76
77		@param DPI_X
78			The horizontal resolution of the callers device in pixel per inch. This
79            value is needed to calculate the correct dimensions of the graphic to be
80            rasterized. If a value of <value>0</value> is given, a horizontal default
81            resolution of 72 DPI is used.
82
83		@param DPI_Y
84			The vertical resolution of the callers device in pixel per inch. This
85            value is needed to calculate the correct dimensions of the graphic to be
86            rasterized. If a value of <value>0</value> is given, a vertical default
87            resolution of 72 DPI is used.
88
89        @param DefaultSizePixel
90            The default rendering size in pixel of the underlying graphics
91            data may be available after the call via this output parameter.
92
93            In case no default size can be determined during initialization,
94            a default pixel size of 0,0 is returned. In this case, the caller
95            needs to assume a default pixel size, appropriate for the calling
96            context.
97
98        @returns
99            A boolean value indicating if rasterizing of the given data is
100            possible at all and if the initialization process happened
101            successfully.
102
103		@see com::sun::star::io::XInputStream
104        @see com::sun::star::awt::Size
105    */
106    boolean initializeData( [in] com::sun::star::io::XInputStream DataStream,
107                            [in] unsigned long DPI_X,
108                            [in] unsigned long DPI_Y,
109                            [out] com::sun::star::awt::Size DefaultSizePixel );
110
111	/** Rasterizing the initialized data into a <type>XGraphic</type> container.
112
113        <p>The <type>XGraphic</type> container will contain a pixel
114        type graphic after a successful rasterization process</p>
115
116        <p>In case of any fault during the rasterization process,
117        the <type>XGraphic</type> container will be empty afterwards and
118        the method will return false</p>
119
120		@param Width
121			The width in pixel of the graphic to be rasterized.
122            This parameter is used without taking other transformation
123            values into account.
124
125		@param Height
126			The height in pixel of the graphic to be rasterized.
127            This parameter is used without taking other transformation
128            values into account.
129
130		@param RotateAngle
131			The rotation angle of the graphic to be rasterized.
132            This parameter is used without taking other transformation
133            values into account. The rotation is applied after scaling
134            and shearing the original image.
135
136		@param ShearXAngle
137			The horizontal shear angle of the graphic to be rasterized.
138            This parameter is used without taking other transformation
139            values into account. The shearing is applied after scaling
140            and before rotation of the image.
141
142		@param ShearYAngle
143			The vertical shear angle of the graphic to be rasterized.
144            This parameter is used without taking other transformation
145            values into account. The shearing is applied after scaling
146            and before rotation of the image.
147
148		@param RasterizeProperties
149			Additional properties for special needs (undefined by now)
150
151		@param Graphic
152			An interface to a graphic container into which the given data
153            should be rasterized.
154
155        @returns com::sun::star::graphic::XGraphic
156            An interface to a graphic container that holds the rasterized pixel data
157
158		@see com::sun::star::beans::PropertyValues
159        @see com::sun::star::graphic::XGraphic
160	*/
161	com::sun::star::graphic::XGraphic rasterize( [in] unsigned long Width,
162                                                 [in] unsigned long Height,
163                                                 [in] double RotateAngle,
164                                                 [in] double ShearAngle_X,
165                                                 [in] double ShearAngle_Y,
166                                                 [in] com::sun::star::beans::PropertyValues RasterizeProperties );
167};
168
169} ; } ; } ; } ;
170
171#endif
172