Files
Crosspoint/src/util/ScreenshotUtil.h
T
Jon Stieglitz 2f969a93b4 feat: context-aware screenshot filenames with book title (#1589)
## Summary

I love the new screenshot feature but I can tell that soon I'm gonna
have a folder full of screenshots and not know what's what. It would be
great if the folder could self organize.

When a screenshot is taken while reading, the filename would now include
the book title, chapter (EPUB), page number, and progress percentage.

Example: My-Great-Book_ch3_p5_42pct_12345.bmp

* **What is the goal of this PR?** (e.g., Implements the new feature for
file uploading.)
* **What changes are included?**

## Additional Context

* Non-reader screens keep the existing screenshot-<millis>.bmp naming.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< YES >**_

I reviewed all the changes but I don't have any experience with this
project so this is my best guess
2026-04-30 13:56:45 -05:00

16 lines
380 B
C++

#pragma once
#include <GfxRenderer.h>
#include <cstddef>
#include "ScreenshotInfo.h"
class ScreenshotUtil {
public:
static void takeScreenshot(GfxRenderer& renderer);
static bool saveFramebufferAsBmp(const char* filename, const uint8_t* framebuffer, int width, int height);
private:
static void buildFilename(const ScreenshotInfo& info, char* buf, size_t bufSize);
};