目次 - SDL 3.0 API(機能別) - サーフェイスの生成と単純な描画 - SDL_ConvertPixels

SDL_ConvertPixels

ある形式のピクセル群を別の形式に変換してコピーする

ヘッダ

SDL3/SDL_surface.h

構文

bool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch);

引数

intwidthピクセル群の幅
intheightピクセル群の高さ
SDL_PixelFormatsrc_formatコピー元のピクセル形式
const void *srcコピー元のピクセル群
intsrc_pitchコピー元のピクセル群の水平方向のバイト数
SDL_PixelFormatdst_formatコピー先のピクセル形式
void *dst生成したピクセル群を書き込むポインタ
intdst_pitchコピー先のピクセル群の水平方向のバイト数

戻り値

(bool) 成功のとき真, 失敗のとき偽を戻す. SDL_GetError()を呼んで詳細を知ることができる.

スレッドセーフ

同じコピー先のピクセル群を2つのスレッドから同時に使用してはならない. コピー元のピクセル群は複数のスレッドから安全に使用できる.

バージョン

SDL 3.2.0以降

関連項目

SDL Wikiへのリンク

SDL_ConvertPixels - SDL Wiki