PCL
Bitmap File I/O Routines

Functions

void pcl::Bitmap::Load (const String &filePath)
 
void pcl::Bitmap::Save (const String &filePath, int quality=-1) const
 

Detailed Description

Function Documentation

◆ Load()

void pcl::Bitmap::Load ( const String filePath)

Loads a disk image file in this bitmap.

Parameters
filePathFile path to the input image file.

The input file format is always determined by the specified file extension (in filePath). Supported input formats:

BMP Windows Bitmap (.bmp)
GIF Graphics Interchange Format (.gif) (read-only)
ICO Windows Icon Format (.ico)
JPEG Joint Photographic Experts Group (.jpg, .jpeg)
WEBP WebP image format (.webp)
MNG Multiple Network Graphics (.mng) (read-only)
PBM Portable BitMap (.pbm) (read-only)
PNG Portable Network Graphics (.png)
PPM Portable Pixel Map (.ppm)
SVG Scalable Vector Graphics (.svg) (read-only)
TIFF Tagged Image File Format (.tif, .tiff).
TGA Truevision TGA Format (TARGA) (.tga, .tpic).
XBM X BitMap (.xbm)
XPM X PixMap (.xpm)

In the even of file I/O error, or if the specified file cannot be decoded and loaded correctly, this member function throws an Error exception.

◆ Save()

void pcl::Bitmap::Save ( const String filePath,
int  quality = -1 
) const

Saves this bitmap to a disk image file.

Parameters
filePathFile path to the output image file.
qualityImage quality for lossy compression in the range from 0 (lowest quality) to 100 (highest quality). Currently, this parameter is ignored if the output file is not in one of the JPEG or WebP formats. If this parameter is < 0, a default, format-dependent quality will be used.

The output file format is always determined by the specified file extension (in filePath). Supported output formats include:

BMP Windows Bitmap (.bmp)
ICO Windows Icon Format (.ico)
JPEG Joint Photographic Experts Group (.jpg, .jpeg)
WEBP WebP image format (.webp)
PNG Portable Network Graphics (.png)
PPM Portable Pixel Map (.ppm)
TIFF Tagged Image File Format (.tif, .tiff).
XBM X BitMap (.xbm)
XPM X PixMap (.xpm)

In the even of file I/O error, or if the specified file cannot be encoded and written correctly, this member function throws an Error exception.