You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.0KB

  1. /*
  2. * copyright (c) 2009 Stefano Sabatini
  3. * This file is part of FFmpeg.
  4. *
  5. * FFmpeg is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * FFmpeg is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with FFmpeg; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. /**
  20. * @file
  21. * parsing utils
  22. */
  23. #ifndef AVFILTER_PARSEUTILS_H
  24. #define AVFILTER_PARSEUTILS_H
  25. #include "libavutil/opt.h"
  26. /**
  27. * Put the RGBA values that correspond to color_string in rgba_color.
  28. *
  29. * @param color_string a string specifying a color. It can be the name of
  30. * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
  31. * possibly followed by "@" and a string representing the alpha
  32. * component.
  33. * The alpha component may be a string composed by "0x" followed by an
  34. * hexadecimal number or a decimal number between 0.0 and 1.0, which
  35. * represents the opacity value (0x00/0.0 means completely transparent,
  36. * 0xff/1.0 completely opaque).
  37. * If the alpha component is not specified then 0xff is assumed.
  38. * The string "random" will result in a random color.
  39. * @param slen length of the initial part of color_string containing the
  40. * color. It can be set to -1 if color_string is a null terminated string
  41. * containing nothing else than the color.
  42. * @return >= 0 in case of success, a negative value in case of
  43. * failure (for example if color_string cannot be parsed).
  44. */
  45. int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
  46. void *log_ctx);
  47. #endif /* AVFILTER_PARSEUTILS_H */