[FFmpeg-devel] [PATCH 1/2] WIP: Move CGA/EGA/VGA font to lavu as public API.

Stefano Sabatini stefasab at gmail.com
Tue Sep 18 10:29:03 CEST 2012


On date Sunday 2012-09-16 16:13:11 +0200, Clément Bœsch encoded:
> XXX:
>  - rename to xga_font.*/cga_font.*/font.*?
>  - avpriv?
> 
> TODO:
>  - APIChanges
>  - bump micro lavc
>  - bump minor lavu
> ---
>  libavcodec/Makefile    |  12 +-
>  libavcodec/ansi.c      |  18 +-
>  libavcodec/bintext.c   |  10 +-
>  libavcodec/cga_data.c  | 444 -------------------------------------------------
>  libavcodec/cga_data.h  |  48 ------
>  libavcodec/pictordec.c |  12 +-
>  libavcodec/tmv.c       |   9 +-
>  libavutil/Makefile     |   2 +
>  libavutil/cga_data.c   | 444 +++++++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/cga_data.h   |  48 ++++++
>  10 files changed, 524 insertions(+), 523 deletions(-)
>  delete mode 100644 libavcodec/cga_data.c
>  delete mode 100644 libavcodec/cga_data.h
>  create mode 100644 libavutil/cga_data.c
>  create mode 100644 libavutil/cga_data.h
[...]
> +/**
> + * @file
> + * CGA/EGA/VGA ROM data
> + */
> +
> +#ifndef AVUTIL_CGA_DATA_H
> +#define AVUTIL_CGA_DATA_H
> +
> +#include <stdint.h>
> +
> +extern const uint8_t av_cga_font[2048];
> +extern const uint8_t av_vga16_font[4096];
> +extern const uint32_t av_cga_palette[16];
> +extern const uint32_t av_ega_palette[64];
> +

> +/**
> + * Draw CGA/EGA/VGA font to 8-bit pixel buffer
> + *
> + * @param dst Destination pixel buffer
> + * @param linesize Linesize (pixels)
> + * @param font Font table. We assume font width is always 8 pixels wide.
> + * @param font_height Font height (pixels)
> + * @param fg,bg Foreground and background palette index
> + * @param ch Character to draw
> + */
> +void av_draw_pc_font(uint8_t *dst, int linesize, const uint8_t *font, int font_height, int ch, int fg, int bg);

If we're going to make this function public we should make
documentation a bit clear, right now it is almost impossible to
understand it without referring to the implementation.
-- 
FFmpeg = Fundamentalist & Fanciful Miracolous Proud Educated Gorilla


More information about the ffmpeg-devel mailing list