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#ifndef __com_sun_star_rendering_XIeeeFloatReadOnlyBitmap_idl__
24#define __com_sun_star_rendering_XIeeeFloatReadOnlyBitmap_idl__
25
26#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
27#include <com/sun/star/lang/IllegalArgumentException.idl>
28#endif
29#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
30#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
31#endif
32#ifndef __com_sun_star_rendering_FloatingPointBitmapLayout_idl__
33#include <com/sun/star/rendering/FloatingPointBitmapLayout.idl>
34#endif
35#ifndef __com_sun_star_geometry_IntegerPoint2D_idl__
36#include <com/sun/star/geometry/IntegerPoint2D.idl>
37#endif
38#ifndef __com_sun_star_geometry_IntegerRectangle2D_idl__
39#include <com/sun/star/geometry/IntegerRectangle2D.idl>
40#endif
41#ifndef __com_sun_star_rendering_XBitmap_idl__
42#include <com/sun/star/rendering/XBitmap.idl>
43#endif
44#ifndef __com_sun_star_rendering_VolatileContentDestroyedException_idl__
45#include <com/sun/star/rendering/VolatileContentDestroyedException.idl>
46#endif
47
48
49module com { module sun { module star { module rendering {
50
51/** Specialized interface for bitmaps containing IEEE floats as their
52    color components. In contrast to <type>XIeeeFloatBitmap</type>,
53    this interface only permits read-only access.<p>
54
55    Use this interface for e.g. bitmaps that are calculated
56    on-the-fly, or that are pure functional, and thus cannot be
57    modified.<p>
58
59    If you get passed an instance of
60    <type>XHalfFloatReadOnlyBitmap</type> that also supports the
61    <type>XVolatileBitmap</type> interface, things become a bit more
62    complicated. When reading data, one has to check for both
63    <type>VolatileContentDestroyedException</type> and mismatching
64    <type>FloatingPointBitmapLayout</type> return values. If either of them
65    occurs, the whole bitmap read operation should be repeated.<p>
66 */
67interface XIeeeFloatReadOnlyBitmap : XBitmap
68{
69	/** Query the raw data of this bitmap.<p>
70
71    	Query the raw data of this bitmap, in the format as defined by
72    	getMemoryLayout(). With the given rectangle, a subset of the
73    	whole bitmap can be queried. When querying subsets of the
74    	bitmap, the same scanline padding takes place as when the
75    	whole bitmap is requested.<p>
76
77        Note that the bitmap memory layout might change for volatile
78        bitmaps.<p>
79
80        @param bitmapLayout
81        The memory layout the returned data is in.
82
83        @param rect
84        A rectangle, within the bounds of the bitmap, to retrieve the
85        contens from.
86
87        @throws <type>VolatileContentDestroyedException</type>
88        if the bitmap is volatile, and the content has been destroyed by the system.
89
90        @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
91        if parts of the given rectangle are outside the permissible
92        bitmap area.
93	 */
94	sequence<float>				getData( [out] FloatingPointBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerRectangle2D rect )
95        raises (com::sun::star::lang::IndexOutOfBoundsException,
96                VolatileContentDestroyedException);
97
98	//-------------------------------------------------------------------------
99
100	/** Get a single pixel of the bitmap, returning its color
101		value.<p>
102
103        Note that the bitmap memory layout might change for volatile
104        bitmaps.<p>
105
106        @param bitmapLayout
107        The memory layout the returned data is in.
108
109        @param pos
110        A position, within the bounds of the bitmap, to retrieve the
111        color from.
112
113        @throws <type>VolatileContentDestroyedException</type>
114        if the bitmap is volatile, and the content has been destroyed by the system.
115
116        @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
117        if the given position is outside the permissible bitmap area.
118	 */
119	sequence<float>				getPixel( [out] FloatingPointBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerPoint2D pos )
120        raises (com::sun::star::lang::IndexOutOfBoundsException,
121                VolatileContentDestroyedException);
122
123	//-------------------------------------------------------------------------
124
125	/** Query the memory layout for this bitmap.<p>
126
127    	Please note that for volatile bitmaps, the memory layout might
128    	change between subsequent calls.<p>
129	 */
130	FloatingPointBitmapLayout	getMemoryLayout();
131};
132
133}; }; }; };
134
135#endif
136