⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pvr2d.h

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 H
字号:
/**************************************************************************
 * Name         : pvr2d.h
 * Author       : Vlad Stamate
 * Created      : 19/10/2001
 *
 * Copyright    : 1999 by VideoLogic Limited. All rights reserved.
 *              : No part of this software, either material or conceptual 
 *              : may be copied or distributed, transmitted, transcribed,
 *              : stored in a retrieval system or translated into any 
 *              : human or computer language in any form by any means,
 *              : electronic, mechanical, manual or other-wise, or 
 *              : disclosed to third parties without the express written
 *              : permission of VideoLogic Limited, Unit 8, HomePark
 *              : Industrial Estate, King's Langley, Hertfordshire,
 *              : WD4 8LZ, U.K.
 *
 * Platform     : ANSI
 * Description	: Header file for the PVR2D library
 *
 * Modifications:-
 * $Log: pvr2d.h $
 *
 *  --- Revision Logs Removed --- 
 *
 *  --- Revision Logs Removed --- 
 *
 *  --- Revision Logs Removed --- 
 *
 *  --- Revision Logs Removed --- 
 * 
 *  --- Revision Logs Removed --- 
 *
 ***************************************************************************/


#ifndef _PVR2D_H_
#define _PVR2D_H_

#include "img_defs.h"

#ifdef __cplusplus
extern "C" {
#endif 



typedef enum
{
	PVR2D_OK = 0,
	PVR2DERROR_INVALID_PARAMETER = -1,
	PVR2DERROR_NOT_MASTER = -2,
	PVR2DERROR_DEVICE_UNAVAILABLE = -3,
	PVR2DERROR_INVALID_CONTEXT = -4,
	PVR2DERROR_MEMORY_UNAVAILABLE = -5,
	PVR2DERROR_DEVICE_NOT_PRESENT = -6,
	PVR2DERROR_IOCTL_ERROR = -7,
	PVR2DERROR_GENERIC_ERROR = -8,
	PVR2DERROR_BLT_NOTCOMPLETE = -9
}PVR2DERROR;

typedef enum
{
    PVR2D_RGB565 = 16,
    PVR2D_RGB888PACKED = 24,
    PVR2D_RGB888UNPACKED = 32,
    PVR2D_VGAEMU = 0
}PVR2DBITDETPH;

typedef enum
{
    PVR2D_FB_PRIMARY_SURFACE = 0,
    PVR2D_FB_FLIP_SURFACE,
    PVR2D_HOST_UNCACHED
}PVR2DMEMTYPE;

typedef enum
{
    PVR2D_VSYNC_ON,
    PVR2D_VSYNC_OFF
}PVR2DVSYNC;

typedef enum
{
    PVR2D_MIFLAG_WRAPPED = 0,
    PVR2D_MIFLAG_ALLOCATED = 1,
    PVR2D_MIFLAG_PIXMAP = 2,
    PVR2D_MIFLAG_SYSTEM_OWNED = 4 /* frame buffer */

}PVR2DMIFLAGS;

typedef struct _PVR2DMEMINFO
{
	void			*pBase;
	unsigned long	ui32MemSize;
	unsigned long	ui32DevAddr;
	void			*psMemInfo;
	
	int		flags;			/* 1 : allocated (or wrapped)
							   2 : pixmap (or raw mem) */
	
	/* The following are valid only when flags indicates pixmap */
	
	unsigned long ui32SurfaceStride;
	unsigned int uiDisplayMode;
	unsigned int uiBPP;    
	unsigned int uiWidth;
	unsigned int uiHeight;
}PVR2DMEMINFO, *PPVR2DMEMINFO;

typedef struct _PVR2DDEVICEINFO
{
	IMG_UINT32 ui32DevId;
	IMG_UINT32 /*PVRSRV_DEVICE_TYPE*/	eDeviceType;
}PVR2DDEVICEINFO, *PPVR2DDEVICEINFO;

typedef struct _PVR2DBLTINFO
{
    unsigned long	CopyCode;
    unsigned long	Colour;
    unsigned long	ColourKey;

	PVR2DMEMINFO	*pSrcMemInfo;
    unsigned long	SrcOffset;
    long			SrcStride, SrcX, SrcY;

	PVR2DMEMINFO	*pDstMemInfo;
    unsigned long	DstOffset;
    long			DstStride, DstX, DstY;
    
    PVR2DMEMINFO	*pMaskMemInfo;
    unsigned long 	MaskOffset;

    long			SizeX,SizeY,DSizeX,DSizeY;

    unsigned long	SrcDepth, DstDepth;

}PVR2DBLTINFO, *PPVR2DBLTINFO;

typedef struct _PVR2DCLIPRECT
{
	long topleftX, topleftY;
	long bottomrightX, bottomrightY;
} PVR2DCLIPRECT;

#define MAKE_COPY_BLIT(src,soff,dest,doff,sx,sy,dx,dy,sz)

typedef void* PVR2DCONTEXTHANDLE;

/* different flags for blting */

#define PVR2DROPPAT_MASK   0xC0000000
#define PVR2DROPPAT_SOLID  0x80000000
#define PVR2DROPPAT_MONO   0x40000000 /* MONO pCtx->Colour[0,1] pattern */
#define PVR2DROPPAT_COL    0xC0000000 /* Same format 8x8 colour pattern */

#define PVR2DROPSRC_MASK   0x30000000 /* MONO transparent source = mask */
#define PVR2DROPSRC_MONO   0x20000000 /* MONO pCtx->Colour[0,1] source  */
#define PVR2DROPSRC_COL    0x10000000 /* Same format full-colour source */

#define PVR2DROPDST_MASK   0x0C000000
#define PVR2DROPDST_BPP16  0x04000000 /*   5:6:5   R:G:B destination    */
#define PVR2DROPDST_BPP24  0x08000000 /*   8:8:8   R:G:B destination    */
#define PVR2DROPDST_BPP32  0x0C000000 /* 8:8:8:8 x:R:G:B destination    */

#define PVR2DROP3_MASK     0x00FF
#define PVR2DROP3_PATMASK  0x00F0
#define PVR2DROP3_SRCMASK  0x00CC
#define PVR2DROP3_DSTMASK  0x00AA

#define PVR2DROP3( Pat, Src, Dst, ROp3 )  \
                 ((Pat) | (Src) | (Dst) | (((ROp3) & PVR2DROP3_MASK ) << 8 ) |  \
	         	 ((ROp3) & PVR2DROP3_MASK ))
#define PVR2D2DCOL_BPP8( Col )   (((Col) & 0x0000FF) + 0x00000000)
#define PVR2D2DCOL_RGB555( Col ) (((Col) & 0x00FFFF) + 0x04000000)
#define PVR2D2DCOL_RGB565( Col ) (((Col) & 0x00FFFF) + 0x04000000)
#define PVR2D2DCOL_TRUE( Col )   (((Col) & 0xFFFFFF) + 0x08000000)
#define PVR2DPAT_ROT_MASK 7


/* flags for memory */
#define PVR2D_GLOBALMEM 1

/* context type */
#define PVR2D_CONTEXT_INDIVIDUAL 0

/* device type */
#define PVR2D_DEVICE_TYPE_MBX1        0
#define PVR2D_DEVICE_TYPE_MBX1_LITE   1


/* Functions that the library exports */

int IMG_CALLCONV PVR2DEnumerateDevices (PVR2DDEVICEINFO *pDevInfo);

PVR2DERROR IMG_CALLCONV PVR2DCreateDeviceContext (int DevID,PVR2DCONTEXTHANDLE* phContext,unsigned head_number, unsigned flags);

PVR2DERROR IMG_CALLCONV PVR2DDestroyDeviceContext (PVR2DCONTEXTHANDLE hContext);

PVR2DERROR IMG_CALLCONV PVR2DMemAlloc (PVR2DCONTEXTHANDLE hContext, unsigned long Bytes, 
			  unsigned long Align, int Heap, PPVR2DMEMINFO *ppsMemInfo);

PVR2DERROR IMG_CALLCONV PVR2DMemAllocPixmap (PVR2DCONTEXTHANDLE hContext, unsigned long uFmt, 
              unsigned long uWidth, unsigned long uHeight, unsigned long AlignMask, int Heap, PPVR2DMEMINFO *ppsMemInfo);


PVR2DERROR IMG_CALLCONV PVR2DMemFree (PVR2DCONTEXTHANDLE hContext, PVR2DMEMINFO *psMemInfo);

PVR2DERROR IMG_CALLCONV PVR2DSetScreenMode (PVR2DCONTEXTHANDLE hContext, int ColourDepth, 
			       long Width, long Height, long Stride, int RefreshRate);

PVR2DERROR IMG_CALLCONV PVR2DGetScreenMode (PVR2DCONTEXTHANDLE hContext, int *ColourDepth, 
			       long *Width, long *Height, long *Stride, int *RefreshRate);

PVR2DERROR IMG_CALLCONV PVR2DGetFrameBuffer (PVR2DCONTEXTHANDLE hContext,int Heap, PPVR2DMEMINFO *ppsMemInfo);

PVR2DERROR IMG_CALLCONV PVR2DPresentBlt (PVR2DCONTEXTHANDLE hContext);

PVR2DERROR IMG_CALLCONV PVR2DBlt (PVR2DCONTEXTHANDLE hContext, PVR2DBLTINFO *pBlitInfo);

PVR2DERROR IMG_CALLCONV PVR2DBltClipped (PVR2DCONTEXTHANDLE hContext, PVR2DBLTINFO *pBltInfo, long uNumClipRects, PVR2DCLIPRECT *pClipRects);

PVR2DMEMINFO * IMG_CALLCONV PVR2DGetContextMemInfo(PVR2DCONTEXTHANDLE hContext);

#ifdef __cplusplus
}
#endif 


#endif /* _PVR2D_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -