os/graphics/graphicsresourceservices/graphicsresourceadaptation/inc/sgimagecollectionimpl.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresourceadaptation/inc/sgimagecollectionimpl.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,75 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @internalComponent
    1.22 +*/
    1.23 +
    1.24 +#ifndef SGIMAGECOLLECTIONIMPL_H
    1.25 +#define SGIMAGECOLLECTIONIMPL_H
    1.26 +
    1.27 +#include "sgimagecollectionadapter.h"
    1.28 +#include "sgdriverimpl.h"
    1.29 +
    1.30 +
    1.31 +/**
    1.32 +@internalComponent
    1.33 +
    1.34 +An adapter object representing an image collection. Image collections are always
    1.35 +stored as surfaces. All the images in a collection have the same metadata, which
    1.36 +is stored at the beginning of the underlying memory chunk.
    1.37 +
    1.38 +If several image collections share a single memory chunk then the metadata is stored
    1.39 +in an array with as many elements as image collections, while the pixel data of
    1.40 +each image in any of the collections shares the surface buffer with the corresponding
    1.41 +images in the other collections.
    1.42 +*/
    1.43 +class XSgImageCollectionImpl: public XSgBase, public MSgImageCollectionAdapter
    1.44 +	{
    1.45 +public:
    1.46 +	static TInt New(XSgImageCollectionImpl*& aPtr, XSgDriverImpl& aDriverImpl,
    1.47 +	                const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached,
    1.48 +	                TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers,
    1.49 +	                TInt aMetaDataIndex = 0, const XSgImageCollectionImpl* aCollection = NULL);
    1.50 +	~XSgImageCollectionImpl();
    1.51 +	// From MSgResourceAdapter
    1.52 +	void Close();
    1.53 +	// From MSgImageCollectionAdapter
    1.54 +	const TSurfaceId& SurfaceId() const;
    1.55 +	TInt GetInfo(TSgImageInfo& aInfo) const;
    1.56 +	TInt Count() const;
    1.57 +	TInt OpenImage(TInt aIndex, MSgDrawableAdapter*& aResult);
    1.58 +private:
    1.59 +	inline XSgImageCollectionImpl(XSgDriverImpl& aDriverImpl);
    1.60 +	TInt Construct(const TSgImageInfo& aInfo, TInt aImageCount, TBool aIsCached,
    1.61 +	               TInt aStride, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers,
    1.62 +	               TInt aMetaDataIndex, const XSgImageCollectionImpl* aCollection);
    1.63 +private:
    1.64 +	/** The surface identifier of the image collection. */
    1.65 +	TSurfaceId iSurfaceId;
    1.66 +	/** The number of images in the collection. */
    1.67 +	TInt iCount;
    1.68 +	/** Handle to the underlying memory chunk. */
    1.69 +	RChunk iDataChunk;
    1.70 +	/** Index into the metadata array. */
    1.71 +	TInt iMetaDataIndex;
    1.72 +	};
    1.73 +
    1.74 +
    1.75 +#include "sgimagecollectionimpl.inl"
    1.76 +
    1.77 +
    1.78 +#endif // SGIMAGECOLLECTIONIMPL_H