svgtopt/gfx2d/inc/GfxColor.h
changeset 46 88edb906c587
equal deleted inserted replaced
-1:000000000000 46:88edb906c587
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Graphics Extension Library header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GFXCOLOR_H
       
    20 #define GFXCOLOR_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <fbs.h>
       
    24 
       
    25 #include "GfxPaint.h"
       
    26 
       
    27 #include <VG/openvg.h>
       
    28 
       
    29 #include "VGRenderer.h"
       
    30 
       
    31 /**
       
    32  * This class is an implementation of a color.
       
    33  *
       
    34  *  @lib Gfx2D.lib
       
    35  *  @since 1.0
       
    36  */
       
    37 class TGfxColor : public MGfxPaint
       
    38     {
       
    39     public:
       
    40 
       
    41 
       
    42         /**
       
    43          * Construct a TGfxColor from an integer value.
       
    44          *
       
    45          * @since 1.0
       
    46          * @param aRgb : integer color value.
       
    47          * @return
       
    48          */
       
    49          TGfxColor( TUint32 aValue );
       
    50 
       
    51         /**
       
    52          * Construct a TGfxColor from r, g, b values.
       
    53          *
       
    54          * @since 1.0
       
    55          * @param aRed : red component
       
    56          * @param aGreen : green component
       
    57          * @param aBlue : blue component
       
    58          * @return
       
    59          */
       
    60          TGfxColor( TInt aRed, TInt aGreen, TInt aBlue );
       
    61 
       
    62 
       
    63         /**
       
    64          * Return the integer representation of this color.
       
    65          *
       
    66          * @since 1.0
       
    67          * @return integer representation of color.
       
    68          */
       
    69          TUint16          ColorRgb();
       
    70 
       
    71         /**
       
    72          * Return 4-bits for red, 4-bits for green, 4-bits for blue
       
    73          * integer representation of this color.
       
    74          *
       
    75          * @since 1.0
       
    76          * @return 4x4x4 bits integer representation of color.
       
    77          */
       
    78          TUint16          ColorRgb444();
       
    79 
       
    80         /**
       
    81          * Return 5-bits for red, 6-bits for green, 5-bits for blue
       
    82          * integer representation of this color.
       
    83          *
       
    84          * @since 1.0
       
    85          * @return 5x6x5 bits integer representation of color.
       
    86          */
       
    87          TUint16          ColorRgb565();
       
    88 
       
    89         /**
       
    90          * Return an integer representation of a color after blending
       
    91          * the two colors given by integer values.
       
    92          *
       
    93          * @since 1.0
       
    94          * @param aAlpha : the alpha channel value to blend.
       
    95          * @param aCs1 : color 1 to blend
       
    96          * @param aCs2 : color 2 to blend
       
    97          * @return integer representation of color.
       
    98          */
       
    99          static TUint32   BlendRgb444( TUint32 aAlpha,
       
   100                                                TUint32 aCs1,
       
   101                                                TUint32 aCs2 );
       
   102 
       
   103         /**
       
   104          * Implementation of MGfxPaint method to get an array of color values.
       
   105          * The given buffer array is filled with this color value.
       
   106          *
       
   107          * @since 1.0
       
   108         * @param aBuf : color array to holder color values
       
   109          * @param aLength : number of color values to fill.
       
   110          * @param x : not used by this class
       
   111          * @param y : not used by this class
       
   112          * @return
       
   113          */
       
   114         // void           GetScanline( TUint8* aBuf,
       
   115         //                                     TInt32 aLength,
       
   116         //                                     TInt32 x,
       
   117         //                                     TInt32 y );
       
   118 
       
   119         /**
       
   120          * Return an integer representation of this color.
       
   121          * This method should be renamed!
       
   122          *
       
   123          * @since 1.0
       
   124          * @return integer representation of color.
       
   125          */
       
   126          TUint32 GetColor();
       
   127          TUint32 GetARGB();
       
   128          TUint32 GetABGR();
       
   129 
       
   130 
       
   131 
       
   132 
       
   133 		 void SetFill(VGPaint aFillPaint, TGfxRectangle2D& aBBox, TFloatFixPt aOpacity,void* GfxContext);
       
   134 		public:
       
   135 			TUint32 iColor;
       
   136     };
       
   137 
       
   138 
       
   139 #endif      // GFXCOLOR_H