浏览代码

* Replaced occurrences of "rgba" with "argb".

tags/v0.99.beta14
Sam Hocevar sam 18 年前
父节点
当前提交
a8990ca5a6
共有 14 个文件被更改,包括 32 次插入32 次删除
  1. +1
    -1
      caca/driver_conio.c
  2. +2
    -2
      caca/driver_gl.c
  3. +1
    -1
      caca/driver_ncurses.c
  4. +4
    -4
      caca/driver_slang.c
  5. +1
    -1
      caca/driver_vga.c
  6. +2
    -2
      caca/driver_win32.c
  7. +4
    -4
      caca/driver_x11.c
  8. +3
    -3
      cucul/colour.c
  9. +3
    -3
      cucul/cucul_internals.h
  10. +2
    -2
      cucul/export_ansi.c
  11. +3
    -3
      cucul/export_html.c
  12. +2
    -2
      cucul/export_irc.c
  13. +2
    -2
      cucul/export_ps.c
  14. +2
    -2
      cucul/export_svg.c

+ 1
- 1
caca/driver_conio.c 查看文件

@@ -105,7 +105,7 @@ static void conio_display(caca_t *kk)
for(n = kk->qq->height * kk->qq->width; n--; )
{
*screen++ = _cucul_utf32_to_cp437(*chars++);
*screen++ = _cucul_rgba32_to_ansi8(*attr++);
*screen++ = _cucul_argb32_to_ansi8(*attr++);
}
# if defined(SCREENUPDATE_IN_PC_H)
ScreenUpdate(kk->drv.p->screen);


+ 2
- 2
caca/driver_gl.c 查看文件

@@ -250,7 +250,7 @@ static void gl_display(caca_t *kk)
for(x = 0; x < kk->drv.p->width; x += kk->drv.p->font_width)
{
glDisable(GL_TEXTURE_2D);
glColor4bv(gl_bgpal[_cucul_rgba32_to_ansi4bg(*attr++)]);
glColor4bv(gl_bgpal[_cucul_argb32_to_ansi4bg(*attr++)]);
glBegin(GL_QUADS);
glVertex2f(x, y);
glVertex2f(x + kk->drv.p->font_width, y);
@@ -281,7 +281,7 @@ static void gl_display(caca_t *kk)
if(c > 0x00000020 && c < 0x00000080)
{
glBindTexture(GL_TEXTURE_2D, kk->drv.p->id[c - 32]);
glColor4bv(gl_bgpal[_cucul_rgba32_to_ansi4fg(*attr)]);
glColor4bv(gl_bgpal[_cucul_argb32_to_ansi4fg(*attr)]);
glBegin(GL_QUADS);
glTexCoord2f(0, kk->drv.p->sh);
glVertex2f(x, y);


+ 1
- 1
caca/driver_ncurses.c 查看文件

@@ -197,7 +197,7 @@ static void ncurses_display(caca_t *kk)
move(y, 0);
for(x = kk->qq->width; x--; )
{
attrset(kk->drv.p->attr[_cucul_rgba32_to_ansi8(*attr++)]);
attrset(kk->drv.p->attr[_cucul_argb32_to_ansi8(*attr++)]);
ncurses_write_utf32(*chars++);
}
}


+ 4
- 4
caca/driver_slang.c 查看文件

@@ -212,14 +212,14 @@ static void slang_display(caca_t *kk)
uint32_t c = *chars++;

#if defined(OPTIMISE_SLANG_PALETTE)
uint8_t fgcolor = _cucul_rgba32_to_ansi4fg(*attr);
uint8_t bgcolor = _cucul_rgba32_to_ansi4bg(*attr);
uint8_t fgcolor = _cucul_argb32_to_ansi4fg(*attr);
uint8_t bgcolor = _cucul_argb32_to_ansi4bg(*attr);

/* If foreground == background, just don't use this colour
* pair, and print a space instead of the real character. */
if(fgcolor != bgcolor)
{
SLsmg_set_color(slang_assoc[_cucul_rgba32_to_ansi8(*attr++)]);
SLsmg_set_color(slang_assoc[_cucul_argb32_to_ansi8(*attr++)]);
slang_write_utf32(c);
}
else
@@ -236,7 +236,7 @@ static void slang_display(caca_t *kk)
attr++;
}
#else
SLsmg_set_color(_cucul_rgba32_to_ansi8(*attr++));
SLsmg_set_color(_cucul_argb32_to_ansi8(*attr++));
slang_write_utf32(c);
#endif
}


+ 1
- 1
caca/driver_vga.c 查看文件

