Jazz2::Compatibility::J2vRecompressor class

Public static functions

static auto Recompress(StringView sourcePath, StringView targetPath, std::int32_t downscale) -> bool
Decodes sourcePath, downscales it by downscale and writes it to targetPath.
static auto DecodeFrames(StringView sourcePath, Function<bool(const J2vVideoInfo& info, std::int32_t frameIndex, const std::uint8_t* indices, const std::uint8_t* palette, bool paletteChanged)>&& onFrame, J2vVideoInfo* info = nullptr) -> bool
Decodes every frame of an original cinematic.

Function documentation

static bool Jazz2::Compatibility::J2vRecompressor::DecodeFrames(StringView sourcePath, Function<bool(const J2vVideoInfo& info, std::int32_t frameIndex, const std::uint8_t* indices, const std::uint8_t* palette, bool paletteChanged)>&& onFrame, J2vVideoInfo* info = nullptr)

Decodes every frame of an original cinematic.

onFrame receives each frame as palette indices at the video's full resolution together with the palette in effect (256 entries of R, G, B, X), whether the palette changed with this frame (always for the first one), and returns false to stop. The frame buffer is reused for the next frame.