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