graphicsdeviceinterface/directgdiadaptation/cmnsrc/directgdiimageref.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef _DIRECTGDIIMAGEREF_H_
       
    17 #define _DIRECTGDIIMAGEREF_H_
       
    18 
       
    19 /** 
       
    20 @file
       
    21 @internalComponent
       
    22  */
       
    23 
       
    24 #include "directgdidrawableref.h"
       
    25 #include <graphics/sgimage.h>
       
    26 
       
    27 
       
    28 /**
       
    29 Class to allow an RSgImage to be created and used by CDirectGdiImageTargetImpl
       
    30 and CDirectGdiImageSourceImpl.
       
    31 
       
    32 @internalComponent
       
    33  */
       
    34 NONSHARABLE_CLASS(CDirectGdiImageRef) : public CDirectGdiDrawableRef
       
    35 {
       
    36 public:
       
    37 	virtual ~CDirectGdiImageRef();
       
    38 	inline const TSize& Size() const;
       
    39 	inline const TUidPixelFormat& PixelFormat() const;
       
    40 	inline const RSgImage& Image() const;
       
    41 	
       
    42 protected:
       
    43 	CDirectGdiImageRef();
       
    44 	virtual TInt Construct(const RSgImage& aSgImage);
       
    45 
       
    46 protected:
       
    47 	RSgImage iSgImage;
       
    48 	
       
    49 private:
       
    50 	TBool iSgImageOpen;
       
    51 	TSize iImageSize;	
       
    52 	TUidPixelFormat iImagePixelFormat;
       
    53 };
       
    54 
       
    55 /** 
       
    56 @return The size of the RSgImage.
       
    57  */
       
    58 inline const TSize& CDirectGdiImageRef::Size() const
       
    59 	{ 
       
    60 	return iImageSize; 
       
    61 	}
       
    62 
       
    63 /** 
       
    64 @return The pixel format of the RSgImage.
       
    65  */
       
    66 inline const TUidPixelFormat& CDirectGdiImageRef::PixelFormat() const
       
    67 	{ 
       
    68 	return iImagePixelFormat; 
       
    69 	}
       
    70 
       
    71 /**
       
    72 @return A const reference to the RSgImage contained in this class.
       
    73  */
       
    74 inline const RSgImage& CDirectGdiImageRef::Image() const
       
    75 	{ 
       
    76 	return iSgImage; 
       
    77 	}
       
    78 
       
    79 #endif // _DIRECTGDIIMAGEREF_H_