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