OpenTTD Source 20260206-master-g4d4e37dbf1
ScreenshotProvider Class Referenceabstract

Base interface for a SoundLoader implementation. More...

#include <screenshot_type.h>

Inheritance diagram for ScreenshotProvider:
PriorityBaseProvider< ScreenshotProvider > BaseProvider< ScreenshotProvider > ScreenshotProvider_Bmp ScreenshotProvider_Pcx ScreenshotProvider_Png

Public Member Functions

 ScreenshotProvider (std::string_view name, std::string_view description, int priority)
virtual bool MakeImage (std::string_view name, const ScreenshotCallback &callb, uint w, uint h, int pixelformat, const Colour *palette) const =0
 Create and write an image to a file.
Public Member Functions inherited from PriorityBaseProvider< ScreenshotProvider >
constexpr PriorityBaseProvider (std::string_view name, std::string_view description, int priority)
int GetPriority () const
Public Member Functions inherited from BaseProvider< ScreenshotProvider >
constexpr BaseProvider (std::string_view name, std::string_view description)
std::string_view GetName () const
std::string_view GetDescription () const

Additional Inherited Members

Protected Attributes inherited from PriorityBaseProvider< ScreenshotProvider >
const int priority
Protected Attributes inherited from BaseProvider< ScreenshotProvider >
const std::string_view name
const std::string_view description

Detailed Description

Base interface for a SoundLoader implementation.

Definition at line 27 of file screenshot_type.h.

Constructor & Destructor Documentation

◆ ScreenshotProvider()

ScreenshotProvider::ScreenshotProvider ( std::string_view name,
std::string_view description,
int priority )
inline

Definition at line 29 of file screenshot_type.h.

◆ ~ScreenshotProvider()

ScreenshotProvider::~ScreenshotProvider ( )
inlineoverride

Definition at line 34 of file screenshot_type.h.

Member Function Documentation

◆ MakeImage()

virtual bool ScreenshotProvider::MakeImage ( std::string_view name,
const ScreenshotCallback & callb,
uint w,
uint h,
int pixelformat,
const Colour * palette ) const
pure virtual

Create and write an image to a file.

Parameters
nameThe file name to write to.
callbThe callback that fills a buffer with pixel data.
wThe width of the image.
hThe height of the image.
pixelformatThe number of bits per pixel for the image.
paletteThe palette that is currently being used.
Returns
Whether writing the image was successful of not.

Implemented in ScreenshotProvider_Bmp, ScreenshotProvider_Pcx, and ScreenshotProvider_Png.


The documentation for this class was generated from the following file: