freetype2/src/base/ftcolor.c

67 lines
1.5 KiB
C
Raw Normal View History

/****************************************************************************
*
* ftcolor.c
*
* FreeType's glyph color management (body).
*
* Copyright 2018 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_COLOR_H
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
static
const FT_Palette_Data null_palette_data = { 0, NULL, NULL, 0, NULL };
/* documentation is in ftcolor.h */
FT_EXPORT_DEF( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette_data )
{
if ( !face )
return FT_THROW( Invalid_Face_Handle );
if ( !apalette_data)
return FT_THROW( Invalid_Argument );
if ( FT_IS_SFNT( face ) )
*apalette_data = ( (TT_Face)face )->palette_data;
else
*apalette_data = null_palette_data;
return FT_Err_Ok;
}
#else /* !TT_CONFIG_OPTION_COLOR_LAYERS */
FT_EXPORT_DEF( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette_data )
{
FT_UNUSED( face );
FT_UNUSED( apalette );
return FT_THROW( Unimplemented_Feature );
}
#endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */
/* END */