001    /*
002     * TransparencyInformation
003     *
004     * Copyright (c) 2001, 2002, 2003 Marco Schmidt.
005     * All rights reserved.
006     */
007    
008    package net.sourceforge.jiu.data;
009    
010    import net.sourceforge.jiu.data.IntegerImage;
011    
012    /**
013     * An interface that represents transparency information which may be
014     * available for a pixel image.
015     * Transparency information describes how an image is supposed to be 
016     * drawn on a pixel background (e.g. another image).
017     * That way, irregularly shaped images can easily be handled by excluding
018     * those pixels of a rectangular image that are not part of the image.
019     * @author Marco Schmidt
020     */
021    public interface TransparencyInformation
022    {
023            /**
024             * Returns an image object that contains an alpha channel.
025             * The first channel of that image is supposed to be the alpha channel.
026             * @return the alpha channel image object
027             * @see #setAlphaChannelImage
028             */
029            IntegerImage getAlphaChannelImage();
030    
031            /**
032             * If there is a transparency index, this method returns it.
033             * Otherwise, the return value is undefined.
034             * @return transparency index
035             * @see #setTransparencyIndex
036             */
037            Integer getTransparencyIndex();
038    
039            /**
040             * Set a new alpha channel image object.
041             * @see #getAlphaChannelImage
042             */
043            void setAlphaChannelImage(IntegerImage newImage);
044    
045            /**
046             * Set a new transparency value.
047             * Can be <code>null</code>.
048             * However, if the value is non-null, it must encapsulate an
049             * integer number which is 0 or larger.
050             * @param newValue new transparency index
051             * @see #getAlphaChannelImage
052             * @throws IllegalArgumentException if the argument is non-null and contains a negative value
053             */
054            void setTransparencyIndex(Integer newValue);
055    }