First public contribution.
1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "displaymodeutils.h"
19 Converts a TRgbFormat into a TDisplayMode.
21 @param The TRgbFormat.
22 @return The corresponding TDisplayMode, or ERgb if no match found.
24 TDisplayMode TMMFDisplayModeUtils::DisplayMode(TRgbFormat aRgbFormat)
26 TDisplayMode theDisplayMode = ERgb;
31 theDisplayMode = EColor4K;
34 theDisplayMode = EColor64K;
37 theDisplayMode = EColor16MU;
39 case EFbsBitmapColor4K:
40 theDisplayMode = EColor4K;
42 case EFbsBitmapColor64K:
43 theDisplayMode = EColor64K;
45 case EFbsBitmapColor16M:
46 theDisplayMode = EColor16M;
48 case EFbsBitmapColor16MU:
49 theDisplayMode = EColor16MU;
54 return theDisplayMode;
58 Converts a TRgbFormat into a the corresponding number of bits per pixel.
60 @param The TRgbFormat.
61 @return The corresponding number of bits per pixel,
62 or KErrNotSupported if no match found.
64 TInt TMMFDisplayModeUtilsBytesPerPixel(TRgbFormat aRgbFormat)
66 TInt bpp = KErrNotSupported;
79 case EFbsBitmapColor4K:
82 case EFbsBitmapColor64K:
85 case EFbsBitmapColor16M:
88 case EFbsBitmapColor16MU: