Rise
The Vieneo Province
Loading...
Searching...
No Matches
GifAnimation.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5#include <memory>
6#include <vector>
7#include <Windows.h>
8
10{
11 std::vector<std::uint32_t> pixels; // Straight-alpha BGRA, full logical canvas.
12 std::uint64_t endMilliseconds = 0;
13};
14
16{
17 unsigned int width = 0;
18 unsigned int height = 0;
19 unsigned int playCount = 1; // Zero means repeat indefinitely.
20 std::vector<GifAnimationFrame> frames;
21
22 std::size_t FrameAt(double elapsedSeconds) const;
23};
24
26{
27public:
32
33 HRESULT Open(const wchar_t* path);
34 HRESULT Open(const void* bytes, std::size_t size);
35 const GifAnimation& Animation() const;
36 HRESULT RenderFrame(std::size_t index, const std::vector<std::uint32_t>*& pixels);
37
38 // Materialize small animations for callers that need every frame at once.
39 static HRESULT Load(const wchar_t* path, GifAnimation& animation);
40
41private:
42 class Impl;
43 std::unique_ptr<Impl> impl_;
44};
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
HRESULT Open(const wchar_t *path)
GifAnimationDecoder(const GifAnimationDecoder &)=delete
HRESULT RenderFrame(std::size_t index, const std::vector< std::uint32_t > *&pixels)
GifAnimationDecoder & operator=(const GifAnimationDecoder &)=delete
const GifAnimation & Animation() const
std::unique_ptr< Impl > impl_
static HRESULT Load(const wchar_t *path, GifAnimation &animation)
std::vector< std::uint32_t > pixels
std::uint64_t endMilliseconds
unsigned int width
std::vector< GifAnimationFrame > frames
unsigned int height
std::size_t FrameAt(double elapsedSeconds) const
unsigned int playCount