1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XIntegerBitmap.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_rendering_XIntegerBitmap_idl__
31 #define __com_sun_star_rendering_XIntegerBitmap_idl__
33 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
34 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
36 #ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
37 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
39 #ifndef __com_sun_star_geometry_IntegerPoint2D_idl__
40 #include
<com
/sun
/star
/geometry
/IntegerPoint2D.idl
>
42 #ifndef __com_sun_star_geometry_IntegerRectangle2D_idl__
43 #include
<com
/sun
/star
/geometry
/IntegerRectangle2D.idl
>
45 #ifndef __com_sun_star_rendering_IntegerBitmapLayout_idl__
46 #include
<com
/sun
/star
/rendering
/IntegerBitmapLayout.idl
>
48 #ifndef __com_sun_star_rendering_XIntegerReadOnlyBitmap_idl__
49 #include
<com
/sun
/star
/rendering
/XIntegerReadOnlyBitmap.idl
>
53 module com
{ module sun
{ module star
{ module rendering
{
55 /** This is a specialized interface for bitmaps having integer color
60 interface XIntegerBitmap
: XIntegerReadOnlyBitmap
62 //-------------------------------------------------------------------------
64 /** Set raw data of a bitmap.<p>
66 Set raw data of a bitmap, in the format as defined by
67 getMemoryLayout(). With the given rectangle, a subset of the
68 bitmap can be changed. If the internal data format's pixel are
69 not integer multiples of bytes (i.e. if one pixel occupies
70 less than a byte), the leftover content of the bytes at the
71 right of each scanline is ignored and left unchanged in the
72 bitmap. When setting subsets of the bitmap, the same scanline
73 padding takes place as when the whole bitmap is changed.<p>
75 When setting data on volatile bitmaps, always call isValid()
76 before, and retrieve a new memory layout via
77 getMemoryLayout(). At least under Windows, the memory layout
78 can change for the same bitmap, if the user e.g. switches the
79 screen resolution. Thus, this method will throw an
80 IllegalArgumentException, if the memory layout changed between
81 a call to getMemoryLayout() and setData().
87 Layout of the data to set. Must match this bitmap's current
91 Destination rectangle, within the bounds of the bitmap, to set
94 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
95 if parts of the given rectangle are outside the permissible
98 @throws <type>com::sun::star::lang::IllegalArgumentException</type>
99 if the given memory layout does not match this bitmap's
100 layout, or if the given data sequence has too few or too many
103 void setData
( [in] sequence
<byte> data
, [in] IntegerBitmapLayout bitmapLayout
, [in] ::com
::sun
::star
::geometry
::IntegerRectangle2D rect
)
104 raises
(com
::sun
::star
::lang
::IllegalArgumentException
,
105 com
::sun
::star
::lang
::IndexOutOfBoundsException
);
107 //-------------------------------------------------------------------------
109 /** Set a single pixel of the bitmap with the given color
112 If the internal data format's pixel are not integer multiples
113 of bytes (i.e. if one pixel occupies less than a byte), the
114 color value is expected in the least significant bits of the
115 single byte given as the color.<p>
117 When setting data on volatile bitmaps, always call isValid()
118 before, and retrieve a new memory layout via
119 getMemoryLayout(). At least under Windows, the memory layout
120 can change for the same bitmap, if the user e.g. switches the
121 screen resolution. Thus, this method will throw an
122 IllegalArgumentException, if the memory layout changed between
123 a call to getMemoryLayout() and setPixel().
126 The color value(s) to set
129 Layout of the color elements to set. Must match this bitmap's
133 Pixel position with the bounds of the bitmap to set.
135 @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type>
136 if the given point is outside the permissible bitmap area.
138 @throws <type>com::sun::star::lang::IllegalArgumentException</type>
139 if the given memory layout does not match this bitmap's
140 layout, or if the given data sequence has too few or too many
143 void setPixel
( [in] sequence
<byte> color
, [in] IntegerBitmapLayout bitmapLayout
, [in] ::com
::sun
::star
::geometry
::IntegerPoint2D pos
)
144 raises
(com
::sun
::star
::lang
::IllegalArgumentException
,
145 com
::sun
::star
::lang
::IndexOutOfBoundsException
);