ppsspp/Core/Screenshot.h

47 lines
1.7 KiB
C
Raw Normal View History

2014-12-21 07:14:46 +00:00
// Copyright (c) 2012- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include "Common/File/Path.h"
2016-09-06 02:14:59 +00:00
struct GPUDebugBuffer;
2016-09-03 22:26:01 +00:00
enum class ScreenshotFormat {
PNG,
JPG,
2014-12-21 07:14:46 +00:00
};
enum ScreenshotType {
// What's being show on screen (e.g. including FPS, etc.)
SCREENSHOT_OUTPUT,
// What the game rendered (e.g. at render resolution) to the display.
2014-12-21 07:14:46 +00:00
SCREENSHOT_DISPLAY,
// What the game is in-progress rendering now.
2014-12-21 07:14:46 +00:00
SCREENSHOT_RENDER,
};
2017-12-22 07:47:49 +00:00
const u8 *ConvertBufferToScreenshot(const GPUDebugBuffer &buf, bool alpha, u8 *&temp, u32 &w, u32 &h);
2016-09-03 22:26:01 +00:00
2017-03-18 18:51:05 +00:00
// Can only be used while in game.
bool TakeGameScreenshot(const Path &filename, ScreenshotFormat fmt, ScreenshotType type, int *width = nullptr, int *height = nullptr, int maxRes = -1);
bool Save888RGBScreenshot(const Path &filename, ScreenshotFormat fmt, const u8 *bufferRGB888, int w, int h);
bool Save8888RGBAScreenshot(const Path &filename, const u8 *bufferRGBA8888, int w, int h);
// Overallocate bufferPNG for better encoding speed.
bool Save8888RGBAScreenshot(std::vector<uint8_t> &bufferPNG, const u8 *bufferRGBA8888, int w, int h);