@@ -123,7 +123,7 @@ static void vga_display(caca_t *kk)
for(n = kk->qq->height * kk->qq->width; n--; )
{
*screen++ = _cucul_utf32_to_cp437(*chars++);
*screen++ = _cucul_rgba32_to_ansi8(*attr++);
*screen++ = _cucul_argb32_to_ansi8(*attr++);
}
}



+ 2
- 2
caca/driver_win32.c 查看文件

@@ -210,8 +210,8 @@ static void win32_display(caca_t *kk)
#endif

kk->drv.p->buffer[i].Attributes =
win32_fg_palette[_cucul_rgba32_to_ansi4fg(kk->qq->attr[i])]
| win32_bg_palette[_cucul_rgba32_to_ansi4bg(kk->qq->attr[i])];
win32_fg_palette[_cucul_argb32_to_ansi4fg(kk->qq->attr[i])]
| win32_bg_palette[_cucul_argb32_to_ansi4bg(kk->qq->attr[i])];
}

/* Blit the screen buffer */


+ 4
- 4
caca/driver_x11.c 查看文件

@@ -260,15 +260,15 @@ static void x11_display(caca_t *kk)
for(x = 0; x < kk->qq->width; x += len)
{
uint32_t *attr = kk->qq->attr + x + y * kk->qq->width;
uint8_t bg = _cucul_rgba32_to_ansi4bg(*attr);
uint8_t bg = _cucul_argb32_to_ansi4bg(*attr);

len = 1;
while(x + len < kk->qq->width
&& _cucul_rgba32_to_ansi4bg(attr[len]) == bg)
&& _cucul_argb32_to_ansi4bg(attr[len]) == bg)
len++;

XSetForeground(kk->drv.p->dpy, kk->drv.p->gc,
kk->drv.p->colors[_cucul_rgba32_to_ansi4bg(*attr)]);
kk->drv.p->colors[_cucul_argb32_to_ansi4bg(*attr)]);
XFillRectangle(kk->drv.p->dpy, kk->drv.p->pixmap, kk->drv.p->gc,
x * kk->drv.p->font_width, y * kk->drv.p->font_height,
len * kk->drv.p->font_width, kk->drv.p->font_height);
@@ -291,7 +291,7 @@ static void x11_display(caca_t *kk)
continue;

XSetForeground(kk->drv.p->dpy, kk->drv.p->gc,
kk->drv.p->colors[_cucul_rgba32_to_ansi4fg(*attr)]);
kk->drv.p->colors[_cucul_argb32_to_ansi4fg(*attr)]);

/* Plain ASCII, no problem. */
if(*chars > 0x00000020 && *chars < 0x00000080)


+ 3
- 3
cucul/colour.c 查看文件

@@ -25,19 +25,19 @@

/* FIXME: could this be inlined? */

uint8_t _cucul_rgba32_to_ansi8(uint32_t c)
uint8_t _cucul_argb32_to_ansi8(uint32_t c)
{
/* FIXME: we need nearest colour handling for non-ANSI */
return (c & 0x0000000f) | ((c & 0x000f0000) >> 12);
}

uint8_t _cucul_rgba32_to_ansi4fg(uint32_t c)
uint8_t _cucul_argb32_to_ansi4fg(uint32_t c)
{
/* FIXME: we need nearest colour handling for non-ANSI */
return c & 0x0000000f;
}

uint8_t _cucul_rgba32_to_ansi4bg(uint32_t c)
uint8_t _cucul_argb32_to_ansi4bg(uint32_t c)
{
/* FIXME: we need nearest colour handling for non-ANSI */
return (c & 0x000f0000) >> 16;


+ 3
- 3
cucul/cucul_internals.h 查看文件

@@ -62,9 +62,9 @@ extern uint8_t _cucul_utf32_to_cp437(uint32_t);
extern uint32_t _cucul_cp437_to_utf32(uint8_t);

/* Colour functions */
uint8_t _cucul_rgba32_to_ansi8(uint32_t);
uint8_t _cucul_rgba32_to_ansi4fg(uint32_t);
uint8_t _cucul_rgba32_to_ansi4bg(uint32_t);
uint8_t _cucul_argb32_to_ansi8(uint32_t);
uint8_t _cucul_argb32_to_ansi4fg(uint32_t);
uint8_t _cucul_argb32_to_ansi4bg(uint32_t);

/* Export functions */
extern void _cucul_get_ansi(cucul_t *, struct cucul_export *);


+ 2
- 2
cucul/export_ansi.c 查看文件

@@ -66,8 +66,8 @@ void _cucul_get_ansi(cucul_t *qq, struct cucul_export *ex)

for(x = 0; x < qq->width; x++)
{
uint8_t fg = _cucul_rgba32_to_ansi4fg(lineattr[x]);
uint8_t bg = _cucul_rgba32_to_ansi4bg(lineattr[x]);
uint8_t fg = _cucul_argb32_to_ansi4fg(lineattr[x]);
uint8_t bg = _cucul_argb32_to_ansi4bg(lineattr[x]);
uint32_t c = linechar[x];

if(fg != prevfg || bg != prevbg)


+ 3
- 3
cucul/export_html.c 查看文件

@@ -78,7 +78,7 @@ void _cucul_get_html(cucul_t *qq, struct cucul_export *ex)
for(x = 0; x < qq->width; x += len)
{
cur += sprintf(cur, "<span class='b%02x'>",
_cucul_rgba32_to_ansi8(lineattr[x]));
_cucul_argb32_to_ansi8(lineattr[x]));

for(len = 0;
x + len < qq->width && lineattr[x + len] == lineattr[x];
@@ -158,13 +158,13 @@ void _cucul_get_html3(cucul_t *qq, struct cucul_export *ex)
len++;

cur += sprintf(cur, "<td bgcolor=#%06x",
_cucul_rgba32_to_ansi4bg(lineattr[x]));
_cucul_argb32_to_ansi4bg(lineattr[x]));

if(len > 1)
cur += sprintf(cur, " colspan=%d", len);

cur += sprintf(cur, "><font color=#%06x>",
_cucul_rgba32_to_ansi4fg(lineattr[x]));
_cucul_argb32_to_ansi4fg(lineattr[x]));

for(i = 0; i < len; i++)
{


+ 2
- 2
cucul/export_irc.c 查看文件

@@ -70,8 +70,8 @@ void _cucul_get_irc(cucul_t *qq, struct cucul_export *ex)

for(x = 0; x < qq->width; x++)
{
uint8_t fg = palette[_cucul_rgba32_to_ansi4fg(lineattr[x])];
uint8_t bg = palette[_cucul_rgba32_to_ansi4bg(lineattr[x])];
uint8_t fg = palette[_cucul_argb32_to_ansi4fg(lineattr[x])];
uint8_t bg = palette[_cucul_argb32_to_ansi4bg(lineattr[x])];
uint32_t c = linechar[x];

if(bg == prevbg)


+ 2
- 2
cucul/export_ps.c 查看文件

@@ -90,7 +90,7 @@ void _cucul_get_ps(cucul_t *qq, struct cucul_export *ex)
for(x = 0; x < qq->width; x++)
{
cur += sprintf(cur, "1 0 translate\n %s csquare\n",
palette[_cucul_rgba32_to_ansi4bg(*lineattr++)]);
palette[_cucul_argb32_to_ansi4bg(*lineattr++)]);
}

/* Return to beginning of the line, and jump to the next one */
@@ -111,7 +111,7 @@ void _cucul_get_ps(cucul_t *qq, struct cucul_export *ex)
cur += sprintf(cur, "newpath\n");
cur += sprintf(cur, "%d %d moveto\n", (x + 1) * 6, y * 10);
cur += sprintf(cur, "%s setrgbcolor\n",
palette[_cucul_rgba32_to_ansi4fg(*lineattr++)]);
palette[_cucul_argb32_to_ansi4fg(*lineattr++)]);

if(c < 0x00000020)
cur += sprintf(cur, "(?) show\n");


+ 2
- 2
cucul/export_svg.c 查看文件

@@ -88,7 +88,7 @@ void _cucul_get_svg(cucul_t *qq, struct cucul_export *ex)
{
cur += sprintf(cur, "<rect class=\"b%02x\" x=\"%d\" y=\"%d\""
" width=\"6\" height=\"10\"/>\n",
_cucul_rgba32_to_ansi8(*lineattr++),
_cucul_argb32_to_ansi8(*lineattr++),
x * 6, y * 10);
}
}
@@ -104,7 +104,7 @@ void _cucul_get_svg(cucul_t *qq, struct cucul_export *ex)
uint32_t c = *linechar++;

cur += sprintf(cur, "<text class=\"f%02x\" x=\"%d\" y=\"%d\">",
_cucul_rgba32_to_ansi8(*lineattr++),
_cucul_argb32_to_ansi8(*lineattr++),
x * 6, (y * 10) + 10);
if(c < 0x00000020)
cur += sprintf(cur, "?");


正在加载...
取消
保存