sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@internalComponent
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
|
sl@0
|
21 |
#ifndef SGIMAGECOLLECTIONIMPL_H
|
sl@0
|
22 |
#define SGIMAGECOLLECTIONIMPL_H
|
sl@0
|
23 |
|
sl@0
|
24 |
#include "sgimagecollectionadapter.h"
|
sl@0
|
25 |
#include "sgdriverimpl.h"
|
sl@0
|
26 |
|
sl@0
|
27 |
|
sl@0
|
28 |
/**
|
sl@0
|
29 |
@internalComponent
|
sl@0
|
30 |
|
sl@0
|
31 |
An adapter object representing an image collection. Image collections are always
|
sl@0
|
32 |
stored as surfaces. All the images in a collection have the same metadata, which
|
sl@0
|
33 |
is stored at the beginning of the underlying memory chunk.
|
sl@0
|
34 |
|
sl@0
|
35 |
If several image collections share a single memory chunk then the metadata is stored
|
sl@0
|
36 |
in an array with as many elements as image collections, while the pixel data of
|
sl@0
|
37 |
each image in any of the collections shares the surface buffer with the corresponding
|
sl@0
|
38 |
images in the other collections.
|
sl@0
|
39 |
*/
|
sl@0
|
40 |
class XSgImageCollectionImpl: public XSgBase, public MSgImageCollectionAdapter
|
sl@0
|
41 |
{
|
sl@0
|
42 |
public:
|
sl@0
|
43 |
static TInt New(XSgImageCollectionImpl*& aPtr, XSgDriverImpl& aDriverImpl,
|
sl@0
|
44 |
const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached,
|
sl@0
|
45 |
TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers,
|
sl@0
|
46 |
TInt aMetaDataIndex = 0, const XSgImageCollectionImpl* aCollection = NULL);
|
sl@0
|
47 |
~XSgImageCollectionImpl();
|
sl@0
|
48 |
// From MSgResourceAdapter
|
sl@0
|
49 |
void Close();
|
sl@0
|
50 |
// From MSgImageCollectionAdapter
|
sl@0
|
51 |
const TSurfaceId& SurfaceId() const;
|
sl@0
|
52 |
TInt GetInfo(TSgImageInfo& aInfo) const;
|
sl@0
|
53 |
TInt Count() const;
|
sl@0
|
54 |
TInt OpenImage(TInt aIndex, MSgDrawableAdapter*& aResult);
|
sl@0
|
55 |
private:
|
sl@0
|
56 |
inline XSgImageCollectionImpl(XSgDriverImpl& aDriverImpl);
|
sl@0
|
57 |
TInt Construct(const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached,
|
sl@0
|
58 |
TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers,
|
sl@0
|
59 |
TInt aMetaDataIndex, const XSgImageCollectionImpl* aCollection);
|
sl@0
|
60 |
private:
|
sl@0
|
61 |
/** The surface identifier of the image collection. */
|
sl@0
|
62 |
TSurfaceId iSurfaceId;
|
sl@0
|
63 |
/** The number of images in the collection. */
|
sl@0
|
64 |
TInt iCount;
|
sl@0
|
65 |
/** Handle to the underlying memory chunk. */
|
sl@0
|
66 |
RChunk iDataChunk;
|
sl@0
|
67 |
/** Index into the metadata array. */
|
sl@0
|
68 |
TInt iMetaDataIndex;
|
sl@0
|
69 |
};
|
sl@0
|
70 |
|
sl@0
|
71 |
|
sl@0
|
72 |
#include "sgimagecollectionimpl.inl"
|
sl@0
|
73 |
|
sl@0
|
74 |
|
sl@0
|
75 |
#endif // SGIMAGECOLLECTIONIMPL_H
|