/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: XIeeeDoubleBitmap.idl,v $
 *
 *  $Revision: 1.4 $
 *
 *  last change: $Author: kz $ $Date: 2005-11-02 13:24:04 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/
#ifndef __com_sun_star_rendering_XIeeeDoubleBitmap_idl__
#define __com_sun_star_rendering_XIeeeDoubleBitmap_idl__

#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
#include <com/sun/star/lang/IllegalArgumentException.idl>
#endif
#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
#endif
#ifndef __com_sun_star_rendering_FloatingPointBitmapLayout_idl__
#include <com/sun/star/rendering/FloatingPointBitmapLayout.idl>
#endif
#ifndef __com_sun_star_geometry_IntegerPoint2D_idl__
#include <com/sun/star/geometry/IntegerPoint2D.idl>
#endif
#ifndef __com_sun_star_geometry_IntegerRectangle2D_idl__
#include <com/sun/star/geometry/IntegerRectangle2D.idl>
#endif
#ifndef __com_sun_star_rendering_XBitmap_idl__
#include <com/sun/star/rendering/XBitmap.idl>
#endif
#ifndef __com_sun_star_rendering_VolatileContentDestroyedException_idl__
#include <com/sun/star/rendering/VolatileContentDestroyedException.idl>
#endif


module com { module sun { module star { module rendering {

/** This is a specialized interface for bitmaps containing IEEE
    doubles for their color components.
 */
interface XIeeeDoubleBitmap : XBitmap
{
    /** Query the raw data of this bitmap.

        Query the raw data of this bitmap, in the format as defined by
        getMemoryLayout(). With the given rectangle, a subset of the
        whole bitmap can be queried. When querying subsets of the
        bitmap, the same scanline padding takes place as when the
        whole bitmap is requested.

        Note that the bitmap memory layout might change for volatile
        bitmaps.<p>

        @param bitmapLayout
        The memory layout the returned data is in.

        @param rect
        A rectangle, within the bounds of the bitmap, to retrieve the
        contens from.

        @throws VolatileContentDestroyedException
        if the bitmap is volatile, and the content has been destroyed by the system.

        @throws com::sun::star::lang::IndexOutOfBoundsException
        if parts of the given rectangle are outside the permissible
        bitmap area.
     */
    sequence<double>            getData( [out] FloatingPointBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerRectangle2D rect )
        raises (com::sun::star::lang::IndexOutOfBoundsException,
                VolatileContentDestroyedException);

    //-------------------------------------------------------------------------

    /** Set raw data of a bitmap.

        Set raw data of a bitmap, in the format as defined by
        getMemoryLayout(). With the given rectangle, a subset of the
        bitmap can be changed. When setting subsets of the bitmap, the
        same scanline padding takes place as when the whole bitmap is
        changed.<p>

        When setting data on volatile bitmaps, always call isValid()
        before, and retrieve a new memory layout via
        getMemoryLayout(). At least under Windows, the memory layout
        can change for the same bitmap, if the user e.g. switches the
        screen resolution. Thus, this method will throw an
        IllegalArgumentException, if the memory layout changed between
        a call to getMemoryLayout() and setData().

        @param data
        Data to set

        @param bitmapLayout
        Layout of the data to set. Must match this bitmap's current
        layout.

        @param rect
        Destination rectangle, within the bounds of the bitmap, to set
        the data in.

        @throws com::sun::star::lang::IndexOutOfBoundsException
        if parts of the given rectangle are outside the permissible
        bitmap area.

        @throws com::sun::star::lang::IllegalArgumentException
        if the given memory layout does not match this bitmap's
        layout, or if the given data sequence has too few or too much
        elements.
     */
    void                        setData( [in] sequence<double> data, [in] FloatingPointBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerRectangle2D rect )
        raises (com::sun::star::lang::IllegalArgumentException,
                com::sun::star::lang::IndexOutOfBoundsException);

    //-------------------------------------------------------------------------

    /** Set a single pixel of the bitmap with the given color
        value.

        When setting data on volatile bitmaps, always call isValid()
        before, and retrieve a new memory layout via
        getMemoryLayout(). At least under Windows, the memory layout
        can change for the same bitmap, if the user e.g. switches the
        screen resolution. Thus, this method will throw an
        IllegalArgumentException, if the memory layout changed between
        a call to getMemoryLayout() and setPixel().

        @param color
        The color value(s) to set

        @param bitmapLayout
        Layout of the color elements to set. Must match this bitmap's
        current layout.

        @param pos
        Pixel position with the bounds of the bitmap to set.

        @throws com::sun::star::lang::IndexOutOfBoundsException
        if the given point is outside the permissible bitmap area.

        @throws com::sun::star::lang::IllegalArgumentException
        if the given memory layout does not match this bitmap's
        layout, or if the given data sequence has too few or too much
        elements.
     */
    void                        setPixel( [in] sequence<double> color, [in] FloatingPointBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerPoint2D pos )
        raises (com::sun::star::lang::IllegalArgumentException,
                com::sun::star::lang::IndexOutOfBoundsException);

    //-------------------------------------------------------------------------

    /** Get a single pixel of the bitmap, returning its color
        value.

        Note that the bitmap memory layout might change for volatile
        bitmaps.<p>

        @param bitmapLayout
        The memory layout the returned data is in.

        @param pos
        A position, within the bounds of the bitmap, to retrieve the
        color from.

        @throws VolatileContentDestroyedException
        if the bitmap is volatile, and the content has been destroyed by the system.

        @throws com::sun::star::lang::IndexOutOfBoundsException
        if the given position is outside the permissible bitmap area.
     */
    sequence<double>            getPixel( [out] FloatingPointBitmapLayout bitmapLayout, [in] ::com::sun::star::geometry::IntegerPoint2D pos )
        raises (com::sun::star::lang::IndexOutOfBoundsException,
                VolatileContentDestroyedException);

    //-------------------------------------------------------------------------

    /** Query the memory layout for this bitmap

        Please note that for volatile bitmaps, the memory layout might
        change between subsequent calls.
     */
    FloatingPointBitmapLayout   getMemoryLayout();
};

}; }; }; };

#endif
