本文整理汇总了C++中set_palette函数的典型用法代码示例。如果您正苦于以下问题:C++ set_palette函数的具体用法?C++ set_palette怎么用?C++ set_palette使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_palette函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: init_palette
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* 0:崟 */
0xff, 0x00, 0x00, /* 1:柧傞偄愒 */
0x00, 0xff, 0x00, /* 2:柧傞偄椢 */
0xff, 0xff, 0x00, /* 3:柧傞偄墿怓 */
0x00, 0x00, 0xff, /* 4:柧傞偄惵 */
0xff, 0x00, 0xff, /* 5:柧傞偄巼 */
0x00, 0xff, 0xff, /* 6:柧傞偄悈怓 */
0xff, 0xff, 0xff, /* 7:敀 */
0xc6, 0xc6, 0xc6, /* 8:柧傞偄奃怓 */
0x84, 0x00, 0x00, /* 9:埫偄愒 */
0x00, 0x84, 0x00, /* 10:埫偄椢 */
0x84, 0x84, 0x00, /* 11:埫偄墿怓 */
0x00, 0x00, 0x84, /* 12:埫偄惵 */
0x84, 0x00, 0x84, /* 13:埫偄巼 */
0x00, 0x84, 0x84, /* 14:埫偄悈怓 */
0x84, 0x84, 0x84 /* 15:埫偄奃怓 */
};
unsigned char table2[216 * 3];
int r, g, b;
set_palette(0, 15, table_rgb);
for (b = 0; b < 6; b++) {
for (g = 0; g < 6; g++) {
for (r = 0; r < 6; r++) {
table2[(r + g * 6 + b * 36) * 3 + 0] = r * 51;
table2[(r + g * 6 + b * 36) * 3 + 1] = g * 51;
table2[(r + g * 6 + b * 36) * 3 + 2] = b * 51;
}
}
}
set_palette(16, 231, table2);
return;
}
开发者ID:AnqiYang,项目名称:operating-system,代码行数:35,代码来源:graphic.c
示例2: init_palette
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* 0:흑 */
0xff, 0x00, 0x00, /* 1:밝은 빨강 */
0x00, 0xff, 0x00, /* 2:밝은 초록 */
0xff, 0xff, 0x00, /* 3:밝은 황색 */
0x00, 0x00, 0xff, /* 4:밝은 파랑 */
0xff, 0x00, 0xff, /* 5:밝은 보라색 */
0x00, 0xff, 0xff, /* 6:밝은 물색 */
0xff, 0xff, 0xff, /* 7:흰색 */
0xc6, 0xc6, 0xc6, /* 8:밝은 회색 */
0x84, 0x00, 0x00, /* 9:어두운 빨강 */
0x00, 0x84, 0x00, /* 10:어두운 초록 */
0x84, 0x84, 0x00, /* 11:어두운 황색 */
0x00, 0x00, 0x84, /* 12:어두운 파랑 */
0x84, 0x00, 0x84, /* 13:어두운 보라색 */
0x00, 0x84, 0x84, /* 14:어두운 물색 */
0x84, 0x84, 0x84 /* 15:어두운 회색 */
};
unsigned char table2[216 * 3];
int r, g, b;
set_palette(0, 15, table_rgb);
for (b = 0; b < 6; b++) {
for (g = 0; g < 6; g++) {
for (r = 0; r < 6; r++) {
table2[(r + g * 6 + b * 36) * 3 + 0] = r * 51;
table2[(r + g * 6 + b * 36) * 3 + 1] = g * 51;
table2[(r + g * 6 + b * 36) * 3 + 2] = b * 51;
}
}
}
set_palette(16, 231, table2);
return;
}
开发者ID:barmi,项目名称:bxos,代码行数:35,代码来源:graphic.c
示例3: init_palette
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* 0:黒 */
0xff, 0x00, 0x00, /* 1:明るい赤 */
0x00, 0xff, 0x00, /* 2:明るい緑 */
0xff, 0xff, 0x00, /* 3:明るい黄色 */
0x00, 0x00, 0xff, /* 4:明るい青 */
0xff, 0x00, 0xff, /* 5:明るい紫 */
0x00, 0xff, 0xff, /* 6:明るい水色 */
0xff, 0xff, 0xff, /* 7:白 */
0xc6, 0xc6, 0xc6, /* 8:明るい灰色 */
0x84, 0x00, 0x00, /* 9:暗い赤 */
0x00, 0x84, 0x00, /* 10:暗い緑 */
0x84, 0x84, 0x00, /* 11:暗い黄色 */
0x00, 0x00, 0x84, /* 12:暗い青 */
0x84, 0x00, 0x84, /* 13:暗い紫 */
0x00, 0x84, 0x84, /* 14:暗い水色 */
0x84, 0x84, 0x84 /* 15:暗い灰色 */
};
unsigned char table2[216 * 3];
int r, g, b;
set_palette(0, 15, table_rgb);
for (b = 0; b < 6; b++) {
for (g = 0; g < 6; g++) {
for (r = 0; r < 6; r++) {
table2[(r + g * 6 + b * 36) * 3 + 0] = r * 51;
table2[(r + g * 6 + b * 36) * 3 + 1] = g * 51;
table2[(r + g * 6 + b * 36) * 3 + 2] = b * 51;
}
}
}
set_palette(16, 231, table2);
return;
}
开发者ID:FuDesign2008,项目名称:mess,代码行数:35,代码来源:graphic.c
示例4: logos_render
/**
* Renders the output of the logos handler's current game state.
*
* The drawing routines are all blocking, meaning one "frame" is enough
* to fade all logos in and out.
*/
void logos_render(BITMAP *buffer) {
// We're going to draw text on top of the image,
// so add the text palette to the image.
add_flim_palette_colors(LOGOS_DAT[ASLOGO_PALETTE].dat);
// Display the main logo with text drawn on top.
set_palette(black_palette);
blit(LOGOS_DAT[ASLOGO_IMG].dat, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
draw_text(screen, 160, 154, TXT_WHITE, -1, -1,
TXT_REGULAR, TXT_CENTER, "(C) 2016, Avalanche Studios");
draw_text(screen, 160, 154 + FLIM_HEIGHT + 2, TXT_WHITE, -1, -1,
TXT_REGULAR, TXT_CENTER, "www.avalanchestudios.net");
if (DEBUG) {
draw_text(screen, 160, 154 + FLIM_HEIGHT + 18, TXT_GRAY, -1, -1,
TXT_SMALL, TXT_CENTER, (char *)get_short_version());
}
fade_from(black_palette, LOGOS_DAT[ASLOGO_PALETTE].dat, FADE_SPEED);
// Wait for any key, then draw the second logo.
readkey();
fade_out(FADE_SPEED);
set_palette(black_palette);
blit(LOGOS_DAT[TEST_IMG].dat, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
fade_from(black_palette, LOGOS_DAT[TEST_PALETTE].dat, FADE_SPEED);
// Wait for any key, then finish. This handler immediately exits
// after running the logos_render() function once, so this code
// is guaranteed to only run once.
readkey();
fade_out(FADE_SPEED);
}
开发者ID:msikma,项目名称:ceegee,代码行数:37,代码来源:logos.c
示例5: main
void main()
{
BITMAP bmp;
int i;
load_bmp("mset.bmp",&bmp); /* open the file */
set_mode(VGA_256_COLOR_MODE); /* set the video mode. */
set_palette(bmp.palette); /* set the palette */
draw_bitmap(&bmp, /* draw the bitmap centered */
(SCREEN_WIDTH-bmp.width) >>1,
(SCREEN_HEIGHT-bmp.height) >>1);
wait(25);
for(i=0;i<510;i++) /* rotate the palette at 30hz */
{
wait_for_retrace();
wait_for_retrace();
rotate_palette(bmp.palette);
}
wait(25);
free(bmp.data); /* free up memory used */
set_mode(TEXT_MODE); /* set the video mode back to
text mode. */
return;
}
开发者ID:pjmodi,项目名称:projects,代码行数:33,代码来源:palette.c
示例6: select_language
/* Pops a dialog asking for language. Returns -1 if no object was selected.
* Else returns zero and writes in string the ID of the selected language.
*/
void select_language(void)
{
int f = -1;
const char *lang = "en"; /* default language */
set_palette(desktop_palette);
clear_bitmap(virtual_screen);
stretch_virtual_screen();
_retrieve_available_languages();
if (!_num_available_languages) {
//alert("No languages", "to choose from!", "Will use english", "Oh", 0, 'o', 0);
goto finish;
}
while ((f = virtual_do_dialog(_select_lang_dialog, 0)) < 0);
lang = _available_languages[_select_lang_dialog[0].d1*2];
finish:
TRACE("select_language: '%s'\n", lang);
set_config_string("system", "language", lang);
reload_config_texts(0);
text_mode(-1);
_free_available_languages();
clear_bitmap(virtual_screen);
stretch_virtual_screen();
}
开发者ID:gradha,项目名称:multitet,代码行数:31,代码来源:langsel.c
示例7: init_palette
/*
palette maps int and rgb color, we defined 16 colors, needs to be written to cpus
*/
void init_palette(void)
{
/* declaring static will make this table value bound to the file */
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* black */
0xff, 0x00, 0x00, /* light red */
0x00, 0xff, 0x00, /* light green */
0xff, 0xff, 0x00, /* light yellow */
0x00, 0x00, 0xff, /* light blue */
0xff, 0x00, 0xff, /* light purple */
0x00, 0xff, 0xff, /* light light blue */
0xff, 0xff, 0xff, /* white */
0xc6, 0xc6, 0xc6, /* light grey */
0x84, 0x00, 0x00, /* dark red */
0x00, 0x84, 0x00, /* dark green */
0x84, 0x84, 0x00, /* dark yellow */
0x00, 0x00, 0x84, /* dark green-blue */
0x84, 0x00, 0x84, /* dark purple */
0x00, 0x84, 0x84, /* light dark blue */
0x84, 0x84, 0x84 /* light grey */
};
set_palette(0, 15, table_rgb);
return;
}
开发者ID:flamearrow,项目名称:30dayos,代码行数:28,代码来源:bootpack.c
示例8: fb_switch_signal_acq
static void fb_switch_signal_acq(void *data)
{
struct vt_stat st;
struct rect r;
int rs;
EINTRLOOP(rs, ioctl(TTY,VT_GETSTATE,&st));
if (rs) return;
if (st.v_active != fb_console) return;
INC_IN_GR
fb_active=1;
EINTRLOOP(rs, ioctl(TTY,VT_RELDISP,VT_ACKACQ));
/*
* There is a race condition in Linux NVidia framebuffer driver
* It still draws into a framebuffer here, so we have to sleep
*/
portable_sleep(10);
if (have_cmap && current_virtual_device)
set_palette(&global_pal);
END_GR
r.x1=0;
r.y1=0;
r.x2=fb_xsize;
r.y2=fb_ysize;
if (border_left | border_top | border_right | border_bottom) fb_clear_videoram();
if (current_virtual_device) current_virtual_device->redraw_handler(current_virtual_device,&r);
}
开发者ID:Acidburn0zzz,项目名称:links-plus,代码行数:27,代码来源:framebuf.c
示例9: set_palette
VNGError VngoDirect3D::reinit(Flx16 brightness)
{
if (!pal)
return VNGO_NOT_SUPPORTED;
return set_palette(pal,brightness);
}
开发者ID:OhGameKillers,项目名称:mythosengine,代码行数:7,代码来源:D3DSCRN.CPP
示例10: ColorSelectionDialog
Gobby::ColorSelectionDialog::
ColorSelectionDialog(Config::ParentEntry& config_entry)
: Gtk::ColorSelectionDialog(),
m_config_entry(config_entry)
{
set_palette(config_entry, *get_colorsel() );
}
开发者ID:bb-generation,项目名称:gobby,代码行数:7,代码来源:colorsel.cpp
示例11: main
int main() {
/* initialize */
if (allegro_init() != 0) {
return 1;
}
install_keyboard();
install_mouse();
install_timer();
if (set_gfx_mode(GFX_AUTODETECT, 340, 380, 0, 0) != 0) {
if (set_gfx_mode(GFX_SAFE, 340, 380, 0, 0) != 0) {
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
allegro_message("Unable to set any graphic mode\n%s\n", allegro_error);
return 1;
}
}
set_palette(default_palette);
/* run the dialog */
do_dialog(color_builder, -1);
return 0;
}
开发者ID:ross-spencer,项目名称:allegro-palette-viewer,代码行数:26,代码来源:palette.cpp
示例12: frame_buffer_control
/*
* IOCTL entry point -- This method is called to carry
* all services of this interface.
*/
rtems_device_driver frame_buffer_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg
)
{
rtems_libio_ioctl_args_t *args = arg;
printk( "FBVGA ioctl called, cmd=%x\n", args->command );
switch( args->command ) {
case FBIOGET_FSCREENINFO:
args->ioctl_return = get_fix_screen_info( ( struct fb_fix_screeninfo * ) args->buffer );
break;
case FBIOGET_VSCREENINFO:
args->ioctl_return = get_var_screen_info( ( struct fb_var_screeninfo * ) args->buffer );
break;
case FBIOPUT_VSCREENINFO:
/* not implemented yet*/
args->ioctl_return = -1;
return RTEMS_UNSATISFIED;
case FBIOGETCMAP:
args->ioctl_return = get_palette( ( struct fb_cmap * ) args->buffer );
break;
case FBIOPUTCMAP:
args->ioctl_return = set_palette( ( struct fb_cmap * ) args->buffer );
break;
default:
args->ioctl_return = 0;
break;
}
return RTEMS_SUCCESSFUL;
}
开发者ID:AndroidMarv,项目名称:rtems,代码行数:38,代码来源:fb_vga.c
示例13: load_proc
static int
load_proc(void)
{
char buffer[256], *p;
BITMAP *bmp;
PALETTE palette;
if (file_select_ex("Load image", last_path, "bmp;pcx;lbm;tga;jpg;jpeg", 1024, (SCREEN_W * 2) / 3, (SCREEN_H * 2) / 3)) {
bmp = load_jpg_ex(last_path, palette, progress_cb);
if (!bmp)
bmp = load_bitmap(last_path, palette);
settings_dialog[PREVIEW].dp = bmp;
if (!bmp) {
sprintf(buffer, "Error loading image (JPG error code: %d)", jpgalleg_error);
alert("", buffer, "", "Ok", NULL, 0, 0);
return 0;
}
for (p = last_path + strlen(last_path); (p >= last_path) && (*p != '/') && (*p != '\\'); p--)
;
*(p + 1) = '\0';
sx = sy = old_sx = old_sy = 0;
set_palette(palette);
popup_menu[1].flags = 0;
}
return 0;
}
开发者ID:ChristophGuillermet,项目名称:WHITECAT_opensource,代码行数:26,代码来源:ex5.c
示例14: init_palette
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00,
0xff, 0x00, 0x00,
0x00, 0xff, 0x00,
0xff, 0xff, 0x00,
0x00, 0x00, 0xff,
0xff, 0x00, 0xff,
0x00, 0xff, 0xff,
0xff, 0xff, 0xff,
0xc6, 0xc6, 0xc6,
0x84, 0x00, 0x00,
0x00, 0x84, 0x00,
0x84, 0x84, 0x00,
0x00, 0x00, 0x84,
0x84, 0x00, 0x84,
0x00, 0x84, 0x84,
0x84, 0x84, 0x84
};
set_palette(0, 15, table_rgb);
return;
}
开发者ID:GoodLuckBamboo,项目名称:hariboteos,代码行数:25,代码来源:graphic.c
示例15: initialise_screen
void initialise_screen() {
if (have_allegro_window) {
set_gfx_mode(GFX_SAFE, 320, 200, 0, 0);
set_palette(desktop_palette);
acquire_screen();
textout_centre(screen, font, "Type Here!!",
SCREEN_W/2, SCREEN_H/2-60, 255);
textout(screen, font, "Ctrl-M: switch between comm ports",
0, SCREEN_H/2-32, 255);
textout(screen, font, "Ctrl-B: send a half second break signal",
0, SCREEN_H/2-16, 255);
textout(screen, font, "Ctrl-C: quit", 0, SCREEN_H/2, 255);
textout(screen, font, "Other key presses sent to current port.",
0, SCREEN_H/2+16, 255);
textout(screen, font, "Current port:", 0, SCREEN_H/2+40, 255);
textout(screen, font, cur_port->szName,
SCREEN_W/2, SCREEN_H/2+40, 255);
release_screen();
}
else {
printf("Ctrl-M: switch between comm ports\n");
printf("Ctrl-B: send a half second break signal\n");
printf("Ctrl-C: quit\n");
printf("Other key presses sent to current port.\n");
printf("\nCurrent port: %s\n\n", cur_port->szName);
}
}
开发者ID:gdawg,项目名称:scantool-ubuntu,代码行数:29,代码来源:exterm.c
示例16: nullterm_open
static void
nullterm_open(void)
{
#if OPT_COLOR
int pass;
int nc;
char *value = 0;
char temp[80];
size_t need = 3;
/*
* The -F option needs a palette, in case we want to apply a color-scheme.
*/
for (pass = 0; pass < 2; ++pass) {
for (nc = 0; nc < ncolors; ++nc) {
sprintf(temp, (nc ? " %d" : "%d"), nc);
if (pass) {
strcat(value, temp);
} else {
need += strlen(temp);
}
}
if (pass) {
set_palette(value);
set_ctrans(value);
free(value);
} else {
value = malloc(need);
if (value == 0)
break;
*value = EOS;
}
}
#endif
}
开发者ID:OS2World,项目名称:APP-EDITOR-Vile,代码行数:35,代码来源:nullterm.c
示例17: switch_in_fullscreen
/* switch_in_fullscreen:
* Handles screen switched in.
*/
static void switch_in_fullscreen(void)
{
restore_all_ddraw_surfaces();
if (_color_depth == 8)
set_palette(wddfull_saved_palette);
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:10,代码来源:wddfull.c
示例18: init_palette
void init_palette(void){
//16种color,每个color三个字节。
static unsigned char table_rgb[16*3]=
{
0x00,0x00,0x00, /*0:black*/
0xff,0x00,0x00, /*1:light red*/
0x00,0xff,0x00, /*2:light green*/
0xff,0xff,0x00, /*3:light yellow*/
0x00,0x00,0xff, /*4:light blue*/
0xff,0x00,0xff, /*5:light purper*/
0x00,0xff,0xff, /*6:light blue*/
0xff,0xff,0xff, /*7:white*/
0xc6,0xc6,0xc6, /*8:light gray*/
0x84,0x00,0x00, /*9:dark red*/
0x00,0x84,0x00, /*10:dark green*/
0x84,0x84,0x00, /*11:dark yellow*/
0x00,0x00,0x84, /*12:dark 青*/
0x84,0x00,0x84, /*13:dark purper*/
0x00,0x84,0x84, /*14:light blue*/
0x84,0x84,0x84, /*15:dark gray*/
};
set_palette(0,15,table_rgb);
return;
}
开发者ID:Redoblue,项目名称:osask-linux,代码行数:27,代码来源:screen.c
示例19: init_palette
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* 0:崟 */
0xff, 0x00, 0x00, /* 1:柧傞偄愒 */
0x00, 0xff, 0x00, /* 2:柧傞偄椢 */
0xff, 0xff, 0x00, /* 3:柧傞偄墿怓 */
0x00, 0x00, 0xff, /* 4:柧傞偄惵 */
0xff, 0x00, 0xff, /* 5:柧傞偄巼 */
0x00, 0xff, 0xff, /* 6:柧傞偄悈怓 */
0xff, 0xff, 0xff, /* 7:敀 */
0xc6, 0xc6, 0xc6, /* 8:柧傞偄奃怓 */
0x84, 0x00, 0x00, /* 9:埫偄愒 */
0x00, 0x84, 0x00, /* 10:埫偄椢 */
0x84, 0x84, 0x00, /* 11:埫偄墿怓 */
0x00, 0x00, 0x84, /* 12:埫偄惵 */
0x84, 0x00, 0x84, /* 13:埫偄巼 */
0x00, 0x84, 0x84, /* 14:埫偄悈怓 */
0x84, 0x84, 0x84 /* 15:埫偄奃怓 */
};
set_palette(0, 15, table_rgb);
return;
/* static char 柦椷偼丄僨乕僞偵偟偐巊偊側偄偗偳DB柦椷憡摉 */
}
开发者ID:GoodLuckBamboo,项目名称:hariboteos,代码行数:25,代码来源:bootpack.c
示例20: init_palette
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* 0:黒 */
0xff, 0x00, 0x00, /* 1:明るい赤 */
0x00, 0xff, 0x00, /* 2:明るい緑 */
0xff, 0xff, 0x00, /* 3:明るい黄色 */
0x00, 0x00, 0xff, /* 4:明るい青 */
0xff, 0x00, 0xff, /* 5:明るい紫 */
0x00, 0xff, 0xff, /* 6:明るい水色 */
0xff, 0xff, 0xff, /* 7:白 */
0xc6, 0xc6, 0xc6, /* 8:明るい灰色 */
0x84, 0x00, 0x00, /* 9:暗い赤 */
0x00, 0x84, 0x00, /* 10:暗い緑 */
0x84, 0x84, 0x00, /* 11:暗い黄色 */
0x00, 0x00, 0x84, /* 12:暗い青 */
0x84, 0x00, 0x84, /* 13:暗い紫 */
0x00, 0x84, 0x84, /* 14:暗い水色 */
0x84, 0x84, 0x84 /* 15:暗い灰色 */
};
set_palette(0, 15, table_rgb);
return;
/* static char 命令は、データにしか使えないけどDB命令相当 */
}
开发者ID:bigpussy,项目名称:harib_os_src,代码行数:25,代码来源:bootpack.c
注:本文中的set_palette函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论