graph.h

来自「代码有点长,需细心阅读,仅供影音视听类产品的开发人员参考」· C头文件 代码 · 共 89 行

H
89
字号
#ifndef __GRAPH_H
#define __GRAPH_H

#include "osdfont.h"

//#define     BIGA            0
#define     BIGA            0
#define     NUM0            26
#define     ARROW           0
#define     HAND            1
#define     DOT             36
#define     SPACE           37
#define     NEXT            38
#define     PREV            39
#define     QUESTION        40
#define     PERCENT         41
#define     LEFTB           42
#define     RIGHTB          43
#define     COLON           44
#define     BLINE           45
#define     CURV            46

#define swap_luma(x)    (((x)&0xffe7) | (((x)&0x0008)<<1) | (((x)&0x0010)>>1))
#define swap_chroma(x)  (((x)&0xffe6) | (((x)&0x0008)<<1) | (((x)&0x0010)>>1))

#include "memmap.h"
#if CONFIG==CONFIG_COMBO_SVCD
#define BASE_LUMA   (regs0->ref0_luma)
#ifdef SUPPORT_JPG_DOUBLE_BUFFER
#define BASE_LUMA_1 (MP3_REF1_LUMA_DEF)
#endif
#else
#define BASE_LUMA   (regs0->ref0_luma)
#endif

#define BASE_CHROMA (regs0->ref0_chroma)
#ifdef SUPPORT_JPG_DOUBLE_BUFFER
#define BASE_CHROMA_1   (regs0->ref1_chroma)
#endif

#define OFFSET_LUMA (BASE_LUMA   * 1024)
#define OFFSET_CHROMA   (BASE_CHROMA * 1024)
#define OFFSET_CHROMA_1   (BASE_CHROMA_1 * 1024)

#define OFFSET_Y(Y) (OFFSET_LUMA   + (Y)*LINE_OFFSET)
#define OFFSET_C(Y) (OFFSET_CHROMA + ((Y)/2)*LINE_OFFSET)
#define OFFSET_C1(Y) (OFFSET_CHROMA_1 + ((Y)/2)*LINE_OFFSET)

#if CONFIG==CONFIG_COMBO_SVCD
#define LINE_OFFSET 1024                /* for LUMA */
#ifdef SUPPORT_ESP
#ifdef SUPPORT_ESP_VIDEO_ON
#define Y_XY(X,Y)   ((BYTE *)  (SDRAM_BASE | OFFSET_Y(Y) | swap_luma(X)))
#define C_XY(X,Y)   ((UINT16 *)(SDRAM_BASE | OFFSET_C(Y) | swap_chroma(X)))
#define C1_XY(X,Y)  ((UINT16 *)(SDRAM_BASE | OFFSET_C1(Y) | swap_chroma(X)))
#else   /* NOT SUPPORT_ESP_VIDEO_ON */
#define Y_XY(X,Y)  (BYTE *)(SDRAM_BASE)
#define C_XY(X,Y)  (UINT16 *)(SDRAM_BASE)
#define C1_XY(X,Y)  (UINT16 *)(SDRAM_BASE)
#endif /*SUPPORT_ESP_VIDEO_ON */
#else   /* NOT SUPPORT_ESP */
#define Y_XY(X,Y)   ((BYTE *)  (SDRAM_BASE | OFFSET_Y(Y) | swap_luma(X)))
#define C_XY(X,Y)   ((UINT16 *)(SDRAM_BASE | OFFSET_C(Y) | swap_chroma(X)))
#define C1_XY(X,Y)  ((UINT16 *)(SDRAM_BASE | OFFSET_C1(Y) | swap_chroma(X)))
#endif /* SUPPORT_ESP */
#else
#define LINE_OFFSET 352                 /* for LUMA */
#define Y_XY(X,Y)   ((BYTE *)  (SDRAM_BASE + OFFSET_Y(Y) + (X)         ))
#define C_XY(X,Y)   ((UINT16 *)(SDRAM_BASE + OFFSET_C(Y) + ((X)&0xfffe)))
#define C1_XY(X,Y)  ((UINT16 *)(SDRAM_BASE + OFFSET_C1(Y) + ((X)&0xfffe)))
#endif

void    setColor(UINT32);
void    plotXY(int, int);
void    drawLine(int SX, int SY, int EX, int EY);
void    drawBlock(int x, int y);

extern const BYTE **graph_font;

#define setFont(f)  (graph_font=f)

#if 0
int drawString(int x, int y, const char *s)
#endif
//int     drawChar(int, int, UINT32);
         void drawString(int x, int y, const char *s);
         void drawChar(int x, int y, BYTE c /*, BYTE iY, UINT16 iCbCr */ );
#endif/*__GRAPH_H*/

⌨️ 快捷键说明

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