os/graphics/graphicsresourceservices/graphicsresourceadaptation/inc/sgimagecollectionimpl.h
Update contrib.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef SGIMAGECOLLECTIONIMPL_H
22 #define SGIMAGECOLLECTIONIMPL_H
24 #include "sgimagecollectionadapter.h"
25 #include "sgdriverimpl.h"
31 An adapter object representing an image collection. Image collections are always
32 stored as surfaces. All the images in a collection have the same metadata, which
33 is stored at the beginning of the underlying memory chunk.
35 If several image collections share a single memory chunk then the metadata is stored
36 in an array with as many elements as image collections, while the pixel data of
37 each image in any of the collections shares the surface buffer with the corresponding
38 images in the other collections.
40 class XSgImageCollectionImpl: public XSgBase, public MSgImageCollectionAdapter
43 static TInt New(XSgImageCollectionImpl*& aPtr, XSgDriverImpl& aDriverImpl,
44 const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached,
45 TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers,
46 TInt aMetaDataIndex = 0, const XSgImageCollectionImpl* aCollection = NULL);
47 ~XSgImageCollectionImpl();
48 // From MSgResourceAdapter
50 // From MSgImageCollectionAdapter
51 const TSurfaceId& SurfaceId() const;
52 TInt GetInfo(TSgImageInfo& aInfo) const;
54 TInt OpenImage(TInt aIndex, MSgDrawableAdapter*& aResult);
56 inline XSgImageCollectionImpl(XSgDriverImpl& aDriverImpl);
57 TInt Construct(const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached,
58 TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers,
59 TInt aMetaDataIndex, const XSgImageCollectionImpl* aCollection);
61 /** The surface identifier of the image collection. */
62 TSurfaceId iSurfaceId;
63 /** The number of images in the collection. */
65 /** Handle to the underlying memory chunk. */
67 /** Index into the metadata array. */
72 #include "sgimagecollectionimpl.inl"
75 #endif // SGIMAGECOLLECTIONIMPL_H