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

📄 abl_colors.h

📁 在sharp 404开发板的串口测试代码
💻 H
字号:
/***********************************************************************
 * $Workfile:   abl_colors.h  $
 * $Revision:   1.0  $
 * $Author:   WellsK  $
 * $Date:   Jun 09 2003 12:02:12  $
 *
 * Project: Color definitions
 *
 * Description:
 *     This package contains functions for color mapping, color
 *     conversion, and common defines.
 *
 *     The palette table function can be configured for 555 or 565
 *     color.
 *
 * Notes:
 *     Color entries are stored in BGR format, with blue mapped to the
 *     most significant bits of a color type.
 *
 * Revision History:
 * $Log:   //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/abl/include/abl_colors.h-arc  $
 * 
 *    Rev 1.0   Jun 09 2003 12:02:12   WellsK
 * Initial revision.
 * 
 *
 ***********************************************************************
 * SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
 * OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
 * AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES, 
 * SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
 *
 * SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY 
 * FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A 
 * SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
 * FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
 *
 * COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
 *     CAMAS, WA
 **********************************************************************/
 
#ifndef ABL_COLOR_TYPES_H
#define ABL_COLOR_TYPES_H

#ifdef __cplusplus
#if __cplusplus
extern "C"
{
#endif
#endif

#include "abl_types.h"

/***********************************************************************
 * Default configuration values
 **********************************************************************/

/* Pick the appropriate define for 8- or 16-bit color modes. Only ONE
   of these lines should be uncommented */
#ifndef COLORS_DEF
/*#define COLORS_DEF 16 */    /* 16-bit 565 color mode */
#define COLORS_DEF 15    /* 15-bit 555 color mode */
/*#define COLORS_DEF 8 */     /* 8-bit color mode */
#endif

/* If COLORS_8 is used, then uncomment the following line to use 565
   output mode in the palette table, otherwise 555 mode will be used */
/*#define COLORS_8_565_MODE */

#if COLORS_DEF == 16
/* Black color, 565 mode */
#define BLACK         0x0000
/* Light gray color, 565 mode */
#define LIGHTGRAY     0X7BEF
/* Dark gray color, 565 mode */
#define DARKGRAY      0x39E7
/* White color, 565 mode */
#define WHITE         0x7fff
/* Red color, 565 mode */
#define RED           0xF800
/* Green color, 565 mode */
#define GREEN         0x07E0
/* Blue color, 565 mode */
#define BLUE          0x001F
/* Magenta color, 565 mode */
#define MAGENTA       (RED | BLUE)
/* Cyan color, 565 mode */
#define CYAN          (GREEN | BLUE)
/* Yellow color, 565 mode */
#define YELLOW        (RED | GREEN)
/* Light red color, 565 mode */
#define LIGHTRED      0x7800
/* Light green color, 565 mode */
#define LIGHTGREEN    0x03E0
/* Light blue color, 565 mode */
#define LIGHTBLUE     0x000F
/* Light magenta color, 565 mode */
#define LIGHTMAGENTA  (LIGHTRED | LIGHTBLUE)
/* Light cyan color, 565 mode */
#define LIGHTCYAN     (LIGHTGREEN | LIGHTBLUE)
/* Light yellow color, 565 mode */
#define LIGHTYELLOW   (LIGHTRED | LIGHTGREEN)

/* Red color mask, 565 mode */
#define REDMASK       0xF800
/* Red shift value, 565 mode */
#define REDSHIFT      11
/* Green color mask, 565 mode */
#define GREENMASK     0x07E0
/* Green shift value, 565 mode */
#define GREENSHIFT    5
/* Blue color mask, 565 mode */
#define BLUEMASK      0x001F
/* Blue shift value, 565 mode */
#define BLUESHIFT     0

/* Number of colors in 565 mode */
#define NUM_COLORS    65536
/* Number of red colors in 565 mode */
#define RED_COLORS    0x20
/* Number of green colors in 565 mode */
#define GREEN_COLORS  0x40
/* Number of blue colors in 565 mode */
#define BLUE_COLORS   0x20

/* Color type is a 16-bit value */
typedef UNS_16 COLOR_T;
#endif

#if COLORS_DEF == 15
/* Black color, 555 mode */
#define BLACK         0x0000
/* Llight gray color, 555 mode */
#define LIGHTGRAY     0x3DEF
/* Drak gray color, 555 mode */
#define DARKGRAY      0x1CE7
/* White color, 555 mode */
#define WHITE         0x7fff
/* Red color, 555 mode */
#define RED           0x7C00
/* Green color, 555 mode */
#define GREEN         0x03E0
/* Blue color, 555 mode */
#define BLUE          0x001F
/* Magenta color, 555 mode */
#define MAGENTA       (RED | BLUE)
/* Cyan color, 555 mode */
#define CYAN          (GREEN | BLUE)
/* Yellow color, 555 mode */
#define YELLOW        (RED | GREEN)
/* Light red color, 555 mode */
#define LIGHTRED      0x3C00
/* Light green color, 555 mode */
#define LIGHTGREEN    0x01E0
/* Light blue color, 555 mode */
#define LIGHTBLUE     0x000F
/* Light magenta color, 555 mode */
#define LIGHTMAGENTA  (LIGHTRED | LIGHTBLUE)
/* Light cyan color, 555 mode */
#define LIGHTCYAN     (LIGHTGREEN | LIGHTBLUE)
/* Light yellow color, 555 mode */
#define LIGHTYELLOW   (LIGHTRED | LIGHTGREEN)

/* Red color mask, 555 mode */
#define REDMASK       0x7C00
/* Red shift value, 555 mode */
#define REDSHIFT      10
/* Green color mask, 555 mode */
#define GREENMASK     0x03E0
/* Green shift value, 555 mode */
#define GREENSHIFT    5
/* Blue color mask, 555 mode */
#define BLUEMASK      0x001F
/* Blue shift value, 555 mode */
#define BLUESHIFT     0

/* Number of colors in 555 mode */
#define NUM_COLORS    32768
/* Number of red colors in 555 mode */
#define RED_COLORS    0x20
/* Number of green colors in 555 mode */
#define GREEN_COLORS  0x20
/* Number of blue colors in 555 mode */
#define BLUE_COLORS   0x20

/* Color type is a 16-bit value */
typedef UNS_16 COLOR_T;
#endif

#if COLORS_DEF == 8
/* Black color, 323 mode */
#define BLACK         0x00
/* Light gray color, 323 mode */
#define LIGHTGRAY     0x6E
/* Dark gray color, 323 mode */
#define DARKGRAY      0x25
/* White color, 323 mode */
#define WHITE         0xFF
/* Red color, 323 mode */
#define RED           0xE0
/* Green color, 323 mode */
#define GREEN         0x1C
/* Blue color, 323 mode */
#define BLUE          0x03
/* Magenta color, 323 mode */
#define MAGENTA       (RED | BLUE)
/* Cyan color, 323 mode */
#define CYAN          (GREEN | BLUE)
/* Yellow color, 323 mode */
#define YELLOW        (RED | GREEN)
/* Light red color, 323 mode */
#define LIGHTRED      0x60
/* Light green color, 323 mode */
#define LIGHTGREEN    0x0C
/* Light blue color, 323 mode */
#define LIGHTBLUE     0x01
/* Light magenta color, 323 mode */
#define LIGHTMAGENTA  (LIGHTRED | LIGHTBLUE)
/* Light cyan color, 323 mode */
#define LIGHTCYAN     (LIGHTGREEN | LIGHTBLUE)
/* Light yellow color, 323 mode */
#define LIGHTYELLOW   (LIGHTRED | LIGHTGREEN)

/* Red color mask, 323 mode */
#define REDMASK       0xE0
/* Red shift value, 323 mode */
#define REDSHIFT      5
/* Green color mask, 323 mode */
#define GREENMASK     0x1C
/* Green shift value, 323 mode */
#define GREENSHIFT    2
/* Blue color mask, 323 mode */
#define BLUEMASK      0x3
/* Blue shift value, 323 mode */
#define BLUESHIFT     0

/* Number of colors in 332 mode */
#define NUM_COLORS    256
/* Number of red colors in 332 mode */
#define RED_COLORS    0x08
/* Number of green colors in 332 mode */
#define GREEN_COLORS  0x08
/* Number of blue colors in 332 mode */
#define BLUE_COLORS   0x08

/* Color type is a 8-bit value */
typedef UNS_8 COLOR_T;
#endif

/***********************************************************************
 * Color configuration functions
 **********************************************************************/

/* Generate a palette table (only in 8-bit mode). If compiled in 16-bit
   color mode, this will be a NULL function. */
void colors_set_palette(UNS_16 *palette_table);

#ifdef __cplusplus
}
#endif

#endif /* ABL_COLOR_TYPES_H */

⌨️ 快捷键说明

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