// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Utility module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_UTILITY_IMAGESTREAM_HPP #define NAZARA_UTILITY_IMAGESTREAM_HPP #include #include #include #include #include #include #include #include #include namespace Nz { struct ImageStreamParams : public ResourceParameters { bool IsValid() const; }; class ImageStream; using ImageStreamLoader = ResourceLoader; class NAZARA_UTILITY_API ImageStream : public Resource { public: using Params = ImageStreamParams; ImageStream() = default; virtual ~ImageStream(); virtual bool DecodeNextFrame(void* frameBuffer, Time* frameTime) = 0; virtual UInt64 GetFrameCount() const = 0; virtual PixelFormat GetPixelFormat() const = 0; virtual Vector2ui GetSize() const = 0; virtual void Seek(UInt64 frameIndex) = 0; virtual UInt64 Tell() = 0; static std::shared_ptr OpenFromFile(const std::filesystem::path& filePath, const ImageStreamParams& params = ImageStreamParams()); static std::shared_ptr OpenFromMemory(const void* data, std::size_t size, const ImageStreamParams& params = ImageStreamParams()); static std::shared_ptr OpenFromStream(Stream& stream, const ImageStreamParams& params = ImageStreamParams()); }; } #include #endif // NAZARA_UTILITY_IMAGESTREAM_HPP