|
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 "imageprocessorimpl.h" |
|
17 |
|
18 using namespace ImageProcessor; |
|
19 |
|
20 /** |
|
21 Constructs a new image processor object. |
|
22 |
|
23 @param aFileServerSession |
|
24 A file server session for the image processor to use. |
|
25 @param aObserver |
|
26 The image processor observer to recieve callbacks. |
|
27 @param aImageProcessorPluginUid |
|
28 The UID of the image processor plugin to load. Can be set to KUidNull which will load the |
|
29 highest version of the plugin. |
|
30 |
|
31 @leave KErrNoMemory |
|
32 There is insufficient memory available. |
|
33 |
|
34 @return A pointer to the new image processor object. |
|
35 */ |
|
36 EXPORT_C CImgProcessor* CImgProcessor::NewL(RFs& aFileServerSession, MImgProcessorObserver& aObserver, TUid aImageProcessorPluginUid) |
|
37 { |
|
38 CImgProcessor* self = new (ELeave) CImgProcessor; |
|
39 CleanupStack::PushL(self); |
|
40 self->ConstructL(aFileServerSession, aObserver, aImageProcessorPluginUid); |
|
41 CleanupStack::Pop(self); |
|
42 return self; |
|
43 } |
|
44 |
|
45 CImgProcessor::CImgProcessor() |
|
46 { |
|
47 |
|
48 } |
|
49 |
|
50 void CImgProcessor::ConstructL(RFs& aFileServerSession, MImgProcessorObserver& aObserver, TUid aImageProcessor) |
|
51 { |
|
52 iImplementation = CImageProcessorImpl::NewL(aFileServerSession,*this,aObserver,aImageProcessor); |
|
53 } |
|
54 |
|
55 EXPORT_C CImgProcessor::~CImgProcessor() |
|
56 { |
|
57 delete iImplementation; |
|
58 } |
|
59 |
|
60 /** |
|
61 Returns a list of effect UIDs which can be applied by this image processor. |
|
62 |
|
63 @param aEffects |
|
64 Array to be filled by the list of the supported effects. |
|
65 |
|
66 */ |
|
67 EXPORT_C void CImgProcessor::SupportedEffectsL(RArray<TUid>& aEffects) const |
|
68 { |
|
69 iImplementation->SupportedEffectsL(aEffects); |
|
70 } |
|
71 |
|
72 /** |
|
73 Returns a list of compressed image formats which are supported (e.g. KImageTypeJPGUid etc). |
|
74 |
|
75 @param aFormats |
|
76 Array to be filled by the list of the supported input formats. |
|
77 |
|
78 */ |
|
79 EXPORT_C void CImgProcessor::SupportedInputFormatsL(RArray<TUid>& aFormats) const |
|
80 { |
|
81 iImplementation->SupportedInputFormatsL(aFormats); |
|
82 } |
|
83 |
|
84 //(e.g. ?????) |
|
85 /** |
|
86 Returns a list of the input sub-formats supported. |
|
87 |
|
88 @param aFormat |
|
89 Supported input format. |
|
90 |
|
91 @param aSubFormats |
|
92 Array to be filled by the list of the supported input sub-formats. |
|
93 |
|
94 */ |
|
95 EXPORT_C void CImgProcessor::SupportedInputSubFormatsL(TUid aFormat, RArray<TUid>& aSubFormats) const |
|
96 { |
|
97 iImplementation->SupportedInputSubFormatsL(aFormat, aSubFormats); |
|
98 } |
|
99 |
|
100 /** |
|
101 Returns a list of supported image frame formats (e.g. KUidFormat32BitRGB888Interleaved). |
|
102 |
|
103 @param aFormats |
|
104 Array to be filled in by the list of the supported input formats. |
|
105 |
|
106 */ |
|
107 EXPORT_C void CImgProcessor::SupportedInputImageFrameFormatsL(RArray<TUid>& aFormats) const |
|
108 { |
|
109 iImplementation->SupportedInputImageFrameFormatsL(aFormats); |
|
110 } |
|
111 |
|
112 /** |
|
113 Returns a list of supported input display modes (e.g. EColor16M). |
|
114 |
|
115 @param aDisplayModes |
|
116 Array to be filled in by the list of the supported input display modes. |
|
117 |
|
118 */ |
|
119 EXPORT_C void CImgProcessor::SupportedInputDisplayModesL(RArray<TDisplayMode>& aDisplayModes) const |
|
120 { |
|
121 iImplementation->SupportedInputDisplayModesL(aDisplayModes); |
|
122 } |
|
123 |
|
124 /** |
|
125 Returns a list of supported compressed output image formats (e.g. KImageTypeJPGUid etc.). |
|
126 |
|
127 @param aFormats |
|
128 Array to be filled in by the list of the supported output formats. |
|
129 |
|
130 */ |
|
131 EXPORT_C void CImgProcessor::SupportedOutputFormatsL(RArray<TUid>& aFormats) const |
|
132 { |
|
133 iImplementation->SupportedOutputFormatsL(aFormats); |
|
134 } |
|
135 |
|
136 //(e.g. ?????) |
|
137 /** |
|
138 Returns a list of the output sub-formats supported. |
|
139 |
|
140 @param aFormat |
|
141 The supported format of ImageProcessor. |
|
142 |
|
143 @param aSubFormats |
|
144 Array to be filled in by the list of the supported sub formats of ImageProcessor. |
|
145 */ |
|
146 EXPORT_C void CImgProcessor::SupportedOutputSubFormatsL(TUid aFormat, RArray<TUid>& aSubFormats) const |
|
147 { |
|
148 iImplementation->SupportedOutputSubFormatsL(aFormat, aSubFormats); |
|
149 } |
|
150 |
|
151 /** |
|
152 Returns a list of image frame formats to which the output can be rendered (e.g. KUidFormat32BitRGB888Interleaved). |
|
153 |
|
154 @param aFormats |
|
155 Array to be filled in by the list of the supported output frame formats. |
|
156 |
|
157 */ |
|
158 EXPORT_C void CImgProcessor::SupportedOutputImageFrameFormatsL(RArray<TUid>& aFormats) const |
|
159 { |
|
160 iImplementation->SupportedOutputImageFrameFormatsL(aFormats); |
|
161 } |
|
162 |
|
163 /** |
|
164 Returns a list of supported output display modes (e.g. EColor16M). |
|
165 |
|
166 @param aDisplayModes |
|
167 Array to be filled in by the list of the supported output display modes. |
|
168 |
|
169 */ |
|
170 EXPORT_C void CImgProcessor::SupportedOutputDisplayModesL(RArray<TDisplayMode>& aDisplayModes) const |
|
171 { |
|
172 iImplementation->SupportedOutputDisplayModesL(aDisplayModes); |
|
173 } |
|
174 |
|
175 /** |
|
176 Returns the options supported by this image processor as a set of flags. |
|
177 |
|
178 @return A TUint64 containing the supported options. |
|
179 |
|
180 @see CImgProcessor:TOptions |
|
181 */ |
|
182 EXPORT_C TUint64 CImgProcessor::SupportedOptions() const |
|
183 { |
|
184 return iImplementation->SupportedOptions(); |
|
185 } |
|
186 |
|
187 /** |
|
188 Sets the desired options. Options can be combined using bitwise inclusive OR. |
|
189 |
|
190 @param aOptions |
|
191 The new options to set to this image processor. |
|
192 |
|
193 @see CImgProcessor:TOptions |
|
194 */ |
|
195 EXPORT_C void CImgProcessor::SetOptionsL(TUint64 aOptions) |
|
196 { |
|
197 iImplementation->SetOptionsL(aOptions); |
|
198 } |
|
199 |
|
200 /** |
|
201 Gets the set of operations supported. |
|
202 |
|
203 @return A TUint containing the supported operations. |
|
204 |
|
205 @see CImgProcessor:TOperation |
|
206 |
|
207 */ |
|
208 EXPORT_C TUint CImgProcessor::SupportedOperations() const |
|
209 { |
|
210 return iImplementation->SupportedOperations(); |
|
211 } |
|
212 |
|
213 /** |
|
214 Gets the set of the options set in the image processor. |
|
215 |
|
216 @return A TUint containing the image processor options. |
|
217 |
|
218 @see CImgProcessor:TOperation |
|
219 |
|
220 */ |
|
221 EXPORT_C TUint64 CImgProcessor::Options() const |
|
222 { |
|
223 return iImplementation->Options(); |
|
224 } |
|
225 |
|
226 /** |
|
227 Applies a geometrical operation to the image. |
|
228 The image processor needs to be in an initialized state. |
|
229 |
|
230 @param aOperation |
|
231 The geometrical operation to be applied. |
|
232 |
|
233 */ |
|
234 EXPORT_C void CImgProcessor::ApplyOperationL(CImgProcessor::TOperation aOperation) |
|
235 { |
|
236 iImplementation->ApplyOperationL(aOperation); |
|
237 } |
|
238 |
|
239 /** |
|
240 Returns the state of the image processor. |
|
241 |
|
242 @return The image processor's state. |
|
243 |
|
244 @see CImgProcessor::TState |
|
245 */ |
|
246 EXPORT_C CImgProcessor::TState CImgProcessor::State() const |
|
247 { |
|
248 return iImplementation->State(); |
|
249 } |
|
250 |
|
251 /** |
|
252 Calculates the required pixel buffer size in bytes for the destination image given display mode and scan line length. |
|
253 |
|
254 @param aSizeInPixels |
|
255 The size in pixels of the image to calculate buffer size for. |
|
256 @param aDisplayMode |
|
257 The display mode of the destination image to calculate buffer size for. |
|
258 section for details. |
|
259 @param aScanLineLength |
|
260 Number of bytes per image row. |
|
261 |
|
262 @return The calculated pixel buffer size in bytes. |
|
263 |
|
264 @leave KErrNotReady |
|
265 The image processor is not in EUninitialized state. |
|
266 |
|
267 @leave Other |
|
268 A range of system wide error codes. |
|
269 */ |
|
270 EXPORT_C TInt CImgProcessor::CalculatePixelBufferSizeL(TSize aSizeInPixels, TDisplayMode aDisplayMode, TUint32 aScanLineLength) const |
|
271 { |
|
272 return iImplementation->CalculatePixelBufferSizeL(aSizeInPixels, aDisplayMode, aScanLineLength); |
|
273 } |
|
274 |
|
275 /** |
|
276 Calculates the required pixel buffer size in bytes for the destination image given destination uncompressed image format and scan line length. |
|
277 |
|
278 @param aSizeInPixels |
|
279 The size in pixels of the raw image to calculate buffer size for. |
|
280 @param aFormat |
|
281 The format of the raw image to calculate buffer size for (one of the valid CImageFrame formats). |
|
282 section for details. |
|
283 @param aScanLineLength |
|
284 Number of bytes per image row. |
|
285 |
|
286 @return The calculated pixel buffer size. |
|
287 |
|
288 @leave KErrNotReady |
|
289 The image processor is not in EUninitialized state. |
|
290 |
|
291 @leave Other |
|
292 A range of system wide error codes. |
|
293 |
|
294 */ |
|
295 EXPORT_C TInt CImgProcessor::CalculatePixelBufferSizeL(TSize aSizeInPixels, const TUid& aFormat, TUint32 aScanLineLength) const |
|
296 { |
|
297 return iImplementation->CalculatePixelBufferSizeL(aSizeInPixels, aFormat, aScanLineLength); |
|
298 } |
|
299 |
|
300 /** |
|
301 Creates internal pixel buffer for the input and copies data from source bitmap to internal buffer |
|
302 |
|
303 @param aBitmap |
|
304 The bitmap to copy. |
|
305 |
|
306 @leave KErrNotReady |
|
307 The image processor is not initialized. |
|
308 |
|
309 @leave KErrArgument |
|
310 The input bitmap size is 0. |
|
311 |
|
312 @leave Other |
|
313 A range of system wide error codes. |
|
314 */ |
|
315 EXPORT_C void CImgProcessor::CreateInputL(CFbsBitmap& aBitmap) |
|
316 { |
|
317 iImplementation->CreateInputL(aBitmap); |
|
318 } |
|
319 |
|
320 /** |
|
321 Creates internal pixel buffer the for the source image and copies data from the image frame to the internal buffer |
|
322 |
|
323 @param aPixelBuffer |
|
324 The image frame to copy. |
|
325 |
|
326 @leave KErrNotReady |
|
327 The image processor is not initialized. |
|
328 |
|
329 @leave KErrArgument |
|
330 The input bitmap size is 0. |
|
331 |
|
332 @leave Other |
|
333 A range of system wide error codes. |
|
334 */ |
|
335 EXPORT_C void CImgProcessor::CreateInputL(CImageFrame& aPixelBuffer) |
|
336 { |
|
337 iImplementation->CreateInputL(aPixelBuffer); |
|
338 } |
|
339 |
|
340 /** |
|
341 Creates internal pixel buffer for the source image using the given size and initializes source image with the given color. |
|
342 |
|
343 @param aSize |
|
344 The size of the new source image. |
|
345 @param aColor |
|
346 The color of the new source image. |
|
347 |
|
348 @leave KErrNotReady |
|
349 The image processor is not initialized. |
|
350 |
|
351 @leave KErrArgument |
|
352 The input bitmap size is 0. |
|
353 |
|
354 @leave Other |
|
355 A range of system wide error codes. |
|
356 */ |
|
357 EXPORT_C void CImgProcessor::CreateInputL(const TSize& aSize, const TRgb& aColor) |
|
358 { |
|
359 iImplementation->CreateInputL(aSize, aColor); |
|
360 } |
|
361 |
|
362 /** |
|
363 Sets or updates the source image to the specified file name. |
|
364 |
|
365 @param aFilename |
|
366 The filename of the new source image to use. |
|
367 @param aFormat |
|
368 The format of the new source image to use. If KNullUid is passed then an attempt is made to recognize its format. |
|
369 @param aSubFormat |
|
370 The sub-format of the new source image to use. If KNullUid is passed then an attempt is made to recognize its sub-format. |
|
371 |
|
372 @leave KErrNotReady |
|
373 The image processor is not initialized. |
|
374 |
|
375 @leave Other |
|
376 A range of system wide error codes. |
|
377 */ |
|
378 EXPORT_C void CImgProcessor::SetInputL(const TDesC& aFilename, const TUid& aFormat, const TUid& aSubFormat) |
|
379 { |
|
380 iImplementation->SetInputL(aFilename, aFormat, aSubFormat); |
|
381 } |
|
382 |
|
383 /** |
|
384 The source image is set or updated to the given file. |
|
385 |
|
386 @param aFile |
|
387 The file handle of the new source image to use. |
|
388 @param aFormat |
|
389 The format of the new source image to use. |
|
390 @param aSubFormat |
|
391 The sub-format of the new source image to use. |
|
392 |
|
393 @leave KErrNotReady |
|
394 The image processor is not initialized. |
|
395 |
|
396 @leave Other |
|
397 A range of system wide error codes. |
|
398 */ |
|
399 EXPORT_C void CImgProcessor::SetInputL(RFile& aFile, const TUid& aFormat, const TUid& aSubFormat) |
|
400 { |
|
401 iImplementation->SetInputL(aFile, aFormat, aSubFormat); |
|
402 } |
|
403 |
|
404 /** |
|
405 The source image is set or updated. The source image may be DRM protected. |
|
406 |
|
407 @param aDrmFile |
|
408 The DRM file of the new source image to use. |
|
409 @param aFormat |
|
410 The format of the new source image to use. |
|
411 @param aSubFormat |
|
412 The sub-format of the new source image to use. |
|
413 |
|
414 @leave KErrNotReady |
|
415 The image processor is not initialized. |
|
416 |
|
417 @leave Other |
|
418 A range of system wide error codes. |
|
419 */ |
|
420 EXPORT_C void CImgProcessor::SetInputL(TMMSource& aDrmFile, const TUid& aFormat, const TUid& aSubFormat) |
|
421 { |
|
422 iImplementation->SetInputL(aDrmFile, aFormat, aSubFormat); |
|
423 } |
|
424 |
|
425 //aBuffer (Is this both compressed and uncompressed data?) |
|
426 /** |
|
427 The source image is set or updated to the content of the buffer provided. |
|
428 |
|
429 @param aBuffer |
|
430 The buffer containing the new source image to use. |
|
431 @param aFormat |
|
432 The format of the new source image to use. |
|
433 @param aSubFormat |
|
434 The sub-format of the new source image to use. |
|
435 |
|
436 @leave KErrNotReady |
|
437 The image processor is not initialized. |
|
438 |
|
439 @leave Other |
|
440 A range of system wide error codes. |
|
441 */ |
|
442 EXPORT_C void CImgProcessor::SetInputL(const TDesC8& aBuffer, const TUid& aFormat, const TUid& aSubFormat) |
|
443 { |
|
444 iImplementation->SetInputL(aBuffer, aFormat, aSubFormat); |
|
445 } |
|
446 |
|
447 /** |
|
448 The source image is set or updated to the bitmap provided. |
|
449 |
|
450 @param aBitmap |
|
451 The bitmap of the new source image to use. |
|
452 @param aMask |
|
453 The bitmap mask of the new source image to use. |
|
454 |
|
455 @leave KErrNotReady |
|
456 The image processor is not initialized. |
|
457 |
|
458 @leave Other |
|
459 A range of system wide error codes. |
|
460 */ |
|
461 EXPORT_C void CImgProcessor::SetInputL(const CFbsBitmap& aBitmap, const CFbsBitmap* aMask) |
|
462 { |
|
463 iImplementation->SetInputL(aBitmap, aMask); |
|
464 } |
|
465 |
|
466 /** |
|
467 The source image is set or updated to the image frame provided. |
|
468 |
|
469 @param aPixelBuffer |
|
470 The image frame of the new source image to use. |
|
471 |
|
472 @leave KErrNotReady |
|
473 The image processor is not initialized. |
|
474 |
|
475 @leave Other |
|
476 A range of system wide error codes. |
|
477 */ |
|
478 EXPORT_C void CImgProcessor::SetInputL(const CImageFrame& aPixelBuffer) |
|
479 { |
|
480 iImplementation->SetInputL(aPixelBuffer); |
|
481 } |
|
482 |
|
483 /** |
|
484 The input is set or updated to the panorama object provided. Any existing options are reset. |
|
485 |
|
486 @param aPanorama |
|
487 The panorama object to use. |
|
488 |
|
489 @leave KErrNotReady |
|
490 The image processor is not initialized. |
|
491 |
|
492 @leave Other |
|
493 A range of system wide error codes. |
|
494 */ |
|
495 EXPORT_C void CImgProcessor::SetInputL(CImagePanorama& aPanorama) |
|
496 { |
|
497 iImplementation->SetInputL(aPanorama); |
|
498 } |
|
499 |
|
500 /** |
|
501 This method needs to be called when the input image source data has been updated externally. |
|
502 |
|
503 @leave KErrNotReady |
|
504 The image processor is not initialized or input image source data hasn't been set. |
|
505 |
|
506 @leave Other |
|
507 A range of system wide error codes. |
|
508 */ |
|
509 EXPORT_C void CImgProcessor::InputUpdatedL() |
|
510 { |
|
511 iImplementation->InputUpdatedL(); |
|
512 } |
|
513 |
|
514 /** |
|
515 Resets the image processor. image processor's input is reset and image processor's state is set to EInitialized. |
|
516 |
|
517 @leave KErrNotReady |
|
518 The image processor is not initialized or is initializing. |
|
519 |
|
520 @leave Other |
|
521 A range of system wide error codes. |
|
522 */ |
|
523 EXPORT_C void CImgProcessor::ResetL() |
|
524 { |
|
525 iImplementation->ResetL(); |
|
526 } |
|
527 |
|
528 /** |
|
529 Initializes the image processor asynchronously. After this asynchronous call completes,the image processor's state should |
|
530 normally be EInitialized. |
|
531 |
|
532 @leave KErrNotReady |
|
533 The image processor has already been initialized. |
|
534 |
|
535 @leave Other |
|
536 A range of system wide error codes. |
|
537 */ |
|
538 EXPORT_C void CImgProcessor:: InitializeL() |
|
539 { |
|
540 InitializeL(EOptionNone); |
|
541 } |
|
542 |
|
543 /** |
|
544 Initializes the image processor. After the initialization completes, the image processor's state should |
|
545 normally be EInitialized. |
|
546 |
|
547 @param aOptions |
|
548 The options to set to this image processor with the initialization. |
|
549 |
|
550 @leave KErrNotReady |
|
551 The image processor has already been initialized. |
|
552 |
|
553 @leave KErrNotSupported |
|
554 The option to set to the image processor is not supported. |
|
555 |
|
556 @leave Other |
|
557 A range of system wide error codes. |
|
558 */ |
|
559 EXPORT_C void CImgProcessor:: InitializeL(TUint64 aOptions) |
|
560 { |
|
561 TRAPD(err, iImplementation->InitializeL(aOptions)); |
|
562 |
|
563 if (err != KErrNone) |
|
564 { |
|
565 iImplementation->Cleanup(); |
|
566 User::Leave(err); |
|
567 } |
|
568 } |
|
569 |
|
570 /** |
|
571 All operations and effects are performed on the source image which is then rendered to the output specified. |
|
572 The size for the output image being rendered is the same as the size for the input image. Aspect ratio is |
|
573 maintained. |
|
574 |
|
575 The image processor behaves differently according to if ImageProcessor::EOptionSyncProcessing is set or not @see ImageProcessor::CImgProcessor::SetOptionsL. |
|
576 In the asynchronous case the call leaves with KErrNorReady immediately if the image processor is not initialised. |
|
577 If an error occurs during asynchronous processing then the error is reported back to the client via the observer @see ImageProcessor::MImgProcessorObserver. |
|
578 |
|
579 In the synchronous case i.e. when ImageProcessor::EOptionSyncProcessing is set then the same errors are reported |
|
580 except this time by leaving with the error code directly from ProcessL. In this case no callback is made to the |
|
581 observer. |
|
582 |
|
583 @leave KErrNotReady |
|
584 The image processor is not initialized or input is not set or output is not set. |
|
585 |
|
586 @leave Other |
|
587 A range of system wide error codes. |
|
588 */ |
|
589 EXPORT_C void CImgProcessor::ProcessL() |
|
590 { |
|
591 iImplementation->ProcessL(TSize(0,0), ETrue); |
|
592 } |
|
593 |
|
594 /** |
|
595 All operations and effects are performed on the source image which is then rendered to the output specified. |
|
596 The aspect ratio can be controlled. |
|
597 |
|
598 @param aSize |
|
599 The proposed size for the output image being rendered. If a size of 0, 0 is passed then the rendered output size is the same as the input size. |
|
600 |
|
601 @param aMaintainAspectRatio |
|
602 ETrue to maintain the aspect ratio, EFalse otherwise. |
|
603 Must be ETrue if aSize is passed as 0,0 |
|
604 |
|
605 @leave KErrNotReady |
|
606 The image processor is not initialized or input is not set or output is not set. |
|
607 |
|
608 @leave Other |
|
609 A range of system wide error codes. |
|
610 */ |
|
611 EXPORT_C void CImgProcessor::ProcessL(const TSize& aSize, TBool aMaintainAspectRatio) |
|
612 { |
|
613 iImplementation->ProcessL(aSize, aMaintainAspectRatio); |
|
614 } |
|
615 |
|
616 //(Better to have CancelRender() etc?) |
|
617 /** |
|
618 Cancels any current asynchronous operation, for example preview or output rendering. |
|
619 Ignored if no asynchronous operation is in progress. |
|
620 */ |
|
621 EXPORT_C void CImgProcessor::Cancel() |
|
622 { |
|
623 return iImplementation->Cancel(); |
|
624 } |
|
625 |
|
626 /** |
|
627 Sets the background color to use for the output image. Any area of the output image which is not rendered to is set to this colour. |
|
628 |
|
629 @param aColor |
|
630 The background color to set. |
|
631 |
|
632 @leave KErrNotReady |
|
633 The image processor is not initialized or input is not set. |
|
634 |
|
635 @leave Other |
|
636 A range of system wide error codes. |
|
637 */ |
|
638 EXPORT_C void CImgProcessor::SetBackgroundColorL(const TRgb& aColor) |
|
639 { |
|
640 iImplementation->SetBackgroundColorL(aColor); |
|
641 } |
|
642 |
|
643 /** |
|
644 Retrieves the current background color. |
|
645 |
|
646 @return The current background color. |
|
647 |
|
648 @leave KErrNotReady |
|
649 The input of the image processor is not set. |
|
650 |
|
651 @leave Other |
|
652 A range of system wide error codes. |
|
653 */ |
|
654 EXPORT_C TRgb CImgProcessor::BackgroundColorL() const |
|
655 { |
|
656 return iImplementation->BackgroundColorL(); |
|
657 } |
|
658 |
|
659 /** |
|
660 Retrieves the interface to an specific effect (e.g. Sepia effect) given an effect UID. |
|
661 |
|
662 @return The effect interface corresponding to the given effect UID. |
|
663 |
|
664 @leave KErrNotReady |
|
665 The image processor is not initialized or is initializing. |
|
666 |
|
667 @leave KErrNotSupported |
|
668 The given effect is not supported. |
|
669 |
|
670 @leave KErrNoMemory |
|
671 Not enough memory. |
|
672 |
|
673 @leave Other |
|
674 A range of system wide error codes. |
|
675 */ |
|
676 EXPORT_C ImageProcessor::TEffect* CImgProcessor::EffectL(TUid aEffect) |
|
677 { |
|
678 return iImplementation->EffectL(aEffect); |
|
679 } |
|
680 |
|
681 /** |
|
682 Determines if there are operations on the operation stack which can be 'undone'. |
|
683 |
|
684 @return ETrue if at least one operation applied to the image can be undone; EFalse otherwise. |
|
685 |
|
686 @leave KErrNotReady |
|
687 The image processor is not initialized or input is not set. |
|
688 |
|
689 @leave Other |
|
690 A range of system wide error codes. |
|
691 */ |
|
692 EXPORT_C TBool CImgProcessor::CanUndoL() const |
|
693 { |
|
694 return iImplementation->CanUndoL(); |
|
695 } |
|
696 |
|
697 /** |
|
698 Reverts the most recent operation which can be undone. |
|
699 |
|
700 @leave KErrNotReady |
|
701 The image processor is not initialized or input is not set. |
|
702 |
|
703 @leave Other |
|
704 A range of system wide error codes. |
|
705 */ |
|
706 EXPORT_C void CImgProcessor::UndoL() |
|
707 { |
|
708 iImplementation->UndoL(); |
|
709 } |
|
710 |
|
711 /** |
|
712 Reverts all operations which can be undone. |
|
713 |
|
714 @leave KErrNotReady |
|
715 The image processor is not initialized or input is not set. |
|
716 |
|
717 @leave Other |
|
718 A range of system wide error codes. |
|
719 */ |
|
720 EXPORT_C void CImgProcessor::UndoAllL() |
|
721 { |
|
722 iImplementation->UndoAllL(); |
|
723 } |
|
724 |
|
725 /** |
|
726 Determines if there are operations on the operation stack which can be re-applied. |
|
727 |
|
728 @leave KErrNotReady |
|
729 The image processor is not initialized or input is not set. |
|
730 |
|
731 @return ETrue if at least one operation applied to the image can be redone; EFalse otherwise. |
|
732 */ |
|
733 EXPORT_C TBool CImgProcessor::CanRedoL() const |
|
734 { |
|
735 return iImplementation->CanRedoL(); |
|
736 } |
|
737 |
|
738 /** |
|
739 Re-applies the most recent redoable operation. |
|
740 |
|
741 @leave KErrNotReady |
|
742 The image processor is not initialized or input is not set. |
|
743 |
|
744 @leave Other |
|
745 A range of system wide error codes. |
|
746 */ |
|
747 EXPORT_C void CImgProcessor::RedoL() |
|
748 { |
|
749 iImplementation->RedoL(); |
|
750 } |
|
751 |
|
752 /** |
|
753 Re-applies all re-doable operations previously undone. |
|
754 |
|
755 @leave KErrNotReady |
|
756 The image processor is not initialized or input is not set. |
|
757 |
|
758 @leave Other |
|
759 A range of system wide error codes. |
|
760 */ |
|
761 EXPORT_C void CImgProcessor::RedoAllL() |
|
762 { |
|
763 iImplementation->RedoAllL(); |
|
764 } |
|
765 |
|
766 /** |
|
767 Displays a low resolution preview of the output image with the effects and/or |
|
768 operations applied before rendering to a high resolution output image. Multiple previews are possible. |
|
769 |
|
770 If the requested preview already exists, it will be returned, otherwise a new preview with id aPreviewId will be created |
|
771 and returned. |
|
772 |
|
773 @param aPreviewId |
|
774 The unique id for preview image. It is not the index of the preview of Image Processor. Instead any value |
|
775 can be given here to either return an preview previously created or will create a new one with that id. |
|
776 |
|
777 @return A TPreview object. |
|
778 |
|
779 @leave KErrNotReady |
|
780 The image processor is not initialized or is initializing. |
|
781 |
|
782 @leave KErrNoMemory |
|
783 Not enough memory. |
|
784 |
|
785 @leave Other |
|
786 A range of system wide error codes. |
|
787 */ |
|
788 EXPORT_C ImageProcessor::TPreview* CImgProcessor::PreviewL(TInt aPreviewId) |
|
789 { |
|
790 return iImplementation->PreviewL(aPreviewId); |
|
791 } |
|
792 |
|
793 //(? are multiple overlays supported?) |
|
794 /** |
|
795 Retrieves this image processor's TOverlay object. TOverlay provides functions to overlay a border or clipart onto an image. |
|
796 |
|
797 @return The image processor's overlay object. |
|
798 |
|
799 @leave KErrNotReady |
|
800 The image processor is not initialized or is initializing. |
|
801 |
|
802 @leave KErrNoMemory |
|
803 Not enough memory. |
|
804 |
|
805 @leave Other |
|
806 A range of system wide error codes. |
|
807 */ |
|
808 EXPORT_C ImageProcessor::TOverlay* CImgProcessor::OverlayL() |
|
809 { |
|
810 return iImplementation->OverlayL(); |
|
811 } |
|
812 |
|
813 /** |
|
814 The progress infomation of the rendering function which is executed iteratively to enable asynchronous operation. |
|
815 This gives the possibility to show a progress bar in the GUI when performing time consuming renderings. Rendering functions |
|
816 are synchronous if EOptionSyncProcessing option is set on CImgProcessor. |
|
817 |
|
818 Retrieves the available progress information in a TProgressInfo obect. |
|
819 |
|
820 @return a TProgressInfo object containing all the progress information. |
|
821 |
|
822 @leave KErrNotReady |
|
823 The image processor is not initialized or is initializing. |
|
824 |
|
825 @leave KErrNoMemory |
|
826 Not enough memory. |
|
827 |
|
828 @leave Other |
|
829 A range of system wide error codes. |
|
830 */ |
|
831 EXPORT_C ImageProcessor::TProgressInfo* CImgProcessor::ProgressInfoL() |
|
832 { |
|
833 return iImplementation->ProgressInfoL(); |
|
834 } |
|
835 |
|
836 /** |
|
837 Retrieves information about the current source image. |
|
838 |
|
839 @return a TInputInfo filled with all available information about the current source image. |
|
840 |
|
841 @leave KErrNotReady |
|
842 The image processor is not initialized or is initializing. |
|
843 |
|
844 @leave KErrNoMemory |
|
845 Not enough memory. |
|
846 |
|
847 @leave Other |
|
848 A range of system wide error codes. |
|
849 */ |
|
850 EXPORT_C ImageProcessor::TInputInfo* CImgProcessor::InputInfoL() |
|
851 { |
|
852 return iImplementation->InputInfoL(); |
|
853 } |
|
854 |
|
855 /** |
|
856 Retrieves information about the output image. |
|
857 |
|
858 @return a TOutputInfo filled with all available information about the output image. |
|
859 |
|
860 @leave KErrNotReady |
|
861 The image processor is not initialized or is initializing. |
|
862 |
|
863 @leave KErrNoMemory |
|
864 Not enough memory. |
|
865 |
|
866 @leave Other |
|
867 A range of system wide error codes. |
|
868 */ |
|
869 EXPORT_C ImageProcessor::TOutputInfo* CImgProcessor::OutputInfoL() |
|
870 { |
|
871 return iImplementation->OutputInfoL(); |
|
872 } |
|
873 |
|
874 /** |
|
875 Sets the area of interest of the source image to be used for processing. |
|
876 |
|
877 @param aRect |
|
878 A reference to a TRect that specifies the location and size of the region to be used for the source image. |
|
879 |
|
880 @leave KErrNotReady |
|
881 The image processor is not initialized or input image source data hasn't been set. |
|
882 |
|
883 @leave KErrArgument |
|
884 The area size is 0 or there is no overlap between aRect and source image. |
|
885 |
|
886 @leave Other |
|
887 A range of system wide error codes. |
|
888 */ |
|
889 EXPORT_C void CImgProcessor::SetInputRectL(const TRect& aRect) |
|
890 { |
|
891 return iImplementation->SetInputRectL(aRect); |
|
892 } |
|
893 |
|
894 /** |
|
895 Retrieves the size of the current source image. |
|
896 |
|
897 @return The size of the current source image. |
|
898 |
|
899 @leave KErrNotReady |
|
900 The input image source data hasn't been set. |
|
901 |
|
902 @leave Other |
|
903 A range of system wide error codes. |
|
904 */ |
|
905 EXPORT_C TSize CImgProcessor::CurrentSizeL() const |
|
906 { |
|
907 return iImplementation->CurrentSizeL(); |
|
908 } |
|
909 |
|
910 /** |
|
911 Changes the output image to the image specified in the file given. Rendering is not performed. |
|
912 |
|
913 @param aFilename |
|
914 The filename of the new output image to use. |
|
915 @param aFormat |
|
916 The format of the new output image to use. |
|
917 @param aSubFormat |
|
918 The sub-format of the new output image to use. |
|
919 |
|
920 @leave KErrNotReady |
|
921 The image processor is not initialized. |
|
922 |
|
923 @leave Other |
|
924 A range of system wide error codes. |
|
925 */ |
|
926 EXPORT_C void CImgProcessor::SetOutputL(const TDesC& aFilename, const TUid& aFormat, const TUid& aSubFormat) |
|
927 { |
|
928 iImplementation->SetOutputL(aFilename, aFormat, aSubFormat); |
|
929 } |
|
930 |
|
931 /** |
|
932 Changes the output image to the image specified in the file given. Rendering is not performed. |
|
933 |
|
934 @param aFile |
|
935 The file handle of the new output image to use. |
|
936 @param aFormat |
|
937 The format of the new output image to use. |
|
938 @param aSubFormat |
|
939 The sub-format of the new output image to use. |
|
940 |
|
941 @leave KErrNotReady |
|
942 The image processor is not initialized. |
|
943 |
|
944 @leave Other |
|
945 A range of system wide error codes. |
|
946 */ |
|
947 EXPORT_C void CImgProcessor::SetOutputL(RFile& aFile, const TUid& aFormat, const TUid& aSubFormat) |
|
948 { |
|
949 iImplementation->SetOutputL(aFile, aFormat, aSubFormat); |
|
950 } |
|
951 |
|
952 /** |
|
953 Changes the output image to the image specified in the buffer given. Rendering is not performed. |
|
954 |
|
955 @param aBuffer |
|
956 The buffer containing the new output image to use. This may be re-allocated when rendering is performed if more memory is required. |
|
957 @param aFormat |
|
958 The format of the new output image to use. |
|
959 @param aSubFormat |
|
960 The sub-format of the new output image to use. |
|
961 |
|
962 @leave KErrNotReady |
|
963 The image processor is not initialized. |
|
964 |
|
965 @leave Other |
|
966 A range of system wide error codes. |
|
967 */ |
|
968 EXPORT_C void CImgProcessor::SetOutputL(RBuf8& aBuffer, const TUid& aFormat, const TUid& aSubFormat) |
|
969 { |
|
970 iImplementation->SetOutputL(aBuffer, aFormat, aSubFormat); |
|
971 } |
|
972 |
|
973 /** |
|
974 Changes the output image to the image specified in the buffer given. Rendering is not performed. |
|
975 |
|
976 @param aPixelBuffer |
|
977 The image frame of the new output image to use. |
|
978 |
|
979 @leave KErrNotReady |
|
980 The image processor is not initialized. |
|
981 |
|
982 @leave KErrArgument |
|
983 The buffer is empty. |
|
984 |
|
985 @leave Other |
|
986 A range of system wide error codes. |
|
987 */ |
|
988 EXPORT_C void CImgProcessor::SetOutputL(CImageFrame& aPixelBuffer) |
|
989 { |
|
990 iImplementation->SetOutputL(aPixelBuffer); |
|
991 } |
|
992 |
|
993 /** |
|
994 Changes the output image to the image specified in the bitmap given. Rendering is not performed. |
|
995 |
|
996 @param aBitmap |
|
997 The bitmap of the new output image to use. |
|
998 @param aMask |
|
999 The bitmap mask of the new output image to use. |
|
1000 |
|
1001 @leave KErrNotReady |
|
1002 The image processor is not initialized. |
|
1003 |
|
1004 @leave KErrArgument |
|
1005 The bitmap is empty or given mask is empty. |
|
1006 |
|
1007 @leave Other |
|
1008 A range of system wide error codes. |
|
1009 */ |
|
1010 EXPORT_C void CImgProcessor::SetOutputL(CFbsBitmap& aBitmap, CFbsBitmap* aMask)// not sure about mask, CAPS doesn't support it |
|
1011 { |
|
1012 iImplementation->SetOutputL(aBitmap, aMask); |
|
1013 } |
|
1014 |
|
1015 /** |
|
1016 Retrieves a non-standard extension on the image processor. |
|
1017 |
|
1018 @param aExtension |
|
1019 The UID of the extension to be retrieved |
|
1020 |
|
1021 @return Extension corresponding to the UID given as a parameter. |
|
1022 */ |
|
1023 EXPORT_C TAny* CImgProcessor::Extension(TUid aExtension) |
|
1024 { |
|
1025 return iImplementation->Extension(aExtension); |
|
1026 } |
|
1027 |
|
1028 /** |
|
1029 Converts a given mime type to format and sub-format UIDs. |
|
1030 |
|
1031 @param aMimeType |
|
1032 The mime type to convert. |
|
1033 @param aFormat |
|
1034 The format UID corresponding to the given mime type. |
|
1035 @param aSubFormat |
|
1036 The sub-format UID corresponding to the given mime type. |
|
1037 |
|
1038 @leave KErrNotFound |
|
1039 The given mime type is not found in existing formats. |
|
1040 |
|
1041 @leave Other |
|
1042 A range of system wide error codes. |
|
1043 */ |
|
1044 EXPORT_C void CImgProcessor::ConvertMimeTypeToUidL(const TDesC8& aMimeType, TUid& aFormat, TUid& aSubFormat) const |
|
1045 { |
|
1046 iImplementation->ConvertMimeTypeToUidL(aMimeType, aFormat, aSubFormat); |
|
1047 } |
|
1048 |
|
1049 /** |
|
1050 Converts a given file extension to format and sub-format UIDs. |
|
1051 |
|
1052 @param aFileExtension |
|
1053 The file extension to convert. |
|
1054 @param aFormat |
|
1055 The format UID corresponding to the given file extension. |
|
1056 @param aSubFormat |
|
1057 The sub-format UID corresponding to the given file extension. |
|
1058 |
|
1059 @leave KErrNotFound |
|
1060 The given file extension is not found in existing formats. |
|
1061 |
|
1062 @leave Other |
|
1063 A range of system wide error codes. |
|
1064 */ |
|
1065 EXPORT_C void CImgProcessor::ConvertFileExtensionToUidL(const TDesC& aFileExtension, TUid& aFormat, TUid& aSubFormat) const |
|
1066 { |
|
1067 iImplementation->ConvertFileExtensionToUidL(aFileExtension, aFormat, aSubFormat); |
|
1068 } |
|
1069 |
|
1070 /** |
|
1071 Converts a format and sub-format UID to a mime type. |
|
1072 |
|
1073 @param aMimeType |
|
1074 Returns the mime type corresponding to the given format and sub-format UIDs. (Consider re-ordering these parameters) |
|
1075 @param aFormat |
|
1076 The format UID to convert. |
|
1077 @param aSubFormat |
|
1078 The sub-format UID to convert. |
|
1079 |
|
1080 @leave KErrNotFound |
|
1081 The given format UID is not found in existing mime types. |
|
1082 |
|
1083 @leave Other |
|
1084 A range of system wide error codes. |
|
1085 */ |
|
1086 EXPORT_C void CImgProcessor::ConvertUidToMimeTypeL(TDes8& aMimeType, const TUid& aFormat, const TUid& aSubFormat) const |
|
1087 { |
|
1088 iImplementation->ConvertUidToMimeTypeL(aMimeType, aFormat, aSubFormat); |
|
1089 } |
|
1090 |
|
1091 //(Is this one or more extension?) |
|
1092 /** |
|
1093 Converts a format and sub-format UIDs to a file extension. |
|
1094 |
|
1095 @param aFileExtension |
|
1096 The file extension corresponding to the given format and sub-format UIDs. (Consider re-ordering these parameters) |
|
1097 @param aFormat |
|
1098 The format UID to convert. |
|
1099 @param aSubFormat |
|
1100 The sub-format UID to convert. |
|
1101 |
|
1102 @leave KErrNotFound |
|
1103 The given format UID is not found in existing file extensions. |
|
1104 |
|
1105 @leave Other |
|
1106 A range of system wide error codes. |
|
1107 */ |
|
1108 EXPORT_C void CImgProcessor::ConvertUidToFileExtensionL(TDes& aFileExtension, const TUid& aFormat, const TUid& aSubFormat) const |
|
1109 { |
|
1110 iImplementation->ConvertUidToFileExtensionL(aFileExtension, aFormat, aSubFormat); |
|
1111 } |
|
1112 |
|
1113 //EOF |