|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Creates converters. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMIDCONVERTFACTORY_H |
|
20 #define CMIDCONVERTFACTORY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <gdi.h> |
|
25 |
|
26 // Constants |
|
27 const TInt KFormatNotSupported = -100; |
|
28 |
|
29 // Pixel formats from DirectGraphics |
|
30 const TInt KMIDTypeByte1Gray = 1; |
|
31 const TInt KMIDTypeByte1GrayVertical = -1; |
|
32 const TInt KMIDTypeByte2Gray = 2; |
|
33 const TInt KMIDTypeByte4Gray = 4; |
|
34 const TInt KMIDTypeByte8Gray = 8; |
|
35 const TInt KMIDTypeByte332RGB = 332; |
|
36 const TInt KMIDTypeUshort4444ARGB = 4444; |
|
37 const TInt KMIDTypeUshort444RGB = 444; |
|
38 const TInt KMIDTypeUshort555RGB = 555; |
|
39 const TInt KMIDTypeUshort1555ARGB = 1555; |
|
40 const TInt KMIDTypeUshort565RGB = 565; |
|
41 const TInt KMIDTypeInt888RGB = 888; |
|
42 const TInt KMIDTypeInt888ARGB = 32888; // 888 with 8-bit alpha in a 32-bit bitmap |
|
43 const TInt KMIDTypeInt8888ARGB = 8888; |
|
44 |
|
45 // FORWARD DECLARATIONS |
|
46 class TMIDFormatConverter; |
|
47 |
|
48 // CLASS DEFINITION |
|
49 /** |
|
50 * |
|
51 * Creates converters. |
|
52 * |
|
53 */ |
|
54 NONSHARABLE_CLASS(CMIDConvertFactory): public CBase |
|
55 { |
|
56 public: // constuctor & destructor |
|
57 CMIDConvertFactory(); |
|
58 ~CMIDConvertFactory(); |
|
59 |
|
60 public: |
|
61 // returns new or cached converter |
|
62 TMIDFormatConverter* ConverterL(TInt aFormat); |
|
63 // returns always new converter |
|
64 static TMIDFormatConverter* NewConverterL(TInt aFormat); |
|
65 // returns pixel format for given display mode |
|
66 static TInt GetPixelFormat(const TDisplayMode& aDisplayMode); |
|
67 |
|
68 private: // data |
|
69 |
|
70 // last used converter |
|
71 TMIDFormatConverter* iLastUsedConverter; |
|
72 |
|
73 // last used format |
|
74 TInt iFormat; |
|
75 |
|
76 }; |
|
77 |
|
78 #endif // CMIDCONVERTFACTORY_H |
|
79 |