1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_rendering_XIntegerBitmap_idl__
20 #define __com_sun_star_rendering_XIntegerBitmap_idl__
22 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
23 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
24 #include
<com
/sun
/star
/geometry
/IntegerPoint2D.idl
>
25 #include
<com
/sun
/star
/geometry
/IntegerRectangle2D.idl
>
26 #include
<com
/sun
/star
/rendering
/IntegerBitmapLayout.idl
>
27 #include
<com
/sun
/star
/rendering
/XIntegerReadOnlyBitmap.idl
>
30 module com
{ module sun
{ module star
{ module rendering
{
32 /** This is a specialized interface for bitmaps having integer color
37 interface XIntegerBitmap
: XIntegerReadOnlyBitmap
40 /** Set raw data of a bitmap.<p>
42 Set raw data of a bitmap, in the format as defined by
43 getMemoryLayout(). With the given rectangle, a subset of the
44 bitmap can be changed. If the internal data format's pixel are
45 not integer multiples of bytes (i.e. if one pixel occupies
46 less than a byte), the leftover content of the bytes at the
47 right of each scanline is ignored and left unchanged in the
48 bitmap. When setting subsets of the bitmap, the same scanline
49 padding takes place as when the whole bitmap is changed.<p>
51 When setting data on volatile bitmaps, always call isValid()
52 before, and retrieve a new memory layout via
53 getMemoryLayout(). At least under Windows, the memory layout
54 can change for the same bitmap, if the user e.g. switches the
55 screen resolution. Thus, this method will throw an
56 IllegalArgumentException, if the memory layout changed between
57 a call to getMemoryLayout() and setData().
63 Layout of the data to set. Must match this bitmap's current
67 Destination rectangle, within the bounds of the bitmap, to set
70 @throws com::sun::star::lang::IndexOutOfBoundsException
71 if parts of the given rectangle are outside the permissible
74 @throws com::sun::star::lang::IllegalArgumentException
75 if the given memory layout does not match this bitmap's
76 layout, or if the given data sequence has too few or too many
79 void setData
( [in] sequence
<byte> data
, [in] IntegerBitmapLayout bitmapLayout
, [in] ::com
::sun
::star
::geometry
::IntegerRectangle2D rect
)
80 raises
(com
::sun
::star
::lang
::IllegalArgumentException
,
81 com
::sun
::star
::lang
::IndexOutOfBoundsException
);
84 /** Set a single pixel of the bitmap with the given color
87 If the internal data format's pixel are not integer multiples
88 of bytes (i.e. if one pixel occupies less than a byte), the
89 color value is expected in the least significant bits of the
90 single byte given as the color.<p>
92 When setting data on volatile bitmaps, always call isValid()
93 before, and retrieve a new memory layout via
94 getMemoryLayout(). At least under Windows, the memory layout
95 can change for the same bitmap, if the user e.g. switches the
96 screen resolution. Thus, this method will throw an
97 IllegalArgumentException, if the memory layout changed between
98 a call to getMemoryLayout() and setPixel().
101 The color value(s) to set
104 Layout of the color elements to set. Must match this bitmap's
108 Pixel position with the bounds of the bitmap to set.
110 @throws com::sun::star::lang::IndexOutOfBoundsException
111 if the given point is outside the permissible bitmap area.
113 @throws com::sun::star::lang::IllegalArgumentException
114 if the given memory layout does not match this bitmap's
115 layout, or if the given data sequence has too few or too many
118 void setPixel
( [in] sequence
<byte> color
, [in] IntegerBitmapLayout bitmapLayout
, [in] ::com
::sun
::star
::geometry
::IntegerPoint2D pos
)
119 raises
(com
::sun
::star
::lang
::IllegalArgumentException
,
120 com
::sun
::star
::lang
::IndexOutOfBoundsException
);
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */