📄 directfb_stub.h
字号:
/*****************************************************************************
******************************************************************************
** **
** Copyright (c) 2006 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
******************************************************************************
*****************************************************************************/
/**
* @file directfb_stub.h
*
* $Revision: 1.11 $
*
* DirectFB interface stub
*
*/
#ifndef __DIRECTFB_STUB_H
#define __DIRECTFB_STUB_H
typedef unsigned char __u8;
/*********************************************************************************************************************
* LGPL OPEN SOURCE CODE
* (taken from directfb.h, removed interface macro wrappers)
*
* (c) Copyright 2000-2002 convergence integrated media GmbH.
(c) Copyright 2002-2004 convergence GmbH.
All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org> and
Ville Syrj�l� <syrjala@sci.fi>.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*
*********************************************************************************************************************/
#define DFB_DISPLAYLAYER_IDS_MAX 256
typedef enum {
DFB_OK, /* No error occured. */
DFB_FAILURE, /* A general or unknown error occured. */
DFB_INIT, /* A general initialization error occured. */
DFB_BUG, /* Internal bug or inconsistency has been detected. */
DFB_DEAD, /* Interface has a zero reference counter (available in debug mode). */
DFB_UNSUPPORTED, /* The requested operation or an argument is (currently) not supported. */
DFB_UNIMPLEMENTED, /* The requested operation is not implemented, yet. */
DFB_ACCESSDENIED, /* Access to the resource is denied. */
DFB_INVARG, /* An invalid argument has been specified. */
DFB_NOSYSTEMMEMORY, /* There's not enough system memory. */
DFB_NOVIDEOMEMORY, /* There's not enough video memory. */
DFB_LOCKED, /* The resource is (already) locked. */
DFB_BUFFEREMPTY, /* The buffer is empty. */
DFB_FILENOTFOUND, /* The specified file has not been found. */
DFB_IO, /* A general I/O error occured. */
DFB_BUSY, /* The resource or device is busy. */
DFB_NOIMPL, /* No implementation for this interface or content type has been found. */
DFB_MISSINGFONT, /* No font has been set. */
DFB_TIMEOUT, /* The operation timed out. */
DFB_MISSINGIMAGE, /* No image has been set. */
DFB_THIZNULL, /* 'thiz' pointer is NULL. */
DFB_IDNOTFOUND, /* No resource has been found by the specified id. */
DFB_INVAREA, /* An invalid area has been specified or detected. */
DFB_DESTROYED, /* The underlying object (e.g. a window or surface) has been destroyed. */
DFB_FUSION, /* Internal fusion error detected, most likely related to IPC resources. */
DFB_BUFFERTOOLARGE, /* Buffer is too large. */
DFB_INTERRUPTED, /* The operation has been interrupted. */
DFB_NOCONTEXT, /* No context available. */
DFB_TEMPUNAVAIL, /* Temporarily unavailable. */
DFB_LIMITEXCEEDED, /* Attempted to exceed limit, i.e. any kind of maximum size, count etc. */
DFB_NOSUCHMETHOD, /* Requested method is not known to remote site. */
DFB_NOSUCHINSTANCE, /* Requested instance is not known to remote site. */
DFB_ITEMNOTFOUND, /* No such item found. */
DFB_VERSIONMISMATCH,/* Some versions didn't match. */
DFB_NOSHAREDMEMORY, /* There's not enough shared memory. */
DFB_EOF /* Reached end of file. */
} DFBResult;
typedef enum {
DLSCL_SHARED = 0, /* shared access */
DLSCL_EXCLUSIVE, /* exclusive access,
fullscreen/mode switching */
DLSCL_ADMINISTRATIVE /* administrative access,
enumerate windows, control them */
} DFBDisplayLayerCooperativeLevel;
typedef struct {
__u8 a; /* alpha channel */
__u8 r; /* red channel */
__u8 g; /* green channel */
__u8 b; /* blue channel */
} DFBColor;
typedef unsigned int DFBDisplayLayerID;
typedef enum {
DLCONF_NONE = 0x00000000,
DLCONF_WIDTH = 0x00000001,
DLCONF_HEIGHT = 0x00000002,
DLCONF_PIXELFORMAT = 0x00000004,
DLCONF_BUFFERMODE = 0x00000008,
DLCONF_OPTIONS = 0x00000010,
DLCONF_SOURCE = 0x00000020,
DLCONF_SURFACE_CAPS = 0x00000040,
DLCONF_ALL = 0x0000007F
} DFBDisplayLayerConfigFlags;
#define DFB_SURFACE_PIXELFORMAT( index, color_bits, alpha_bits, has_alpha, \
row_bits, row_bytes, align, mul_f, mul_d, \
has_lut, inv_alpha ) \
( (((index ) & 0x7F) ) | \
(((color_bits) & 0x1F) << 7) | \
(((alpha_bits) & 0x0F) << 12) | \
(((has_alpha ) ? 1 :0) << 16) | \
(((row_bits ) & 0x07) << 17) | \
(((row_bytes ) & 0x07) << 20) | \
(((align ) & 0x07) << 23) | \
(((mul_f ) & 0x03) << 26) | \
(((mul_d ) & 0x03) << 28) | \
(((has_lut ) ? 1 :0) << 30) | \
(((inv_alpha ) ? 1 :0) << 31) )
typedef enum {
DSPF_UNKNOWN = 0x00000000, /* unknown or unspecified format */
/* 16 bit ARGB (2 byte, alpha 1@15, red 5@10, green 5@5, blue 5@0) */
DSPF_ARGB1555 = DFB_SURFACE_PIXELFORMAT( 0, 15, 1, 1, 0, 2, 0, 0, 0, 0, 0 ),
/* 16 bit RGB (2 byte, red 5@11, green 6@5, blue 5@0) */
DSPF_RGB16 = DFB_SURFACE_PIXELFORMAT( 1, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),
/* 24 bit RGB (3 byte, red 8@16, green 8@8, blue 8@0) */
DSPF_RGB24 = DFB_SURFACE_PIXELFORMAT( 2, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0 ),
/* 24 bit RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0) */
DSPF_RGB32 = DFB_SURFACE_PIXELFORMAT( 3, 24, 0, 0, 0, 4, 0, 0, 0, 0, 0 ),
/* 32 bit ARGB (4 byte, alpha 8@24, red 8@16, green 8@8, blue 8@0) */
DSPF_ARGB = DFB_SURFACE_PIXELFORMAT( 4, 24, 8, 1, 0, 4, 0, 0, 0, 0, 0 ),
/* 8 bit alpha (1 byte, alpha 8@0), e.g. anti-aliased glyphs */
DSPF_A8 = DFB_SURFACE_PIXELFORMAT( 5, 0, 8, 1, 0, 1, 0, 0, 0, 0, 0 ),
/* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
DSPF_YUY2 = DFB_SURFACE_PIXELFORMAT( 6, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),
/* 8 bit RGB (1 byte, red 3@5, green 3@2, blue 2@0) */
DSPF_RGB332 = DFB_SURFACE_PIXELFORMAT( 7, 8, 0, 0, 0, 1, 0, 0, 0, 0, 0 ),
/* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
DSPF_UYVY = DFB_SURFACE_PIXELFORMAT( 8, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),
/* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size U/V planes) */
DSPF_I420 = DFB_SURFACE_PIXELFORMAT( 9, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),
/* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size V/U planes) */
DSPF_YV12 = DFB_SURFACE_PIXELFORMAT( 10, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),
/* 8 bit LUT (8 bit color and alpha lookup from palette) */
DSPF_LUT8 = DFB_SURFACE_PIXELFORMAT( 11, 8, 0, 1, 0, 1, 0, 0, 0, 1, 0 ),
/* 8 bit ALUT (1 byte, alpha 4@4, color lookup 4@0) */
DSPF_ALUT44 = DFB_SURFACE_PIXELFORMAT( 12, 4, 4, 1, 0, 1, 0, 0, 0, 1, 0 ),
/* 32 bit ARGB (4 byte, inv. alpha 8@24, red 8@16, green 8@8, blue 8@0) */
DSPF_AiRGB = DFB_SURFACE_PIXELFORMAT( 13, 24, 8, 1, 0, 4, 0, 0, 0, 0, 1 ),
/* 1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */
DSPF_A1 = DFB_SURFACE_PIXELFORMAT( 14, 0, 1, 1, 1, 0, 7, 0, 0, 0, 0 ),
/* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) */
DSPF_NV12 = DFB_SURFACE_PIXELFORMAT( 15, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),
/* 16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) */
DSPF_NV16 = DFB_SURFACE_PIXELFORMAT( 16, 24, 0, 0, 0, 1, 0, 0, 1, 0, 0 ),
/* 16 bit ARGB (2 byte, alpha 2@14, red 5@9, green 5@4, blue 4@0) */
DSPF_ARGB2554 = DFB_SURFACE_PIXELFORMAT( 17, 14, 2, 1, 0, 2, 0, 0, 0, 0, 0 ),
/* 16 bit ARGB (2 byte, alpha 4@12, red 4@8, green 4@4, blue 4@0) */
DSPF_ARGB4444 = DFB_SURFACE_PIXELFORMAT( 18, 12, 4, 1, 0, 2, 0, 0, 0, 0, 0 ),
/* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane) */
DSPF_NV21 = DFB_SURFACE_PIXELFORMAT( 19, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -