Browse Source

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

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
a8990ca5a6
14 changed files with 32 additions and 32 deletions
  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 View File

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


+ 2
- 2
caca/driver_gl.c View File

@@ -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) for(x = 0; x < kk->drv.p->width; x += kk->drv.p->font_width)
{ {
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glColor4bv(gl_bgpal[_cucul_rgba32_to_ansi4bg(*attr++)]);
glColor4bv(gl_bgpal[_cucul_argb32_to_ansi4bg(*attr++)]);
glBegin(GL_QUADS); glBegin(GL_QUADS);
glVertex2f(x, y); glVertex2f(x, y);
glVertex2f(x + kk->drv.p->font_width, 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) if(c > 0x00000020 && c < 0x00000080)
{ {
glBindTexture(GL_TEXTURE_2D, kk->drv.p->id[c - 32]); 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); glBegin(GL_QUADS);
glTexCoord2f(0, kk->drv.p->sh); glTexCoord2f(0, kk->drv.p->sh);
glVertex2f(x, y); glVertex2f(x, y);


+ 1
- 1
caca/driver_ncurses.c View File

@@ -197,7 +197,7 @@ static void ncurses_display(caca_t *kk)
move(y, 0); move(y, 0);
for(x = kk->qq->width; x--; ) 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++); ncurses_write_utf32(*chars++);
} }
} }


+ 4
- 4
caca/driver_slang.c View File

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


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


+ 1
- 1
caca/driver_vga.c View File

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




+ 2
- 2
caca/driver_win32.c View File

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


kk->drv.p->buffer[i].Attributes = 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 */ /* Blit the screen buffer */


+ 4
- 4
caca/driver_x11.c View File

@@ -260,15 +260,15 @@ static void x11_display(caca_t *kk)
for(x = 0; x < kk->qq->width; x += len) for(x = 0; x < kk->qq->width; x += len)
{ {
uint32_t *attr = kk->qq->attr + x + y * kk->qq->width; 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; len = 1;
while(x + len < kk->qq->width while(x + len < kk->qq->width
&& _cucul_rgba32_to_ansi4bg(attr[len]) == bg)
&& _cucul_argb32_to_ansi4bg(attr[len]) == bg)
len++; len++;


XSetForeground(kk->drv.p->dpy, kk->drv.p->gc, 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, 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, x * kk->drv.p->font_width, y * kk->drv.p->font_height,
len * kk->drv.p->font_width, 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; continue;


XSetForeground(kk->drv.p->dpy, kk->drv.p->gc, 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. */ /* Plain ASCII, no problem. */
if(*chars > 0x00000020 && *chars < 0x00000080) if(*chars > 0x00000020 && *chars < 0x00000080)


+ 3
- 3
cucul/colour.c View File

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


/* FIXME: could this be inlined? */ /* 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 */ /* FIXME: we need nearest colour handling for non-ANSI */
return (c & 0x0000000f) | ((c & 0x000f0000) >> 12); 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 */ /* FIXME: we need nearest colour handling for non-ANSI */
return c & 0x0000000f; 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 */ /* FIXME: we need nearest colour handling for non-ANSI */
return (c & 0x000f0000) >> 16; return (c & 0x000f0000) >> 16;


+ 3
- 3
cucul/cucul_internals.h View File

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


/* Colour functions */ /* 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 */ /* Export functions */
extern void _cucul_get_ansi(cucul_t *, struct cucul_export *); extern void _cucul_get_ansi(cucul_t *, struct cucul_export *);


+ 2
- 2
cucul/export_ansi.c View File

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


for(x = 0; x < qq->width; x++) 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]; uint32_t c = linechar[x];


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


+ 3
- 3
cucul/export_html.c View File

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


for(len = 0; for(len = 0;
x + len < qq->width && lineattr[x + len] == lineattr[x]; 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++; len++;


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


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


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


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


+ 2
- 2
cucul/export_irc.c View File

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


for(x = 0; x < qq->width; x++) 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]; uint32_t c = linechar[x];


if(bg == prevbg) if(bg == prevbg)


+ 2
- 2
cucul/export_ps.c View File

@@ -90,7 +90,7 @@ void _cucul_get_ps(cucul_t *qq, struct cucul_export *ex)
for(x = 0; x < qq->width; x++) for(x = 0; x < qq->width; x++)
{ {
cur += sprintf(cur, "1 0 translate\n %s csquare\n", 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 */ /* 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, "newpath\n");
cur += sprintf(cur, "%d %d moveto\n", (x + 1) * 6, y * 10); cur += sprintf(cur, "%d %d moveto\n", (x + 1) * 6, y * 10);
cur += sprintf(cur, "%s setrgbcolor\n", cur += sprintf(cur, "%s setrgbcolor\n",
palette[_cucul_rgba32_to_ansi4fg(*lineattr++)]);
palette[_cucul_argb32_to_ansi4fg(*lineattr++)]);


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


+ 2
- 2
cucul/export_svg.c View File

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


cur += sprintf(cur, "<text class=\"f%02x\" x=\"%d\" y=\"%d\">", 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); x * 6, (y * 10) + 10);
if(c < 0x00000020) if(c < 0x00000020)
cur += sprintf(cur, "?"); cur += sprintf(cur, "?");


Loading…
Cancel
Save