OpenTTD Source 20260208-master-g43af8e94d0
ScreenshotProvider_Bmp Class Reference
Inheritance diagram for ScreenshotProvider_Bmp:
ScreenshotProvider PriorityBaseProvider< ScreenshotProvider > BaseProvider< ScreenshotProvider >

Public Member Functions

bool MakeImage (std::string_view name, const ScreenshotCallback &callb, uint w, uint h, int pixelformat, const Colour *palette) const override
 Create and write an image to a file.
Public Member Functions inherited from ScreenshotProvider
 ScreenshotProvider (std::string_view name, std::string_view description, int priority)
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

Static Private Attributes

static ScreenshotProvider_Bmp instance {}

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

Definition at line 42 of file screenshot_bmp.cpp.

Constructor & Destructor Documentation

◆ ScreenshotProvider_Bmp()

ScreenshotProvider_Bmp::ScreenshotProvider_Bmp ( )
inline

Definition at line 44 of file screenshot_bmp.cpp.

Member Function Documentation

◆ MakeImage()

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

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.

Implements ScreenshotProvider.

Definition at line 46 of file screenshot_bmp.cpp.

References Align(), Clamp(), and FileHandle::Open().

Field Documentation

◆ instance

ScreenshotProvider_Bmp ScreenshotProvider_Bmp::instance {}
staticprivate

Definition at line 153 of file screenshot_bmp.cpp.


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