34 static Thumbnail *makeWithC64(
const C64 &c64, isize dx = 1, isize dy = 1);
37 void take(
const C64 &c64, isize dx = 1, isize dy = 1);
40struct SnapshotHeader {
55class Snapshot :
public AnyFile {
63 static bool isCompatible(
const fs::path &path);
64 static bool isCompatible(std::istream &stream);
71 Snapshot(
const fs::path &path)
throws { init(path); }
72 Snapshot(
const u8 *buf, isize len)
throws { init(buf, len); }
73 Snapshot(isize capacity);
81 const char *objectName()
const override {
return "Snapshot"; }
88 FileType type()
const override {
return FILETYPE_SNAPSHOT; }
89 bool isCompatiblePath(
const fs::path &path)
override {
return isCompatible(path); }
90 bool isCompatibleStream(std::istream &stream)
override {
return isCompatible(stream); }
91 void finalizeRead() throws override;
98 std::pair <isize,isize> previewImageSize() const override;
99 const u32 *previewImageData() const override;
100 time_t timestamp() const override;
103 bool isTooOld() const;
104 bool isTooNew() const;
106 bool matches() {
return !isTooOld() && !isTooNew(); }
109 SnapshotHeader *getHeader()
const {
return (SnapshotHeader *)data; }
112 const Thumbnail &getThumbnail()
const {
return getHeader()->screenshot; }
115 u8 *getSnapshotData()
const {
return data +
sizeof(SnapshotHeader); }
118 void takeScreenshot(C64 &c64);
static const long height
Height of the emulator texture in texels.
Definition Constants.h:105
static const long width
Width of the emulator texture in texels.
Definition Constants.h:108
VirtualC64 project namespace.
Definition CmdQueue.cpp:16