|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedAll |
|
19 @released |
|
20 */ |
|
21 |
|
22 #include <imageframe.h> |
|
23 #include "imageframebody.h" |
|
24 #include "ImageClientMain.h" |
|
25 |
|
26 /** |
|
27 Constructor for the TFrameFormatBase class. |
|
28 |
|
29 @param aType |
|
30 The UID used to identify a specific format class. |
|
31 It is used as a runtime identification of the particular subclass. |
|
32 */ |
|
33 EXPORT_C TFrameFormatBase::TFrameFormatBase(TUid aType): iType(aType) |
|
34 { |
|
35 } |
|
36 |
|
37 /** |
|
38 The type of the TFrameFormatBase subclass. |
|
39 |
|
40 @return The UID used to identify a specific subclass. |
|
41 */ |
|
42 EXPORT_C TUid TFrameFormatBase::Type() const |
|
43 { |
|
44 return iType; |
|
45 } |
|
46 |
|
47 // for future development |
|
48 EXPORT_C void TFrameFormatBase::Reserved1() |
|
49 { |
|
50 Panic(EReservedCall); |
|
51 } |
|
52 |
|
53 // for future development |
|
54 EXPORT_C void TFrameFormatBase::Reserved2() |
|
55 { |
|
56 Panic(EReservedCall); |
|
57 } |
|
58 |
|
59 // for future development |
|
60 EXPORT_C void TFrameFormatBase::Reserved3() |
|
61 { |
|
62 Panic(EReservedCall); |
|
63 } |
|
64 |
|
65 // for future development |
|
66 EXPORT_C void TFrameFormatBase::Reserved4() |
|
67 { |
|
68 Panic(EReservedCall); |
|
69 } |
|
70 |
|
71 /** |
|
72 Constructor for the TFrameFormat class. |
|
73 |
|
74 @param aFormatCode |
|
75 Unique UID specifying an image format code. The list of recognised formats is stored in file imageframeformats.hrh. |
|
76 |
|
77 @see imageframeformats.hrh |
|
78 @note If the format code is not recognised, the format code, colour space and sampling are initialised as KNullUid. |
|
79 */ |
|
80 EXPORT_C TFrameFormat::TFrameFormat(TUid aFormatCode):TFrameFormatBase(KUidIclImageFrameFormat), iFormatCode(aFormatCode) |
|
81 { |
|
82 switch(aFormatCode.iUid) |
|
83 { |
|
84 case KFormatYUVMonochromeUidValue: |
|
85 { |
|
86 iColourSpace = KUidColourSpaceYCbCr; |
|
87 iSampling = KUidSamplingMonochrome; |
|
88 break; |
|
89 } |
|
90 case KFormatYUV422InterleavedUidValue: |
|
91 case KFormatYUV422InterleavedReversedUidValue: |
|
92 case KFormatYYUV422InterleavedUidValue: |
|
93 case KFormatYUV422PlanarUidValue: |
|
94 { |
|
95 iColourSpace = KUidColourSpaceYCbCr; |
|
96 iSampling = KUidSamplingColor422; |
|
97 break; |
|
98 } |
|
99 case KFormatYUV420PlanarUidValue: |
|
100 case KFormatYUV420PlanarReversedUidValue: |
|
101 case KFormatYUV420SemiPlanarUidValue: |
|
102 case KFormatYUV420InterleavedUidValue: |
|
103 { |
|
104 iColourSpace = KUidColourSpaceYCbCr; |
|
105 iSampling = KUidSamplingColor420; |
|
106 break; |
|
107 } |
|
108 case KFormat16bitRGB444InterleavedUidValue: |
|
109 case KFormat16BitRGB565InterleavedUidValue: |
|
110 case KFormat32BitRGB888InterleavedUidValue: |
|
111 { |
|
112 iColourSpace = KUidColourSpaceRGB; |
|
113 iSampling = KUidSamplingColor444; |
|
114 break; |
|
115 } |
|
116 case KFormatYUV444InterleavedUidValue: |
|
117 case KFormatYUV444PlanarUidValue: |
|
118 { |
|
119 iColourSpace = KUidColourSpaceYCbCr; |
|
120 iSampling = KUidSamplingColor444; |
|
121 break; |
|
122 } |
|
123 default: |
|
124 { |
|
125 iFormatCode = KNullUid; |
|
126 iColourSpace = KNullUid; |
|
127 iSampling = KNullUid; |
|
128 } |
|
129 } |
|
130 } |
|
131 |
|
132 /** |
|
133 Creates an identical object to itself and places it on the heap. |
|
134 |
|
135 @return The pointer to the newly created object cast as its base class TFrameFormatBase. |
|
136 |
|
137 @leave KErrNoMemory. |
|
138 */ |
|
139 EXPORT_C TFrameFormatBase* TFrameFormat::DuplicateL() const |
|
140 { |
|
141 TFrameFormatBase* copy = new (ELeave) TFrameFormat(iFormatCode); |
|
142 return copy; |
|
143 } |
|
144 |
|
145 /** |
|
146 Returns the colour space for the TFrameFormat object. |
|
147 @note File imageframeconst.h contains the recognised colour space codes. |
|
148 These are named KUidColourSpaceXXX. |
|
149 |
|
150 @return The UID of the colour space. |
|
151 |
|
152 @see imageframeconst.h |
|
153 */ |
|
154 EXPORT_C TUid TFrameFormat::ColourSpace() const |
|
155 { |
|
156 return iColourSpace; |
|
157 } |
|
158 |
|
159 /** |
|
160 Returns the sampling format for the TFrameFormat object. |
|
161 @note File imageframeconst.h contains the recognised sampling codes. |
|
162 These are named KUidSamplingColorXXX. |
|
163 |
|
164 @return The UID of the sampling format. |
|
165 |
|
166 @see imageframeconst.h |
|
167 */ |
|
168 EXPORT_C TUid TFrameFormat::Sampling() const |
|
169 { |
|
170 return iSampling; |
|
171 } |
|
172 |
|
173 /** |
|
174 Returns the format code which uniquely identifies the TFrameFormat object. |
|
175 @note File imageframeconst.h contains the recognised format codes. |
|
176 These are named KUidFormatXXX. |
|
177 |
|
178 @return The UID of the format code. |
|
179 |
|
180 @see imageframeconst.h |
|
181 */ |
|
182 EXPORT_C TUid TFrameFormat::FormatCode() const |
|
183 { |
|
184 return iFormatCode; |
|
185 } |
|
186 |
|
187 /** |
|
188 Sets a new colour space. |
|
189 @note File imageframeconst.h contains the recognised colour space codes. |
|
190 These are named KUidColourSpaceXXX. |
|
191 |
|
192 @param aColourSpace |
|
193 The UID of the new colour space. |
|
194 |
|
195 @see imageframeconst.h |
|
196 */ |
|
197 EXPORT_C void TFrameFormat::SetColourSpace(TUid aColourSpace) |
|
198 { |
|
199 iColourSpace = aColourSpace; |
|
200 } |
|
201 |
|
202 /** |
|
203 Constructor for the TFrameLayoutBase class. |
|
204 |
|
205 @param aType |
|
206 The UID used to identify a specific layout class. |
|
207 It is used as a runtime identification of the particular subclass. |
|
208 */ |
|
209 EXPORT_C TFrameLayoutBase::TFrameLayoutBase(TUid aType): iType(aType) |
|
210 { |
|
211 } |
|
212 |
|
213 /** |
|
214 The type of the TFrameLayoutBase subclass. |
|
215 |
|
216 @return The UID used to identify a specific subclass. |
|
217 */ |
|
218 EXPORT_C TUid TFrameLayoutBase::Type() const |
|
219 { |
|
220 return iType; |
|
221 } |
|
222 |
|
223 // for future development |
|
224 EXPORT_C void TFrameLayoutBase::Reserved1() |
|
225 { |
|
226 Panic(EReservedCall); |
|
227 } |
|
228 |
|
229 // for future development |
|
230 EXPORT_C void TFrameLayoutBase::Reserved2() |
|
231 { |
|
232 Panic(EReservedCall); |
|
233 } |
|
234 |
|
235 // for future development |
|
236 EXPORT_C void TFrameLayoutBase::Reserved3() |
|
237 { |
|
238 Panic(EReservedCall); |
|
239 } |
|
240 |
|
241 // for future development |
|
242 EXPORT_C void TFrameLayoutBase::Reserved4() |
|
243 { |
|
244 Panic(EReservedCall); |
|
245 } |
|
246 |
|
247 /** |
|
248 Constructor for the TFrameLayout class. |
|
249 |
|
250 @param aPlanes |
|
251 The number of planes into which the image data is organised. |
|
252 It should be a positive integer less than or equal to KMaxPlanesInFrame |
|
253 (defined in imageframeconst.h). |
|
254 |
|
255 @panic EInvalidValue if the value of aPlanes is negative or greater than KMaxPlanesInFrame. |
|
256 @see imageframeconst.h |
|
257 */ |
|
258 EXPORT_C TFrameLayout::TFrameLayout(TInt aPlanes) : TFrameLayoutBase(KUidIclImageFrameLayout), iPlanes(aPlanes) |
|
259 { |
|
260 __ASSERT_ALWAYS((iPlanes >= 0) && (iPlanes <= KMaxPlanesInFrame), Panic(EInvalidValue)); |
|
261 } |
|
262 |
|
263 /** |
|
264 Creates an identical object to itself and places it on the heap. |
|
265 |
|
266 @return The pointer to the newly created object base class. |
|
267 |
|
268 @leave KErrNoMemory. |
|
269 */ |
|
270 EXPORT_C TFrameLayoutBase* TFrameLayout::DuplicateL() const |
|
271 { |
|
272 TFrameLayoutBase* copy = new (ELeave) TFrameLayout(iPlanes); |
|
273 |
|
274 CleanupStack::PushL(copy); |
|
275 // copy the contents of this one to the new instance |
|
276 Mem::Copy(copy, this, sizeof(TFrameLayout)); |
|
277 CleanupStack::Pop(); |
|
278 |
|
279 return copy; |
|
280 } |
|
281 |
|
282 /** |
|
283 Returns the number of planes in the current layout. |
|
284 |
|
285 @return The number of planes. |
|
286 */ |
|
287 EXPORT_C TInt TFrameLayout::Planes() const |
|
288 { |
|
289 return iPlanes; |
|
290 } |
|
291 |
|
292 /** |
|
293 Returns the start of a plane identified by its index. The value is the byte offset from the start |
|
294 of the CImageFrame object memory. |
|
295 |
|
296 @param aIndex |
|
297 The index of the plane. The value is non negative and must be less than the value |
|
298 returned by TFrameLayout::Planes(). |
|
299 |
|
300 @return The start position of the plane as a byte offset. |
|
301 @panic EInvalidIndex if the index is not in the allowed range. |
|
302 */ |
|
303 EXPORT_C TInt TFrameLayout::Start(TInt aIndex) const |
|
304 { |
|
305 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
306 return iStart[aIndex]; |
|
307 } |
|
308 |
|
309 /** |
|
310 Returns the maximum length in bytes of a specific plane. |
|
311 |
|
312 @param aIndex |
|
313 The index of the plane. The value is non negative and must be less than the value |
|
314 returned by TFrameLayout::Planes(). |
|
315 |
|
316 @return The maximum length of the plane in bytes. |
|
317 @panic EInvalidIndex if the index is not in the allowed range. |
|
318 */ |
|
319 EXPORT_C TInt TFrameLayout::Length(TInt aIndex) const |
|
320 { |
|
321 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
322 return iLength[aIndex]; |
|
323 } |
|
324 |
|
325 /** |
|
326 Returns the current length in bytes of a specific plane. |
|
327 |
|
328 @param aIndex |
|
329 The index of the plane. The value is non negative and must be less than the value |
|
330 returned by TFrameLayout::Planes(). |
|
331 |
|
332 @return The current length of the plane in bytes. |
|
333 @panic EInvalidIndex if the index is not in the allowed range. |
|
334 */ |
|
335 EXPORT_C TInt TFrameLayout::CurrentLength(TInt aIndex) const |
|
336 { |
|
337 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
338 return iCurrentLength[aIndex]; |
|
339 } |
|
340 |
|
341 /** |
|
342 Returns the scan length in bytes of a specific plane. |
|
343 |
|
344 @param aIndex |
|
345 The index of the plane. The value is non negative and must be less than the value |
|
346 returned by TFrameLayout::Planes(). |
|
347 |
|
348 @return The scan length of the plane in bytes. |
|
349 @panic EInvalidIndex if the index is not in the allowed range. |
|
350 */ |
|
351 EXPORT_C TInt TFrameLayout::ScanLength(TInt aIndex)const |
|
352 { |
|
353 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
354 return iScanLength[aIndex]; |
|
355 } |
|
356 |
|
357 /** |
|
358 Sets the start offset for a specific plane in the current layout. |
|
359 |
|
360 @param aIndex |
|
361 The index of the plane. The value is non negative and must be less than the value |
|
362 returned by TFrameLayout::Planes(). |
|
363 |
|
364 @param aStart |
|
365 The new start offset position in bytes. |
|
366 |
|
367 @panic EInvalidIndex if the index is not in the allowed range. |
|
368 @panic EInvalidValue if the value of aStart is negative. |
|
369 */ |
|
370 EXPORT_C void TFrameLayout::SetStart(TInt aIndex, TInt aStart) |
|
371 { |
|
372 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
373 __ASSERT_ALWAYS((aStart >= 0), Panic(EInvalidValue)); |
|
374 iStart[aIndex] = aStart; |
|
375 } |
|
376 |
|
377 /** |
|
378 Sets the maximum length of a specific plane in the current layout. |
|
379 |
|
380 @param aIndex |
|
381 The index of the plane. The value is non negative and must be less than the value |
|
382 returned by TFrameLayout::Planes(). |
|
383 |
|
384 @param aLength |
|
385 The new length in bytes. |
|
386 |
|
387 @panic EInvalidIndex if the index is not in the allowed range. |
|
388 @panic EInvalidValue if the value of aLength is negative. |
|
389 */ |
|
390 EXPORT_C void TFrameLayout::SetLength(TInt aIndex, TInt aLength) |
|
391 { |
|
392 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
393 __ASSERT_ALWAYS((aLength >= 0), Panic(EInvalidValue)); |
|
394 iLength[aIndex] = aLength; |
|
395 } |
|
396 |
|
397 /** |
|
398 Sets the current length for a specific plane in the current layout. |
|
399 |
|
400 @param aIndex |
|
401 The index of the plane. The value is non negative and must be less than the value |
|
402 returned by TFrameLayout::Planes(). |
|
403 |
|
404 @param aCurrentLength |
|
405 The new value for current length in bytes |
|
406 . |
|
407 @panic EInvalidIndex if the index is not in the allowed range. |
|
408 @panic EInvalidValue if the value of aCurrentLength is negative. |
|
409 */ |
|
410 EXPORT_C void TFrameLayout::SetCurrentLength(TInt aIndex, TInt aCurrentLength) |
|
411 { |
|
412 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
413 __ASSERT_ALWAYS((aCurrentLength >= 0), Panic(EInvalidValue)); |
|
414 iCurrentLength[aIndex] = aCurrentLength; |
|
415 } |
|
416 |
|
417 /** |
|
418 Set a new value for the scan length for a specific plane in the current layout. |
|
419 |
|
420 @param aIndex |
|
421 The index of the plane. The value is non negative and must be less than the value |
|
422 returned by TFrameLayout::Planes(). |
|
423 |
|
424 @param aScanLength |
|
425 The new value for the scan length of the plane in bytes. |
|
426 |
|
427 @panic EInvalidIndex if the index is not in the allowed range. |
|
428 @panic EInvalidValue if the value of aScanLength is negative. |
|
429 */ |
|
430 EXPORT_C void TFrameLayout::SetScanLength(TInt aIndex, TInt aScanLength) |
|
431 { |
|
432 __ASSERT_ALWAYS((aIndex >= 0) && (aIndex < iPlanes), Panic(EInvalidIndex)); |
|
433 __ASSERT_ALWAYS((aScanLength >= 0), Panic(EInvalidValue)); |
|
434 iScanLength[aIndex] = aScanLength; |
|
435 } |
|
436 |
|
437 /** |
|
438 Constructor for the CImageFrame class. |
|
439 */ |
|
440 EXPORT_C CImageFrame::CImageFrame() |
|
441 { |
|
442 } |
|
443 |
|
444 /** |
|
445 Destructor for the CImageFrame class. |
|
446 */ |
|
447 EXPORT_C CImageFrame::~CImageFrame() |
|
448 { |
|
449 delete iBody; |
|
450 } |
|
451 |
|
452 /** |
|
453 Returns the format of the CImageFrame object. |
|
454 |
|
455 @return A reference to a TFrameFormatBase object that describes the format of the CImageFrame object. |
|
456 */ |
|
457 EXPORT_C const TFrameFormatBase& CImageFrame::FrameFormat() const |
|
458 { |
|
459 return iBody->FrameFormat(); |
|
460 } |
|
461 |
|
462 /** |
|
463 Sets the format of the CImageFrame object. |
|
464 |
|
465 @param aFormat |
|
466 A reference to a TFrameFormatBase object that is used to set the format of the CImageFrame. |
|
467 |
|
468 @leave KErrNoMemory |
|
469 */ |
|
470 EXPORT_C void CImageFrame::SetFrameFormatL(const TFrameFormatBase& aFormat) |
|
471 { |
|
472 iBody->SetFrameFormatL(aFormat); |
|
473 } |
|
474 |
|
475 /** |
|
476 Returns the memory layout of the CImageFrame object. |
|
477 |
|
478 @return A reference to a TFrameLayoutBase object that describes the memory layout of the CImageFrame object. |
|
479 */ |
|
480 EXPORT_C const TFrameLayoutBase& CImageFrame::FrameLayout() const |
|
481 { |
|
482 return iBody->FrameLayout(); |
|
483 } |
|
484 |
|
485 /** |
|
486 Sets the layout of the CImageFrame object. |
|
487 |
|
488 @param aFrameLayout |
|
489 A reference to a TFrameLayoutBase object that is used to set the memory layout of the CImageFrame object. |
|
490 |
|
491 @leave KErrNoMemory |
|
492 */ |
|
493 EXPORT_C void CImageFrame::SetFrameLayoutL(const TFrameLayoutBase& aFrameLayout) |
|
494 { |
|
495 iBody->SetFrameLayoutL(aFrameLayout); |
|
496 } |
|
497 |
|
498 /** |
|
499 Returns the size in pixels of the image the CImageFrame refers to. |
|
500 @return The image size in pixels. |
|
501 */ |
|
502 EXPORT_C const TSize& CImageFrame::FrameSizeInPixels() const |
|
503 { |
|
504 return iBody->FrameSizeInPixels(); |
|
505 } |
|
506 |
|
507 /** |
|
508 Sets the size in pixels of the image CImageFrame refers to. |
|
509 |
|
510 @param aFrameSize |
|
511 A reference to a TSize object used to set the image size (in pixels) for the CImageFrame object. |
|
512 |
|
513 @panic EInvalidValue if the framesize value is invalid. |
|
514 */ |
|
515 EXPORT_C void CImageFrame::SetFrameSizeInPixels(const TSize& aFrameSize) |
|
516 { |
|
517 __ASSERT_ALWAYS((aFrameSize.iWidth >= 0) && (aFrameSize.iHeight >= 0), Panic(EInvalidValue)); |
|
518 iBody->SetFrameSizeInPixels(aFrameSize); |
|
519 } |
|
520 |
|
521 /** |
|
522 Returns a reference to the chunk encapsulated by the CImageFrame object. |
|
523 |
|
524 @note The function will panic if the object does not encapsulate an RChunk. Before calling this function |
|
525 call IsChunk() to check if the CImageFrame object encapsulates a chunk. |
|
526 |
|
527 @return A reference to the chunk. |
|
528 @panic EInvalidValue if the CImageFrame object does not encapsulate an RChunk. |
|
529 */ |
|
530 EXPORT_C RChunk& CImageFrame::DataChunk() |
|
531 { |
|
532 return iBody->DataChunk(); |
|
533 } |
|
534 |
|
535 /** |
|
536 Returns the offset at which the data for this frame starts. For CImageFrame |
|
537 objects encapsulating descriptors the offset is zero. |
|
538 |
|
539 @return The offset at which the data for this frame starts in bytes. |
|
540 */ |
|
541 EXPORT_C TInt CImageFrame::DataOffset() const |
|
542 { |
|
543 return iBody->DataOffset(); |
|
544 } |
|
545 |
|
546 /** |
|
547 Returns whether CImageFrame object encapsulates a chunk. |
|
548 |
|
549 @return ETrue if the CImageFrame object uses a chunk, otherwise EFalse. |
|
550 */ |
|
551 EXPORT_C TBool CImageFrame::IsChunk() const |
|
552 { |
|
553 return iBody->IsChunk(); |
|
554 } |
|
555 |
|
556 /** |
|
557 Provides a writeable TDes8 reference to the data buffer. The reference can be used for reading and writing the data. |
|
558 |
|
559 @return A writeable TDes8 reference to the data buffer. |
|
560 */ |
|
561 EXPORT_C TDes8& CImageFrame::Data() |
|
562 { |
|
563 return iBody->Data(); |
|
564 } |
|
565 |
|
566 /** |
|
567 Provides a TDesC8 reference to the data buffer. The reference can only be used for reading the data. |
|
568 |
|
569 @return A TDesC8 reference to the data buffer for reading only. |
|
570 */ |
|
571 EXPORT_C const TDesC8& CImageFrame::Data() const |
|
572 { |
|
573 return iBody->Data(); |
|
574 } |
|
575 |
|
576 /** |
|
577 Returns the maximum space reserved for this frame. |
|
578 |
|
579 @return The maximum space in bytes reserved for this frame. |
|
580 */ |
|
581 EXPORT_C TInt CImageFrame::MaxBufferSize() const |
|
582 { |
|
583 return iBody->MaxBufferSize(); |
|
584 } |
|
585 |
|
586 /** |
|
587 Factory function used to create a CImageFrame object encapsulating a descriptor. |
|
588 |
|
589 @param aBuffer |
|
590 A reference to the TDes8 object encapsulated by the CImageFrame object. |
|
591 |
|
592 @param aMaxBufferSize |
|
593 The maximum space in bytes reserved for this frame. |
|
594 |
|
595 @return A pointer to the newly created CImageFrame object. |
|
596 |
|
597 @leave KErrArgument |
|
598 @leave KErrNoMemory or other system wide error code. |
|
599 */ |
|
600 EXPORT_C CImageFrame* CImageFrame::NewL(const TDes8& aBuffer, |
|
601 TInt aMaxBufferSize) |
|
602 { |
|
603 CImageFrame* self = new(ELeave) CImageFrame(); |
|
604 CleanupStack::PushL(self); |
|
605 self->ConstructL(aBuffer, aMaxBufferSize); |
|
606 CleanupStack::Pop(); |
|
607 return self; |
|
608 } |
|
609 |
|
610 /** |
|
611 Factory function used to create a CImageFrame object encapsulating a descriptor. |
|
612 |
|
613 @param aBuffer |
|
614 A reference to the TDes8 object encapsulated by the CImageFrame object. |
|
615 |
|
616 @param aMaxBufferSize |
|
617 The maximum space in bytes reserved for this frame. |
|
618 |
|
619 @param aFrameSize |
|
620 A reference to a TSize object that defines the frame size in pixels of the CImageFrame object. |
|
621 |
|
622 @param aFrameFormat |
|
623 A reference to a TFrameFormatBase object that defines the format of the CImageFrame object. |
|
624 |
|
625 @param aFrameLayout |
|
626 A reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object. |
|
627 |
|
628 @return A pointer to the newly created CImageFrame object. |
|
629 |
|
630 @leave KErrArgument |
|
631 @leave KErrNoMemory or other system wide error code. |
|
632 */ |
|
633 EXPORT_C CImageFrame* CImageFrame::NewL(const TDes8& aBuffer, |
|
634 TInt aMaxBufferSize, |
|
635 const TSize& aFrameSize, |
|
636 const TFrameFormatBase& aFrameFormat, |
|
637 const TFrameLayoutBase& aFrameLayout) |
|
638 { |
|
639 CImageFrame* self = new(ELeave) CImageFrame(); |
|
640 CleanupStack::PushL(self); |
|
641 self->ConstructL(aBuffer, aMaxBufferSize, aFrameSize, aFrameFormat, aFrameLayout); |
|
642 CleanupStack::Pop(); |
|
643 return self; |
|
644 } |
|
645 |
|
646 /** |
|
647 Factory function used to create a CImageFrame object encapsulating a chunk. |
|
648 |
|
649 @param aBuffer |
|
650 A pointer to the RChunk object encapsulated by the CImageFrame object. |
|
651 |
|
652 @param aMaxBufferSize |
|
653 The maximum space in bytes reserved for this frame. |
|
654 |
|
655 @param aDataOffset |
|
656 The offset in bytes at which the data for this frame starts. |
|
657 |
|
658 @return A pointer to the newly created CImageFrame object. |
|
659 |
|
660 @leave KErrArgument |
|
661 @leave KErrNoMemory or other system wide error code. |
|
662 */ |
|
663 EXPORT_C CImageFrame* CImageFrame::NewL(const RChunk* aBuffer, |
|
664 TInt aMaxBufferSize, |
|
665 TInt aDataOffset) |
|
666 { |
|
667 CImageFrame* self = new(ELeave) CImageFrame(); |
|
668 CleanupStack::PushL(self); |
|
669 self->ConstructL(aBuffer, aMaxBufferSize, aDataOffset); |
|
670 CleanupStack::Pop(); |
|
671 return self; |
|
672 } |
|
673 |
|
674 /** |
|
675 Factory function used to create a CImageFrame object encapsulating a chunk. |
|
676 |
|
677 @param aBuffer |
|
678 A pointer to the RChunk object encapsulated by the CImageFrame object. |
|
679 |
|
680 @param aMaxBufferSize |
|
681 The maximum space in bytes reserved for this frame. |
|
682 |
|
683 @param aDataOffset |
|
684 The offset in bytes at which the data for this frame starts from the chunk start. |
|
685 |
|
686 @param aFrameSize |
|
687 A reference to a TSize object that defines the frame size in pixels of the CImageFrame object. |
|
688 |
|
689 @param aFrameFormat |
|
690 A reference to a TFrameFormatBase object that defines the format of the CImageFrame object. |
|
691 |
|
692 @param aFrameLayout |
|
693 A reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object. |
|
694 |
|
695 @return A pointer to the newly created CImageFrame object. |
|
696 |
|
697 @leave KErrArgument |
|
698 @leave KErrNoMemory or other system wide error code. |
|
699 */ |
|
700 EXPORT_C CImageFrame* CImageFrame::NewL(const RChunk* aBuffer, |
|
701 TInt aMaxBufferSize, |
|
702 TInt aDataOffset, |
|
703 const TSize& aFrameSize, |
|
704 const TFrameFormatBase& aFrameFormat, |
|
705 const TFrameLayoutBase& aFrameLayout) |
|
706 { |
|
707 CImageFrame* self = new(ELeave) CImageFrame(); |
|
708 CleanupStack::PushL(self); |
|
709 self->ConstructL(aBuffer, aMaxBufferSize, aDataOffset, aFrameSize, aFrameFormat, aFrameLayout); |
|
710 CleanupStack::Pop(); |
|
711 return self; |
|
712 } |
|
713 |
|
714 /** Function used to initialise a CImageFrame object encapsulating a chunk. |
|
715 |
|
716 @param aBuffer |
|
717 A pointer to the RChunk object encapsulated by the CImageFrame object. |
|
718 |
|
719 @param aMaxBufferSize |
|
720 The maximum space in bytes reserved for this frame. |
|
721 |
|
722 @param aDataOffset |
|
723 The offset in bytes at which the data for this frame starts from the chunk start. |
|
724 |
|
725 @param aFrameSize |
|
726 A reference to a TSize object that defines the frame size in pixels of the CImageFrame object. |
|
727 |
|
728 @param aFrameFormat |
|
729 A reference to a TFrameFormatBase object that defines the format of the CImageFrame object. |
|
730 |
|
731 @param aFrameLayout |
|
732 A reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object. |
|
733 |
|
734 @leave KErrArgument |
|
735 @leave KErrNoMemory or other system wide error code. |
|
736 */ |
|
737 EXPORT_C void CImageFrame::ConstructL(const RChunk* aBuffer, |
|
738 TInt aMaxBufferSize, |
|
739 TInt aDataOffset, |
|
740 const TSize& aFrameSize, |
|
741 const TFrameFormatBase& aFrameFormat, |
|
742 const TFrameLayoutBase& aFrameLayout) |
|
743 { |
|
744 iBody = CBody::NewL(*this, aBuffer, aMaxBufferSize, aDataOffset, aFrameSize, aFrameFormat, aFrameLayout); |
|
745 } |
|
746 |
|
747 /** |
|
748 Function used to initialise a CImageFrame object encapsulating a chunk. |
|
749 |
|
750 @param aBuffer |
|
751 A pointer to the RChunk object encapsulated by the CImageFrame object. |
|
752 |
|
753 @param aMaxBufferSize |
|
754 The maximum space in bytes reserved for this frame. |
|
755 |
|
756 @param aDataOffset |
|
757 The offset in bytes at which the data for this frame starts from the chunk start. |
|
758 |
|
759 @leave KErrArgument |
|
760 @leave KErrNoMemory or other system wide error code. |
|
761 */ |
|
762 EXPORT_C void CImageFrame::ConstructL(const RChunk* aBuffer, |
|
763 TInt aMaxBufferSize, |
|
764 TInt aDataOffset) |
|
765 { |
|
766 iBody = CBody::NewL(*this, aBuffer, aMaxBufferSize, aDataOffset); |
|
767 } |
|
768 |
|
769 |
|
770 /** |
|
771 Function used to initialise a CImageFrame object encapsulating a descriptor. |
|
772 |
|
773 @param aBuffer |
|
774 A reference to the TDes8 object encapsulated by the CImageFrame object. |
|
775 |
|
776 @param aMaxBufferSize |
|
777 The maximum space in bytes reserved for this frame. |
|
778 |
|
779 @param aFrameSize |
|
780 A reference to a TSize object that defines the frame size in pixels of the CImageFrame object. |
|
781 |
|
782 @param aFrameFormat |
|
783 A reference to a TFrameFormatBase object that defines the format of the CImageFrame object. |
|
784 |
|
785 @param aFrameLayout |
|
786 A reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object. |
|
787 |
|
788 @leave KErrArgument |
|
789 @leave KErrNoMemory or other system wide error code. |
|
790 */ |
|
791 EXPORT_C void CImageFrame::ConstructL(const TDes8& aBuffer, |
|
792 TInt aMaxBufferSize, |
|
793 const TSize& aFrameSize, |
|
794 const TFrameFormatBase& aFrameFormat, |
|
795 const TFrameLayoutBase& aFrameLayout) |
|
796 { |
|
797 iBody = CBody::NewL(*this, aBuffer, aMaxBufferSize, aFrameSize, aFrameFormat, aFrameLayout); |
|
798 } |
|
799 |
|
800 /** |
|
801 Function used to initialise a CImageFrame object encapsulating a descriptor. |
|
802 |
|
803 @param aBuffer |
|
804 A reference to the TDes8 object encapsulated by the CImageFrame object. |
|
805 |
|
806 @param aMaxBufferSize |
|
807 The maximum space in bytes reserved for this frame. |
|
808 |
|
809 @leave KErrArgument |
|
810 @leave KErrNoMemory or other system wide error code. |
|
811 */ |
|
812 EXPORT_C void CImageFrame::ConstructL(const TDes8& aBuffer, |
|
813 TInt aMaxBufferSize) |
|
814 { |
|
815 iBody = CBody::NewL(*this, aBuffer, aMaxBufferSize); |
|
816 } |
|
817 |
|
818 |
|
819 // for future development |
|
820 EXPORT_C void CImageFrame::Reserved1() |
|
821 { |
|
822 Panic(EReservedCall); |
|
823 } |
|
824 |
|
825 // for future development |
|
826 EXPORT_C void CImageFrame::Reserved2() |
|
827 { |
|
828 Panic(EReservedCall); |
|
829 } |
|
830 |
|
831 // for future development |
|
832 EXPORT_C void CImageFrame::Reserved3() |
|
833 { |
|
834 Panic(EReservedCall); |
|
835 } |
|
836 |
|
837 // for future development |
|
838 EXPORT_C void CImageFrame::Reserved4() |
|
839 { |
|
840 Panic(EReservedCall); |
|
841 } |
|
842 |