OpenTTD Source 20241224-master-gee860a5c8e
bmp.cpp File Reference

Read and write support for bmps. More...

#include "stdafx.h"
#include "random_access_file_type.h"
#include "bmp.h"
#include "core/bitmath_func.hpp"
#include "safeguards.h"

Go to the source code of this file.

Functions

static bool BmpRead1 (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 Reads a 1 bpp uncompressed bitmap The bitmap is converted to a 8 bpp bitmap.
 
static bool BmpRead4 (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 Reads a 4 bpp uncompressed bitmap The bitmap is converted to a 8 bpp bitmap.
 
static bool BmpRead4Rle (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 Reads a 4-bit RLE compressed bitmap The bitmap is converted to a 8 bpp bitmap.
 
static bool BmpRead8 (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 Reads a 8 bpp bitmap.
 
static bool BmpRead8Rle (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 Reads a 8-bit RLE compressed bpp bitmap.
 
static bool BmpRead24 (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 Reads a 24 bpp uncompressed bitmap.
 
bool BmpReadHeader (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 
bool BmpReadBitmap (RandomAccessFile &file, BmpInfo &info, BmpData &data)
 

Detailed Description

Read and write support for bmps.

Definition in file bmp.cpp.

Function Documentation

◆ BmpRead1()

static bool BmpRead1 ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)
inlinestatic

Reads a 1 bpp uncompressed bitmap The bitmap is converted to a 8 bpp bitmap.

Definition at line 21 of file bmp.cpp.

References RandomAccessFile::AtEndOfFile(), GB(), BmpInfo::height, RandomAccessFile::ReadByte(), RandomAccessFile::SkipBytes(), and BmpInfo::width.

◆ BmpRead24()

static bool BmpRead24 ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)
inlinestatic

Reads a 24 bpp uncompressed bitmap.

Definition at line 223 of file bmp.cpp.

References RandomAccessFile::AtEndOfFile(), GB(), BmpInfo::height, RandomAccessFile::ReadByte(), RandomAccessFile::SkipBytes(), and BmpInfo::width.

◆ BmpRead4()

static bool BmpRead4 ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)
inlinestatic

Reads a 4 bpp uncompressed bitmap The bitmap is converted to a 8 bpp bitmap.

Definition at line 45 of file bmp.cpp.

References RandomAccessFile::AtEndOfFile(), GB(), BmpInfo::height, RandomAccessFile::ReadByte(), RandomAccessFile::SkipBytes(), and BmpInfo::width.

◆ BmpRead4Rle()

static bool BmpRead4Rle ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)
inlinestatic

Reads a 4-bit RLE compressed bitmap The bitmap is converted to a 8 bpp bitmap.

Definition at line 71 of file bmp.cpp.

References RandomAccessFile::AtEndOfFile(), GB(), BmpInfo::height, RandomAccessFile::ReadByte(), RandomAccessFile::SkipBytes(), and BmpInfo::width.

◆ BmpRead8()

static bool BmpRead8 ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)
inlinestatic

◆ BmpRead8Rle()

static bool BmpRead8Rle ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)
inlinestatic

Reads a 8-bit RLE compressed bpp bitmap.

Definition at line 161 of file bmp.cpp.

References RandomAccessFile::AtEndOfFile(), BmpInfo::height, RandomAccessFile::ReadByte(), RandomAccessFile::SkipBytes(), and BmpInfo::width.

◆ BmpReadBitmap()

bool BmpReadBitmap ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)

Definition at line 317 of file bmp.cpp.

◆ BmpReadHeader()

bool BmpReadHeader ( RandomAccessFile file,
BmpInfo info,
BmpData data 
)

Definition at line 244 of file bmp.cpp.