2019-08-06 22:56:56 -04:00
|
|
|
// Copyright 2019 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-04-27 07:38:28 +03:00
|
|
|
#include <span>
|
2019-08-06 22:56:56 -04:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2023-04-27 07:38:28 +03:00
|
|
|
#include <dds-ktx.h>
|
2019-08-06 22:56:56 -04:00
|
|
|
#include "common/common_types.h"
|
|
|
|
|
|
|
|
namespace Frontend {
|
|
|
|
|
2023-04-27 07:38:28 +03:00
|
|
|
/**
|
|
|
|
* Utility class that provides image decoding/encoding to the custom texture manager.
|
|
|
|
* Can be optionally overriden by frontends to provide a custom implementation.
|
|
|
|
*/
|
2019-08-06 22:56:56 -04:00
|
|
|
class ImageInterface {
|
|
|
|
public:
|
2019-08-07 14:26:25 -04:00
|
|
|
virtual ~ImageInterface() = default;
|
2019-08-07 14:21:47 -04:00
|
|
|
|
2023-04-27 07:38:28 +03:00
|
|
|
virtual bool DecodePNG(std::vector<u8>& dst, u32& width, u32& height, std::span<const u8> src);
|
|
|
|
virtual bool DecodeDDS(std::vector<u8>& dst, u32& width, u32& height, ddsktx_format& format,
|
|
|
|
std::span<const u8> src);
|
|
|
|
virtual bool EncodePNG(const std::string& path, u32 width, u32 height, std::span<const u8> src);
|
2019-08-06 22:56:56 -04:00
|
|
|
};
|
|
|
|
|
2019-10-12 11:25:27 -04:00
|
|
|
} // namespace Frontend
|