|
1 // Copyright (c) 2008-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 // |
|
15 |
|
16 #include <imageprocessor/imageprocessorinputinfointf.h> |
|
17 #include <imageprocessor/imageprocessorinputinfo.h> |
|
18 #include "imageprocessorimpl.h" |
|
19 #include <imageprocessor/imageprocessor.h> |
|
20 |
|
21 namespace ImageProcessor |
|
22 { |
|
23 |
|
24 TInputInfo::TInputInfo(Plugin::MInputInfo& aInputInfoImpl, CImageProcessorImpl& aImageProcessorImpl) |
|
25 :iImageProcessorImpl(aImageProcessorImpl), |
|
26 iInputInfoImpl(aInputInfoImpl), |
|
27 iReserved(0) |
|
28 { |
|
29 } |
|
30 |
|
31 /** |
|
32 Gets the size of input image |
|
33 |
|
34 @return size of the image |
|
35 */ |
|
36 EXPORT_C TSize TInputInfo::SizeL() const |
|
37 { |
|
38 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
39 return iInputInfoImpl.SizeL(); |
|
40 } |
|
41 |
|
42 /** |
|
43 Gets the input image format |
|
44 |
|
45 @param aFormat |
|
46 Returns the Uid of the format. |
|
47 @param aSubFormat |
|
48 Returns the sub Uid of the format. |
|
49 @leave KErrNotReady |
|
50 The effect is not active. |
|
51 */ |
|
52 EXPORT_C void TInputInfo::FormatL(TUid& aFormat, TUid& aSubFormat) const |
|
53 { |
|
54 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
55 iInputInfoImpl.FormatL(aFormat, aSubFormat); |
|
56 } |
|
57 |
|
58 /** |
|
59 Gets the display mode of input image. |
|
60 |
|
61 @return display mode of image. |
|
62 */ |
|
63 EXPORT_C TDisplayMode TInputInfo::DisplayModeL() const |
|
64 { |
|
65 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
66 return iInputInfoImpl.DisplayModeL(); |
|
67 } |
|
68 |
|
69 /** |
|
70 Gets the uid of frame format of input image. |
|
71 When calling TInputInfo::DisplayModeL() returns ENone, this ImageFrameFormatL() |
|
72 could be used to get image frame format. |
|
73 |
|
74 @return uid of frame format of the image. |
|
75 */ |
|
76 EXPORT_C TUid TInputInfo::ImageFrameFormatL() const |
|
77 { |
|
78 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
79 return iInputInfoImpl.ImageFrameFormatL(); |
|
80 } |
|
81 |
|
82 /** |
|
83 Gets the sampling of input image. |
|
84 |
|
85 @return sampling of image. |
|
86 */ |
|
87 EXPORT_C TUid TInputInfo::SamplingL() const |
|
88 { |
|
89 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
90 return iInputInfoImpl.SamplingL(); |
|
91 } |
|
92 |
|
93 /** |
|
94 Gets the bits per pixel of input image. |
|
95 |
|
96 @return bits per pixel of image. |
|
97 */ |
|
98 EXPORT_C TUint32 TInputInfo::BitsPerPixelL() const |
|
99 { |
|
100 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
101 return iInputInfoImpl.BitsPerPixelL(); |
|
102 } |
|
103 |
|
104 /** |
|
105 Gets the source image information and scans |
|
106 whether the source image allows progressive decoding or not. |
|
107 |
|
108 @return ETrue if the source image allows progressive decoding otherwise EFalse. |
|
109 */ |
|
110 EXPORT_C TBool TInputInfo::IsProgressiveL() const |
|
111 { |
|
112 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
113 return iInputInfoImpl.IsProgressiveL(); |
|
114 } |
|
115 |
|
116 /** |
|
117 Gets the source image information and scans whether the source image is interlaced or not. |
|
118 |
|
119 @return ETrue if the source image is interlaced otherwise EFlase. |
|
120 */ |
|
121 EXPORT_C TBool TInputInfo::IsInterlacedL() const |
|
122 { |
|
123 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
124 return iInputInfoImpl.IsInterlacedL(); |
|
125 } |
|
126 |
|
127 /** |
|
128 Gets the the image alpha information. |
|
129 |
|
130 @return true if input image has alpha channel. |
|
131 */ |
|
132 EXPORT_C TBool TInputInfo::HasAlphaL() const |
|
133 { |
|
134 __ASSERT_ALWAYS(iImageProcessorImpl.IsInputSet(), User::Leave(KErrNotReady)); |
|
135 return iInputInfoImpl.HasAlphaL(); |
|
136 } |
|
137 |
|
138 |
|
139 /** |
|
140 Retrieves access to a custom extension. |
|
141 |
|
142 @param aExtension |
|
143 The UID of the extension to be retrieved |
|
144 |
|
145 @return Extension corresponding to the UID given as a parameter. |
|
146 */ |
|
147 EXPORT_C TAny* TInputInfo::Extension(TUid /*aExtension*/) const |
|
148 { |
|
149 return NULL; |
|
150 } |
|
151 }//namespace ImageProcessor |
|
152 //EOF |