graphicsdeviceinterface/gdi/sgdi/GDI.CPP
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file has been added to solve a dependency issue raised in INC102308. 
       
    15 // LookupTable.h and BlendingAlgorithms.h are two Internal technologies that were 
       
    16 // implicitly included in GDI.h. However, when building third-party releases of the OS
       
    17 // these files are removed from the graphics directory, making them unreachable by 
       
    18 //
       
    19 
       
    20 // #include in GDI.h which causes the dependency failure.
       
    21 // The solution here is to make the functions calling the inline functions in 
       
    22 // LookupTable.h and BlendingAlgorithms.h non-inline as they were. Rather we will 
       
    23 // export them within this file. Now the functions are safe to be called from other 
       
    24 // components and they are not dependent on the headers.  
       
    25 //
       
    26 
       
    27 #include <graphics/lookuptable.h>
       
    28 #include <graphics/blendingalgorithms.h>
       
    29 #include <gdi.h>
       
    30 
       
    31 /**Converts the TRgb to EColor16MAP (with color channels pre-multiplied with the alpha channel.
       
    32 @return    The index which represents the TRgb values after multiplication with Alpha value. */
       
    33 EXPORT_C TUint TRgb::_Color16MAP() const
       
    34 	{
       
    35 	return NonPMA2PMAPixel(iValue);
       
    36 	}
       
    37 
       
    38 /** Gets TRgb from 16MAP colour index.
       
    39 The function takes a 32 bit colour value with eight bits for each
       
    40 component, blue in the low byte, and returns the TRgb
       
    41 whose red, green, and blue vales are divided by the alpha value.
       
    42 @param     aARGB The pre-multiplied (EColor16MAP) color value.
       
    43 @return    The TRgb which represents the color channel and alpha information. */
       
    44 /* static */
       
    45 EXPORT_C TRgb TRgb::_Color16MAP(TUint aARGB)
       
    46 	{
       
    47 	const TUint16* ArTable = PtrTo16BitNormalisationTable();
       
    48 	TRgb retColor; 
       
    49 	retColor.SetInternal(PMA2NonPMAPixel(aARGB, ArTable));
       
    50 	return retColor;
       
    51 	}