OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::AnimatedGIFReader Class Reference

GIF アニメーションの読み込み More...

#include <AnimatedGIFReader.hpp>

Public Member Functions

SIV3D_NODISCARD_CXX20 AnimatedGIFReader ()
 デフォルトコンストラクタ More...
 
SIV3D_NODISCARD_CXX20 AnimatedGIFReader (FilePathView path)
 GIF アニメーションファイルを読み込みます。 More...
 
SIV3D_NODISCARD_CXX20 AnimatedGIFReader (IReader &&reader)
 GIF アニメーションデータを読み込みます。 More...
 
 ~AnimatedGIFReader ()
 デストラクタ More...
 
bool open (FilePathView path)
 GIF アニメーションファイルを読み込みます。 More...
 
bool open (IReader &&reader)
 GIF アニメーションデータを読み込みます。 More...
 
void close ()
 読み込んだ GIF アニメーションデータを破棄します。 More...
 
bool isOpen () const noexcept
 GIF アニメーションデータが読み込まれているかを返します。 More...
 
 operator bool () const noexcept
 GIF アニメーションデータが読み込まれているかを返します。 More...
 
bool read (Array< Image > &images, Array< int32 > &delaysMillisec) const
 GIF アニメーションデータをデコードして、結果を配列に格納します。 More...
 
bool read (Array< Image > &images, Array< int32 > &delaysMillisec, int32 &durationMillisec) const
 GIF アニメーションデータをデコードして、結果を配列に格納します。 More...
 

Static Public Member Functions

static size_t MillisecToIndex (int64 timeMillisec, const Array< int32 > &delaysMillisec) noexcept
 時間を GIF アニメーションのフレームインデックスに変換します。 More...
 
static size_t MillisecToIndex (int64 timeMillisec, const Array< int32 > &delaysMillisec, int32 durationMillisec) noexcept
 時間を GIF アニメーションのフレームインデックスに変換します。 More...
 
static size_t GetFrameIndex (double timeSec, const Array< int32 > &delaysMillisec) noexcept
 時間を GIF アニメーションのフレームインデックスに変換します。 More...
 
static size_t GetFrameIndex (double timeSec, const Array< int32 > &delaysMillisec, int32 durationMillisec) noexcept
 時間を GIF アニメーションのフレームインデックスに変換します。 More...
 

Detailed Description

GIF アニメーションの読み込み

Constructor & Destructor Documentation

◆ AnimatedGIFReader() [1/3]

SIV3D_NODISCARD_CXX20 s3d::AnimatedGIFReader::AnimatedGIFReader ( )

デフォルトコンストラクタ

◆ AnimatedGIFReader() [2/3]

SIV3D_NODISCARD_CXX20 s3d::AnimatedGIFReader::AnimatedGIFReader ( FilePathView  path)
explicit

GIF アニメーションファイルを読み込みます。

Parameters
path画像ファイルのパス

◆ AnimatedGIFReader() [3/3]

SIV3D_NODISCARD_CXX20 s3d::AnimatedGIFReader::AnimatedGIFReader ( IReader &&  reader)
explicit

GIF アニメーションデータを読み込みます。

Parameters
reader画像データの IReader インタフェース

◆ ~AnimatedGIFReader()

s3d::AnimatedGIFReader::~AnimatedGIFReader ( )

デストラクタ

Member Function Documentation

◆ close()

void s3d::AnimatedGIFReader::close ( )

読み込んだ GIF アニメーションデータを破棄します。

◆ GetFrameIndex() [1/2]

static size_t s3d::AnimatedGIFReader::GetFrameIndex ( double  timeSec,
const Array< int32 > &  delaysMillisec 
)
staticnoexcept

時間を GIF アニメーションのフレームインデックスに変換します。

Parameters
timeSec時間(秒)
delaysMillisecGIF アニメーションのフレーム時間(ミリ秒)を格納した配列
Returns
時間に対応する GIF アニメーションのフレームインデックス

