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_XHalfFloatReadOnlyBitmap_idl__
24#define __com_sun_star_rendering_XHalfFloatReadOnlyBitmap_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
48module com { module sun { module star { module rendering {
49
50/** Specialized interface for bitmaps containing half floats as their
51    color components. Half floats are 16 bit wide, and some high-end
52    GPUs already have them as supported frame buffer format. In
53    contrast to <type>XHalfFloatBitmap</type>, this interface only
54    permits read-only access.<p>
55
56    Use this interface for e.g. bitmaps that are calculated
57    on-the-fly, or that are pure functional, and thus cannot be
58    modified.<p>
59
60    If you get passed an instance of
61    <type>XHalfFloatReadOnlyBitmap</type> that also supports the
62    <type>XVolatileBitmap</type> interface, things become a bit more
63    complicated. When reading data, one has to check for both
64    <type>VolatileContentDestroyedException</type> and mismatching
65    <type>FloatingPointBitmapLayout</type> return values. If either of them
66    occurs, the whole bitmap read operation should be repeated.<p>
67 */
68interface XHalfFloatReadOnlyBitmap : XBitmap
69{
70	/** Query the raw data of this bitmap.<p>
71
72    	Query the raw data of this bitmap, in the format as defined by
73    	getMemoryLayout(). With the given rectangle, a subset of the
74    	whole bitmap can be queried. When querying subsets of the
75    	bitmap, the same scanline padding takes place as when the
76    	whole bitmap is requested. Note: as we currently have no 16
77    	bit float UNO data type, the values are transported as 16 bit
78    	integers across the API (which requires casting on both
79    	sides).<p>
80
81        @throws <type>VolatileContentDestroyedException</type>
82        if the bitmap is volatile, and the content has been destroyed by the system.
83	 */
84	sequence<short>				getData( [in] ::com::sun::star::geometry::IntegerRectangle2D rect )
85        raises (com::sun::star::lang::IndexOutOfBoundsException,
86                VolatileContentDestroyedException);
87
88	//-------------------------------------------------------------------------
89
90	/** Get a single pixel of the bitmap, returning its color
91		value.<p>
92
93        @throws <type>VolatileContentDestroyedException</type>
94        if the bitmap is volatile, and the content has been destroyed by the system.
95	 */
96	sequence<short>				getPixel( [in] ::com::sun::star::geometry::IntegerPoint2D pos )
97        raises (com::sun::star::lang::IndexOutOfBoundsException,
98                VolatileContentDestroyedException);
99
100	//-------------------------------------------------------------------------
101
102	/** Query the memory layout for this bitmap.<p>
103	 */
104	FloatingPointBitmapLayout	getMemoryLayout();
105};
106
107}; }; }; };
108
109#endif
110