Rise
The Vieneo Province
Toggle main menu visibility
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
9
struct
GifAnimationFrame
10
{
11
std::vector<std::uint32_t>
pixels
;
// Straight-alpha BGRA, full logical canvas.
12
std::uint64_t
endMilliseconds
= 0;
13
};
14
15
struct
GifAnimation
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
25
class
GifAnimationDecoder
26
{
27
public
:
28
GifAnimationDecoder
();
29
~GifAnimationDecoder
();
30
GifAnimationDecoder
(
const
GifAnimationDecoder
&) =
delete
;
31
GifAnimationDecoder
&
operator=
(
const
GifAnimationDecoder
&) =
delete
;
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
41
private
:
42
class
Impl
;
43
std::unique_ptr<Impl>
impl_
;
44
};
HRESULT
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
GifAnimationDecoder::Impl
Definition
GifAnimation.cpp:99
GifAnimationDecoder::GifAnimationDecoder
GifAnimationDecoder()
GifAnimationDecoder::Open
HRESULT Open(const wchar_t *path)
Definition
GifAnimation.cpp:267
GifAnimationDecoder::GifAnimationDecoder
GifAnimationDecoder(const GifAnimationDecoder &)=delete
GifAnimationDecoder::RenderFrame
HRESULT RenderFrame(std::size_t index, const std::vector< std::uint32_t > *&pixels)
Definition
GifAnimation.cpp:304
GifAnimationDecoder::~GifAnimationDecoder
~GifAnimationDecoder()
GifAnimationDecoder::operator=
GifAnimationDecoder & operator=(const GifAnimationDecoder &)=delete
GifAnimationDecoder::Animation
const GifAnimation & Animation() const
Definition
GifAnimation.cpp:298
GifAnimationDecoder::impl_
std::unique_ptr< Impl > impl_
Definition
GifAnimation.h:43
GifAnimationDecoder::Load
static HRESULT Load(const wchar_t *path, GifAnimation &animation)
Definition
GifAnimation.cpp:316
GifAnimationFrame
Definition
GifAnimation.h:10
GifAnimationFrame::pixels
std::vector< std::uint32_t > pixels
Definition
GifAnimation.h:11
GifAnimationFrame::endMilliseconds
std::uint64_t endMilliseconds
Definition
GifAnimation.h:12
GifAnimation
Definition
GifAnimation.h:16
GifAnimation::width
unsigned int width
Definition
GifAnimation.h:17
GifAnimation::frames
std::vector< GifAnimationFrame > frames
Definition
GifAnimation.h:20
GifAnimation::height
unsigned int height
Definition
GifAnimation.h:18
GifAnimation::FrameAt
std::size_t FrameAt(double elapsedSeconds) const
Definition
GifAnimation.cpp:247
GifAnimation::playCount
unsigned int playCount
Definition
GifAnimation.h:19
Rendering
GifAnimation.h
Generated on
for Rise by
1.18.0