/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include #include #include namespace Gfx { ImageDecoder::ImageDecoder(const u8* data, size_t size) { m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = make(data, size); if (m_plugin->sniff()) return; m_plugin = nullptr; } ImageDecoder::~ImageDecoder() { } RefPtr ImageDecoder::bitmap() const { if (!m_plugin) return nullptr; return m_plugin->bitmap(); } }