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_XIntegerBitmap_idl__
24#define __com_sun_star_rendering_XIntegerBitmap_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_geometry_IntegerPoint2D_idl__
33#include <com/sun/star/geometry/IntegerPoint2D.idl>
34#endif
35#ifndef __com_sun_star_geometry_IntegerRectangle2D_idl__
36#include <com/sun/star/geometry/IntegerRectangle2D.idl>
37#endif
38#ifndef __com_sun_star_rendering_IntegerBitmapLayout_idl__
39#include <com/sun/star/rendering/IntegerBitmapLayout.idl>
40#endif
41#ifndef __com_sun_star_rendering_XIntegerReadOnlyBitmap_idl__
42#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.idl>
43#endif
44
45
46module com { module sun { module star { module rendering {
47
48/** This is a specialized interface for bitmaps having integer color
49    channels.<p>
50
51    @since OpenOffice 2.0
52 */
53interface XIntegerBitmap : XIntegerReadOnlyBitmap
54{
55	//-------------------------------------------------------------------------
56
57	/** Set raw data of a bitmap.<p>
58
59		Set raw data of a bitmap, in the format as defined by
60		getMemoryLayout(). With the given rectangle, a subset of the
61		bitmap can be changed. If the internal data format's pixel are
62		not integer multiples of bytes (i.e. if one pixel occupies
63		less than a byte), the leftover content of the bytes at the
64		right of each scanline is ignored and left unchanged in the
65		bitmap. When setting subsets of the bitmap, the same scanline
66		padding takes place as when the whole bitmap is changed.<p>
67
68        When setting data on volatile bitmaps, always call isValid()
69        before, and retrieve a new memory layout via
70        getMemoryLayout(). At least under Windows, the memory layout
71        can change for the same bitmap, if the user e.g. switches the
72        screen resolution. Thus, this method will throw an
73        IllegalArgumentException, if the memory layout changed between
74        a call to getMemoryLayout() and setData().
75
76        @param data
77        Data to set
78
79        @param bitmapLayout
80        Layout of the data to set. Must match this bitmap's current
81        layout.
82
83        @param rect
84        Destination rectangle, within the bounds of the bitmap, to set
85        the data in.
86
87        @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
88        if parts of the given rectangle are outside the permissible
89        bitmap area.
90
91        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
92        if the given memory layout does not match this bitmap's
93        layout, or if the given data sequence has too few or too many
94        elements.
95	 */
96	void				setData( [in] sequence<byte> data, [in] IntegerBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerRectangle2D rect )
97        raises (com::sun::star::lang::IllegalArgumentException,
98                com::sun::star::lang::IndexOutOfBoundsException);
99
100	//-------------------------------------------------------------------------
101
102	/** Set a single pixel of the bitmap with the given color
103		value.<p>
104
105        If the internal data format's pixel are not integer multiples
106        of bytes (i.e. if one pixel occupies less than a byte), the
107        color value is expected in the least significant bits of the
108        single byte given as the color.<p>
109
110        When setting data on volatile bitmaps, always call isValid()
111        before, and retrieve a new memory layout via
112        getMemoryLayout(). At least under Windows, the memory layout
113        can change for the same bitmap, if the user e.g. switches the
114        screen resolution. Thus, this method will throw an
115        IllegalArgumentException, if the memory layout changed between
116        a call to getMemoryLayout() and setPixel().
117
118        @param color
119        The color value(s) to set
120
121        @param bitmapLayout
122        Layout of the color elements to set. Must match this bitmap's
123        current layout.
124
125        @param pos
126        Pixel position with the bounds of the bitmap to set.
127
128        @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
129        if the given point is outside the permissible bitmap area.
130
131        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
132        if the given memory layout does not match this bitmap's
133        layout, or if the given data sequence has too few or too many
134        elements.
135	 */
136	void				setPixel( [in] sequence<byte> color, [in] IntegerBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerPoint2D pos )
137        raises (com::sun::star::lang::IllegalArgumentException,
138                com::sun::star::lang::IndexOutOfBoundsException);
139};
140
141}; }; }; };
142
143#endif
144