20 lines
446 B
C++
20 lines
446 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <stop_token>
|
|
#include <vector>
|
|
|
|
namespace ks::files
|
|
{
|
|
struct ImageRaster
|
|
{
|
|
unsigned width{}, height{};
|
|
std::vector<uint32_t> pixels;
|
|
};
|
|
|
|
inline constexpr uint64_t imageSourceLimit=96ULL*1024*1024;
|
|
bool isImagePath(const std::filesystem::path &path);
|
|
ImageRaster decodeImage(const std::filesystem::path &contents,const std::filesystem::path &name,std::stop_token stop={});
|
|
}
|