Browse Source

freetype: rename xxxFromRGB to xxxFromXRGB

This is the type of uin32_t that is expected to be passed.
pull/162/head
Steve Lhomme 3 years ago
committed by Felix Paul Kühne
parent
commit
25da40b9a3
  1. 4
      modules/text_renderer/freetype/blend/rgb.h
  2. 4
      modules/text_renderer/freetype/blend/yuv.h
  3. 8
      modules/text_renderer/freetype/freetype.c

4
modules/text_renderer/freetype/blend/rgb.h

@ -19,8 +19,8 @@
*****************************************************************************/
#include "blend.h"
static void RGBFromRGB( uint32_t i_argb,
uint8_t *pi_r, uint8_t *pi_g, uint8_t *pi_b )
static void RGBFromXRGB( uint32_t i_argb,
uint8_t *pi_r, uint8_t *pi_g, uint8_t *pi_b )
{
*pi_r = ( i_argb & 0x00ff0000 ) >> 16;
*pi_g = ( i_argb & 0x0000ff00 ) >> 8;

4
modules/text_renderer/freetype/blend/yuv.h

@ -19,8 +19,8 @@
*****************************************************************************/
#include "blend.h"
static void YUVFromRGB( uint32_t i_argb,
uint8_t *pi_y, uint8_t *pi_u, uint8_t *pi_v )
static void YUVFromXRGB( uint32_t i_argb,
uint8_t *pi_y, uint8_t *pi_u, uint8_t *pi_v )
{
int i_red = ( i_argb & 0x00ff0000 ) >> 16;
int i_green = ( i_argb & 0x0000ff00 ) >> 8;

8
modules/text_renderer/freetype/freetype.c

@ -385,7 +385,7 @@ static int RenderYUVP( filter_t *p_filter, subpicture_region_t *p_region,
/* Calculate text color components
* Only use the first color */
const int i_alpha = p_line->p_character[0].p_style->i_font_alpha;
YUVFromRGB( p_line->p_character[0].p_style->i_font_color, &i_y, &i_u, &i_v );
YUVFromXRGB( p_line->p_character[0].p_style->i_font_color, &i_y, &i_u, &i_v );
/* Build palette */
fmt.p_palette->i_entries = 16;
@ -1132,13 +1132,13 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
const ft_drawing_functions drawfuncs[] =
{
[DRAW_YUVA] = { .extract = YUVFromRGB,
[DRAW_YUVA] = { .extract = YUVFromXRGB,
.fill = FillYUVAPicture,
.blend = BlendGlyphToYUVA },
[DRAW_RGBA] = { .extract = RGBFromRGB,
[DRAW_RGBA] = { .extract = RGBFromXRGB,
.fill = FillRGBAPicture,
.blend = BlendGlyphToRGBA },
[DRAW_ARGB] = { .extract = RGBFromRGB,
[DRAW_ARGB] = { .extract = RGBFromXRGB,
.fill = FillARGBPicture,
.blend = BlendGlyphToARGB },
};

Loading…
Cancel
Save