graphicsresourceservices/graphicsresource/inc/sgimageadapter.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 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @prototype
       
    20 */
       
    21 
       
    22 #ifndef SGIMAGEADAPTER_H
       
    23 #define SGIMAGEADAPTER_H
       
    24 
       
    25 #include <graphics/sgresourceadapter.h>
       
    26 #include <graphics/sgimage.h>
       
    27 
       
    28 
       
    29 /**
       
    30 @publishedPartner
       
    31 @prototype
       
    32 @deprecated
       
    33 
       
    34 This interface must be implemented by all the user-side objects in the adaptation
       
    35 layer of the Graphics subsystem which are referenced by instances of RSgImage.
       
    36 The interface between the user-side and the kernel-side parts of the adaptation
       
    37 layer is outside the scope of the specification of the Graphics Resource API.
       
    38 
       
    39 @see RSgImage
       
    40 */
       
    41 class MSgImageAdapter: public MSgDrawableAdapter
       
    42 	{
       
    43 public:
       
    44 	/**
       
    45 	@publishedPartner
       
    46 	@prototype
       
    47 	@deprecated
       
    48 
       
    49 	Retrieves the values of the attributes of the image represented by this adapter
       
    50 	object.
       
    51 
       
    52 	@param aInfo On input, the globally unique identifiers of the user-defined
       
    53 	       attributes to be retrieved from the image, if any. On return, the values
       
    54 	       of the attributes of the image and the values of the selected user-defined
       
    55 	       attributes.
       
    56 	@pre If aInfo.iUserAttributes is not null then it points to an array of
       
    57 	     aInfo.iUserAttributeCount elements with globally unique identifiers
       
    58 	     corresponding to user-defined attributes attached to the image.
       
    59 	@return KErrNone if successful.
       
    60 	@return KErrNotFound if any of the user-defined attributes to be retrieved from
       
    61 	        the image cannot be found.
       
    62 	@see RSgImage::GetInfo()
       
    63 	*/
       
    64 	virtual TInt GetInfo(TSgImageInfo& aInfo) const = 0;
       
    65 	/**
       
    66 	@publishedPartner
       
    67 	@prototype
       
    68 	@deprecated
       
    69 
       
    70 	Temporarily makes the pixel data of the image represented by this adapter object
       
    71 	accessible for reading by the CPU.
       
    72 
       
    73 	@param aDataAddress On return, the base address of the pixel data in the address
       
    74 	       space of the calling process.
       
    75 	@param aDataStride On return, the number of bytes between rows of the pixel data.
       
    76 	@pre The image is not mapped yet.
       
    77 	@pre The image was created with CPU access ESgCpuAccessReadOnly or
       
    78 	     ESgCpuAccessReadWrite.
       
    79 	@pre The image was created by the calling process.
       
    80 	@post The pixel data of the image is directly accessible in the address space
       
    81 	      of the calling process for reading only, until Unmap() is called.
       
    82 	@return KErrNone if successful.
       
    83 	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
       
    84 	@return KErrAccessDenied if the image was not created with CPU access
       
    85 	        ESgCpuAccessReadOnly or ESgCpuAccessReadWrite.
       
    86 	@return KErrPermissionDenied if the image was created by another process.
       
    87 	@return KErrNoMemory if there is not enough system memory.
       
    88 	@see RSgImage::MapReadOnly()
       
    89 	*/
       
    90 	virtual TInt MapReadOnly(const TAny*& aDataAddress, TInt& aDataStride) = 0;
       
    91 	/**
       
    92 	@publishedPartner
       
    93 	@prototype
       
    94 	@deprecated
       
    95 
       
    96 	Temporarily makes the pixel data of the image represented by this adapter object
       
    97 	accessible for writing by the CPU.
       
    98 
       
    99 	@param aDataAddress On return, the base address of the pixel data in the address
       
   100 	       space of the calling process.
       
   101 	@param aDataStride On return, the number of bytes between rows of the pixel data.
       
   102 	@pre The image is not mapped yet.
       
   103 	@pre The image was created with CPU access ESgCpuAccessWriteOnly or
       
   104 	     ESgCpuAccessReadWrite.
       
   105 	@pre The image was created by the calling process.
       
   106 	@post The pixel data of the image is directly accessible in the address space
       
   107 	      of the calling process for writing only, until Unmap() is called.
       
   108 	@return KErrNone if successful.
       
   109 	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
       
   110 	@return KErrAccessDenied if the image was not created with CPU access
       
   111 	        ESgCpuAccessWriteOnly or ESgCpuAccessReadWrite.
       
   112 	@return KErrPermissionDenied if the image was created by another process.
       
   113 	@return KErrNoMemory if there is not enough system memory.
       
   114 	@see RSgImage::MapWriteOnly()
       
   115 	*/
       
   116 	virtual TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride) = 0;
       
   117 	/**
       
   118 	@publishedPartner
       
   119 	@prototype
       
   120 	@deprecated
       
   121 
       
   122 	Temporarily makes the pixel data of the image represented by this adapter object
       
   123 	accessible for reading and writing by the CPU.
       
   124 
       
   125 	@param aDataAddress On return, the base address of the pixel data in the address
       
   126 	       space of the calling process.
       
   127 	@param aDataStride On return, the number of bytes between rows of the pixel data.
       
   128 	@pre The image is not mapped yet.
       
   129 	@pre The image was created with CPU access ESgCpuAccessReadWrite.
       
   130 	@pre The image was created by the calling process.
       
   131 	@post The pixel data of the image is directly accessible in the address space
       
   132 	      of the calling process for reading and writing, until Unmap() is called.
       
   133 	@return KErrNone if successful.
       
   134 	@return KErrInUse if the image is already mapped or in exclusive use by the GPU.
       
   135 	@return KErrAccessDenied if the image was not created with CPU access
       
   136 	        ESgCpuAccessReadWrite.
       
   137 	@return KErrPermissionDenied if the image was created by another process.
       
   138 	@return KErrNoMemory if there is not enough system memory.
       
   139 	@see RSgImage::MapReadWrite()
       
   140 	*/
       
   141 	virtual TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride) = 0;
       
   142 	/**
       
   143 	@publishedPartner
       
   144 	@prototype
       
   145 	@deprecated
       
   146 
       
   147 	Makes the pixel data of the image represented by this adapter object no longer
       
   148 	accessible by the CPU.
       
   149 
       
   150 	@pre The image is mapped for CPU access by a previous call to MapReadOnly(),
       
   151 	     MapWriteOnly() or MapReadWrite().
       
   152 	@post The GPU is guaranteed to be able to get access to the image.
       
   153 	@post The address range in the calling process used for the mapping is no longer
       
   154 	      valid.
       
   155 	@return KErrNone if successful.
       
   156 	@return KErrGeneral if the image was not mapped for CPU access.
       
   157 	@see RSgImage::Unmap()
       
   158 	*/
       
   159 	virtual TInt Unmap() = 0;
       
   160 	};
       
   161 
       
   162 
       
   163 #endif // SGIMAGEADAPTER_H