◆ GetFrameIndex() [2/2]

static size_t s3d::AnimatedGIFReader::GetFrameIndex ( double  timeSec,
const Array< int32 > &  delaysMillisec,
int32  durationMillisec 
)
staticnoexcept

時間を GIF アニメーションのフレームインデックスに変換します。

Parameters
timeSec時間(秒)
delaysMillisecGIF アニメーションのフレーム時間(ミリ秒)を格納した配列
durationMillisecフレームの合計時間(ミリ秒)
Returns
時間に対応する GIF アニメーションのフレームインデックス

◆ isOpen()

bool s3d::AnimatedGIFReader::isOpen ( ) const
noexcept

GIF アニメーションデータが読み込まれているかを返します。

Returns
GIF アニメーションデータが読み込まれている場合 true, それ以外の場合は false

◆ MillisecToIndex() [1/2]

static size_t s3d::AnimatedGIFReader::MillisecToIndex ( int64  timeMillisec,
const Array< int32 > &  delaysMillisec 
)
staticnoexcept

時間を GIF アニメーションのフレームインデックスに変換します。

Parameters
timeMillisec時間(ミリ秒)
delaysMillisecGIF アニメーションのフレーム時間(ミリ秒)を格納した配列
Returns
時間に対応する GIF アニメーションのフレーム位置

◆ MillisecToIndex() [2/2]

static size_t s3d::AnimatedGIFReader::MillisecToIndex ( int64  timeMillisec,
const Array< int32 > &  delaysMillisec,
int32  durationMillisec 
)
staticnoexcept

時間を GIF アニメーションのフレームインデックスに変換します。

Parameters
timeMillisec時間(ミリ秒)
delaysMillisecGIF アニメーションのフレーム時間(ミリ秒)を格納した配列
durationMillisecフレームの合計時間(ミリ秒)
Returns
時間に対応する GIF アニメーションのフレームインデックス

◆ open() [1/2]

bool s3d::AnimatedGIFReader::open ( FilePathView  path)

GIF アニメーションファイルを読み込みます。

Parameters
path画像ファイルのパス
Remarks
以前に読み込んだGIF アニメーションデータは破棄されます。
Returns
ファイルの読み込みに成功した場合 true, それ以外の場合は false

◆ open() [2/2]

bool s3d::AnimatedGIFReader::open ( IReader &&  reader)

GIF アニメーションデータを読み込みます。

Parameters
reader画像データの IReader インタフェース
Remarks
以前に読み込んだGIF アニメーションデータは破棄されます。
Returns
データの読み込みに成功した場合 true, それ以外の場合は false

◆ operator bool()

s3d::AnimatedGIFReader::operator bool ( ) const
explicitnoexcept

GIF アニメーションデータが読み込まれているかを返します。

Remarks
isOpen() と同じです。
Returns
GIF アニメーションデータが読み込まれている場合 true, それ以外の場合は false

◆ read() [1/2]

bool s3d::AnimatedGIFReader::read ( Array< Image > &  images,
Array< int32 > &  delaysMillisec 
) const

GIF アニメーションデータをデコードして、結果を配列に格納します。

Parameters
images結果のフレーム (Image) を格納する配列
delaysMillisecフレーム時間(ミリ秒)を格納する配列
Returns
デコードに成功した場合 true, それ以外の場合は false

◆ read() [2/2]

bool s3d::AnimatedGIFReader::read ( Array< Image > &  images,
Array< int32 > &  delaysMillisec,
int32 durationMillisec 
) const

GIF アニメーションデータをデコードして、結果を配列に格納します。

Parameters
images結果のフレーム (Image) を格納する配列
delaysMillisecフレーム時間(ミリ秒)を格納する配列
durationMillisecフレームの合計時間(ミリ秒)を格納する配列
Remarks
durationMillisec は delaysMillisec.sum() と同じです。
Returns
デコードに成功した場合 true, それ以外の場合は false

The documentation for this class was generated from the following file: