📄 framebuf.h
字号:
/* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: $Hdr: framebuf.h,v 4.300 91/06/09 06:42:21 root Rel41 $ SONY * * @(#)framebuf.h 8.1 (Berkeley) 6/11/93 */#ifndef __FRAMEBUF__#define __FRAMEBUF__ 1typedef unsigned short Word;#define BitsPerWord 16typedef struct { short x, y;} sPoint;typedef struct { int x, y;} lPoint;typedef struct { sPoint origin; sPoint extent;} sRectangle;typedef struct { lPoint origin; lPoint extent;} lRectangle;typedef struct { char type; /* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */ char depth; /* bitmap depth */ unsigned short width; /* width in Words */ sRectangle rect; /* defined area */ Word *base; /* for BM_MEM */} sBitmap;typedef struct { char type; /* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */ char depth; /* bitmap depth */ unsigned short width; /* width in Words */ lRectangle rect; /* defined area */ Word *base; /* for BM_MEM */} lBitmap;#define BM_FB 0 /* frame buffer */#define BM_MEM 1 /* bitmap in memory (XY format) */#define BM_0 2 /* virtual bitmap of data '0' */#define BM_1 3 /* virtual bitmap of data '1' */#define BM_LBP 4 /* lbp page buffer (future support) *//* 2 operand bitblt */typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ sBitmap srcBitmap; /* source bitmap */ sRectangle srcRect; /* source rectangle */ sBitmap destBitmap; /* destination bitmap */ sRectangle destClip; /* clip rectangle */ sPoint destPoint; /* destination point */} sBitblt;typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ lBitmap srcBitmap; /* source bitmap */ lRectangle srcRect; /* source rectangle */ lBitmap destBitmap; /* destination bitmap */ lRectangle destClip; /* clip rectangle */ lPoint destPoint; /* destination point */} lBitblt;/* tile 2 operand bitblt */typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ sBitmap ptnBitmap; /* pattern bitmap */ sRectangle ptnRect; /* pattern rectangle */ sPoint refPoint; /* reference point */ sBitmap destBitmap; /* destination bitmap */ sRectangle destClip; /* clip rectangle */ sRectangle destRect; /* destination rectangle */} sTileBitblt;typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ lBitmap ptnBitmap; /* pattern bitmap */ lRectangle ptnRect; /* pattern rectangle */ lPoint refPoint; /* reference point */ lBitmap destBitmap; /* destination bitmap */ lRectangle destClip; /* clip rectangle */ lRectangle destRect; /* destination rectangle */} lTileBitblt;/* 3 operand bitblt */typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ sBitmap ptnBitmap; /* pattern bitmap */ sRectangle ptnRect; /* pattern rectangle */ sPoint refPoint; /* reference point */ sBitmap srcBitmap; /* source bitmap */ sRectangle srcRect; /* source rectangle */ sBitmap destBitmap; /* destination bitmap */ sRectangle destClip; /* clip rectangle */ sPoint destPoint; /* destination point */} sBitblt3;typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ lBitmap ptnBitmap; /* pattern bitmap */ lRectangle ptnRect; /* pattern rectangle */ lPoint refPoint; /* reference point */ lBitmap srcBitmap; /* source bitmap */ lRectangle srcRect; /* source rectangle */ lBitmap destBitmap; /* destination bitmap */ lRectangle destClip; /* clip rectangle */ lPoint destPoint; /* destination point */} lBitblt3;typedef struct { sRectangle srcRect; /* source rectangle */ sPoint destPoint; /* destination point */} sSrcDest;typedef struct { lRectangle srcRect; /* source rectangle */ lPoint destPoint; /* destination point */} lSrcDest;/* * batch bitblt */typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ sBitmap srcBitmap; /* source bitmap */ sBitmap destBitmap; /* destination bitmap */ sRectangle destClip; /* clip rectangle */ int nSrcDest; /* number of src-dest in list */ sSrcDest *srcDestList; /* pointer to src-dest spec */} sBatchBitblt;typedef struct { unsigned char func; /* function code */ char transp; /* transparency */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ lBitmap srcBitmap; /* source bitmap */ lBitmap destBitmap; /* destination bitmap */ lRectangle destClip; /* clip rectangle */ int nSrcDest; /* number of src-dest in list */ lSrcDest *srcDestList; /* pointer to src-dest spec */} lBatchBitblt;#define MAX_BATCHBITBLT 1024 /* max number in src-dest list *//* * set screen mode */#define BLACK_ON_WHITE 0 /* white - 0, black - 1 (default) */#define WHITE_ON_BLACK 1 /* white - 1, black - 0 *//* * graphic primitive drawing *//* scan line array */typedef struct { short y; short x0, x1; /* x0 <= x1 */} sScanl;typedef struct { int y; int x0, x1; /* x0 <= x1 */} lScanl;/* line */typedef struct { unsigned int lptn; /* line pattern */ short np; /* number of points */ sPoint *plist; /* point list */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ char dlpf; /* draw last point flag */ sRectangle clip; /* clip rectangle */ sBitmap drawBM; /* drawing bitmap */} sPrimLine;typedef struct { unsigned int lptn; /* line pattern */ short np; /* number of points */ lPoint *plist; /* point list */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ char dlpf; /* draw last point flag */ lRectangle clip; /* clip rectangle */ lBitmap drawBM; /* drawing bitmap */} lPrimLine;/* rectangle filling */typedef struct { sRectangle rect; /* rectangle */ sPoint refPoint; /* fill reference point */ sRectangle ptnRect; /* pattern rectangle */ sBitmap ptnBM; /* pattern bitmap */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ sRectangle clip; /* clip rectangle */ sBitmap drawBM; /* drawing bitmap */} sPrimRect;typedef struct { lRectangle rect; /* rectangle */ lPoint refPoint; /* fill reference point */ lRectangle ptnRect; /* pattern rectangle */ lBitmap ptnBM; /* pattern bitmap */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ lRectangle clip; /* clip rectangle */ lBitmap drawBM; /* drawing bitmap */} lPrimRect;/* pattern filling */typedef struct { short nscan; /* number of scan element */ sScanl *scan; /* scan line data */ sPoint refPoint; /* fill reference point */ sRectangle ptnRect; /* pattern rectangle */ sBitmap ptnBM; /* pattern bitmap */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ sRectangle clip; /* clip rectangle */ sBitmap drawBM; /* drawing bitmap */} sPrimFill;typedef struct { short nscan; /* number of scan element */ lScanl *scan; /* scan line data */ lPoint refPoint; /* fill reference point */ lRectangle ptnRect; /* pattern rectangle */ lBitmap ptnBM; /* pattern bitmap */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ lRectangle clip; /* clip rectangle */ lBitmap drawBM; /* drawing bitmap */} lPrimFill;/* marker */typedef struct { short np; /* number of points */ sPoint *plist; /* point list */ sRectangle ptnRect; /* pattern rectangle */ sBitmap ptnBM; /* pattern bitmap */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ sRectangle clip; /* clip rectangle */ sBitmap drawBM; /* drawing bitmap */} sPrimMarker;typedef struct { short np; /* number of points */ lPoint *plist; /* point list */ lRectangle ptnRect; /* pattern rectangle */ lBitmap ptnBM; /* pattern bitmap */ int fore_color; /* foreground color */ int aux_color; /* auxiliary color */ int planemask; /* select plane */ char transp; /* transparency */ unsigned char func; /* rop function code */ lRectangle clip; /* clip rectangle */ lBitmap drawBM; /* drawing bitmap */} lPrimMarker;/* text */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -