Quantum GIS API Documentation  1.7.4
src/core/raster/qgsrastertransparency.h
Go to the documentation of this file.
00001 /* **************************************************************************
00002                 qgsrastertransparency.h -  description
00003                        -------------------
00004 begin                : Mon Nov 30 2007
00005 copyright            : (C) 2007 by Peter J. Ersts
00006 email                : [email protected]
00007 
00008 ****************************************************************************/
00009 
00010 /* **************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 #ifndef QGSRASTERTRANSPARENCY_H
00019 #define QGSRASTERTRANSPARENCY_H
00020 
00025 class CORE_EXPORT QgsRasterTransparency
00026 {
00027 
00028   public:
00029     QgsRasterTransparency();
00030 
00031     //
00032     // Structs to hold transparent pixel vlaues
00033     //
00034     struct TransparentThreeValuePixel
00035     {
00036       double red;
00037       double green;
00038       double blue;
00039       double percentTransparent;
00040     };
00041 
00042     struct TransparentSingleValuePixel
00043     {
00044       double pixelValue;
00045       double percentTransparent;
00046     };
00047 
00048     //
00049     // Initializer, Accessor and mutator for transparency tables.
00050     //
00052     QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
00053 
00055     QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
00056 
00058     void initializeTransparentPixelList( double );
00059 
00061     void initializeTransparentPixelList( double, double, double );
00062 
00064     void setTransparentSingleValuePixelList( QList<QgsRasterTransparency::TransparentSingleValuePixel> );
00065 
00067     void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::TransparentThreeValuePixel> );
00068 
00070     int alphaValue( double, int theGlobalTransparency = 255 ) const;
00071 
00073     int alphaValue( double, double, double, int theGlobalTransparency = 255 ) const;
00074 
00075   private:
00077     QList<QgsRasterTransparency::TransparentThreeValuePixel> mTransparentThreeValuePixelList;
00078 
00080     QList<QgsRasterTransparency::TransparentSingleValuePixel> mTransparentSingleValuePixelList;
00081 
00082 };
00083 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines