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