#include "SerializedBlendMode.hpp" #include SkBlendMode serialized_blend_mode_to_sk_blend_mode(SerializedBlendMode serializedBlendMode) { int skBlendModeStartVal = static_cast(SkBlendMode::kClear); return static_cast(skBlendModeStartVal + static_cast(serializedBlendMode)); } const std::vector& get_blend_mode_useful_list() { static std::vector blendModeList; if(blendModeList.empty()) { std::unordered_set exclusionList = {SerializedBlendMode::BLEND_CLEAR, SerializedBlendMode::BLEND_SRC, SerializedBlendMode::BLEND_DST}; for(uint8_t i = 0; i < static_cast(SerializedBlendMode::BLEND_LAST_MODE); i++) { if(!exclusionList.contains(static_cast(i))) blendModeList.emplace_back(static_cast(i)); } } return blendModeList; } const std::vector& get_blend_mode_useful_name_list() { static std::vector blendModeNameList; if(blendModeNameList.empty()) { for(SerializedBlendMode i : get_blend_mode_useful_list()) blendModeNameList.emplace_back(nlohmann::json(static_cast(i))); } return blendModeNameList; }