diff options
author | toger5 <toger5@hotmail.de> | 2017-09-08 04:31:12 +0200 |
---|---|---|
committer | toger5 <toger5@hotmail.de> | 2017-09-12 23:33:51 +0200 |
commit | ee5dc05a09e50351e93026107abcdb94ef1216a2 (patch) | |
tree | eb68c821e18b8807b1bdac709f2ff601f29343bf /modules/svg/image_loader_svg.h | |
parent | 175777596ec3521731665dd750fd7087793b10fc (diff) |
optimized color conversion for svg generation
Diffstat (limited to 'modules/svg/image_loader_svg.h')
-rw-r--r-- | modules/svg/image_loader_svg.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h index f692b1b28c..332ac214a5 100644 --- a/modules/svg/image_loader_svg.h +++ b/modules/svg/image_loader_svg.h @@ -52,13 +52,17 @@ public: }; class ImageLoaderSVG : public ImageFormatLoader { - + static struct ReplaceColors { + List<uint32_t> old_colors; + List<uint32_t> new_colors; + } replace_colors; static SVGRasterizer rasterizer; - static void _convert_colors(NSVGimage *p_svg_imge, const Dictionary p_colors); - static Error _create_image(Ref<Image> p_image, const PoolVector<uint8_t> *p_data, float p_scale, bool upsample, const Dictionary *p_replace_color = NULL); + static void _convert_colors(NSVGimage *p_svg_imge); + static Error _create_image(Ref<Image> p_image, const PoolVector<uint8_t> *p_data, float p_scale, bool upsample, bool convert_colors = false); public: - static Error create_image_from_string(Ref<Image> p_image, const char *p_svg_str, float p_scale, bool upsample, const Dictionary *p_replace_color = NULL); + static void set_convert_colors(Dictionary *p_replace_color = NULL); + static Error create_image_from_string(Ref<Image> p_image, const char *p_svg_str, float p_scale, bool upsample, bool convert_colors = false); virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale); virtual void get_recognized_extensions(List<String> *p_extensions) const; |