lavu/parseutils: add av_get_known_color_name()
This commit is contained in:
parent
1e5271a9fd
commit
d61617a523
4 changed files with 32 additions and 3 deletions
|
@ -420,6 +420,20 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
|
|||
return 0;
|
||||
}
|
||||
|
||||
const char *av_get_known_color_name(int color_idx, const uint8_t **rgbp)
|
||||
{
|
||||
const ColorEntry *color;
|
||||
|
||||
if ((unsigned)color_idx >= FF_ARRAY_ELEMS(color_table))
|
||||
return NULL;
|
||||
|
||||
color = &color_table[color_idx];
|
||||
if (rgbp)
|
||||
*rgbp = color->rgb_color;
|
||||
|
||||
return color->name;
|
||||
}
|
||||
|
||||
/* get a positive number between n_min and n_max, for a maximum length
|
||||
of len_max. Return -1 if error. */
|
||||
static int date_get_num(const char **pp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue