Ktx library + ImageLoaderKtx

This commit is contained in:
Vladyslav Baranovskyi
2024-12-06 17:24:48 +02:00
parent 1abfb22b08
commit f6ee1de342
6 changed files with 158 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "ImageLoader.hpp"
struct ktxTexture;
namespace OpenVulkano::Image
{
class ImageLoaderKtx : public IImageLoader
{
public:
std::unique_ptr<Image> loadFromFile(const std::string& filePath) override;
std::unique_ptr<Image> loadFromMemory(const std::vector<uint8_t>& buffer) override;
Math::Vector2i GetImageDimensions(const std::string& filename) override;
protected:
std::unique_ptr<Image> ExtractImage(ktxTexture* texture);
};
}