sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: */ sl@0: sl@0: #ifndef SGIMAGECOLLECTIONIMPL_H sl@0: #define SGIMAGECOLLECTIONIMPL_H sl@0: sl@0: #include "sgimagecollectionadapter.h" sl@0: #include "sgdriverimpl.h" sl@0: sl@0: sl@0: /** sl@0: @internalComponent sl@0: sl@0: An adapter object representing an image collection. Image collections are always sl@0: stored as surfaces. All the images in a collection have the same metadata, which sl@0: is stored at the beginning of the underlying memory chunk. sl@0: sl@0: If several image collections share a single memory chunk then the metadata is stored sl@0: in an array with as many elements as image collections, while the pixel data of sl@0: each image in any of the collections shares the surface buffer with the corresponding sl@0: images in the other collections. sl@0: */ sl@0: class XSgImageCollectionImpl: public XSgBase, public MSgImageCollectionAdapter sl@0: { sl@0: public: sl@0: static TInt New(XSgImageCollectionImpl*& aPtr, XSgDriverImpl& aDriverImpl, sl@0: const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached, sl@0: TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers, sl@0: TInt aMetaDataIndex = 0, const XSgImageCollectionImpl* aCollection = NULL); sl@0: ~XSgImageCollectionImpl(); sl@0: // From MSgResourceAdapter sl@0: void Close(); sl@0: // From MSgImageCollectionAdapter sl@0: const TSurfaceId& SurfaceId() const; sl@0: TInt GetInfo(TSgImageInfo& aInfo) const; sl@0: TInt Count() const; sl@0: TInt OpenImage(TInt aIndex, MSgDrawableAdapter*& aResult); sl@0: private: sl@0: inline XSgImageCollectionImpl(XSgDriverImpl& aDriverImpl); sl@0: TInt Construct(const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached, sl@0: TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers, sl@0: TInt aMetaDataIndex, const XSgImageCollectionImpl* aCollection); sl@0: private: sl@0: /** The surface identifier of the image collection. */ sl@0: TSurfaceId iSurfaceId; sl@0: /** The number of images in the collection. */ sl@0: TInt iCount; sl@0: /** Handle to the underlying memory chunk. */ sl@0: RChunk iDataChunk; sl@0: /** Index into the metadata array. */ sl@0: TInt iMetaDataIndex; sl@0: }; sl@0: sl@0: sl@0: #include "sgimagecollectionimpl.inl" sl@0: sl@0: sl@0: #endif // SGIMAGECOLLECTIONIMPL_H