SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
io.h File Reference

Image saving/loading. More...

#include "image.h"
#include <string>

Go to the source code of this file.

Functions

void satdump::image::save_png (Image &img, std::string file, bool fast=true)
 Save an image to a PNG file.
void satdump::image::load_png (Image &img, std::string file, bool disableIndexing=false)
 Load an image from a PNG file.
void satdump::image::load_png (Image &img, uint8_t *buffer, int size, bool disableIndexing=false)
 Load an image from a PNG buffer.
void satdump::image::load_jpeg (Image &img, std::string file)
 Load an image from a JPEG (8-bit!) file.
void satdump::image::load_jpeg (Image &img, uint8_t *buffer, int size)
 Load an image from a JPEG (8-bit!) buffer.
void satdump::image::save_jpeg (Image &img, std::string file)
 Save an image to a JPEG (8-bit!) file.
void satdump::image::save_tiff (Image &img, std::string file)
 Save an image to a TIFF file. Supports part of GeoTIFF specification.
void satdump::image::load_tiff (Image &img, std::string file)
 Load an image from a TIFF file. Supports part of GeoTIFF specification.
void satdump::image::save_pbm (Image &img, std::string file)
 Save an image to a PBM (and similar) file.
void satdump::image::load_pbm (Image &img, std::string file)
 Load an image from a PBM (and similar) file.
void satdump::image::save_j2k (Image &img, std::string file)
 Save an image to a JPEG2000 file.
void satdump::image::load_j2k (Image &img, std::string file)
 Load an image from a JPEG2000 file.
void satdump::image::save_qoi (Image &img, std::string file)
 Save an image to a QOI file.
void satdump::image::load_qoi (Image &img, std::string file)
 Load an image from a QOI file.
void satdump::image::load_img (Image &img, std::string file)
 Load an image from an image file, automatically from the right format if supported.
void satdump::image::load_img (Image &img, uint8_t *buffer, int size)
 Load an image from a memory buffer automatically from the right format if supported.
void satdump::image::save_img (Image &img, std::string file, bool fast=true)
 Save an image to an image file automatically to the right format if supported.
void satdump::image::save_img_safe (Image &img, std::string file, bool fast=true)
 Save an image to an image file automatically to the right format if supported. This variant will NOT override existing files.
bool satdump::image::append_ext (std::string *file, bool prod=false)
 Append default image file format extension as configured in satdump_cfg.json.

Detailed Description

Image saving/loading.

Function Documentation

◆ append_ext()

bool satdump::image::append_ext ( std::string * file,
bool prod = false )

Append default image file format extension as configured in satdump_cfg.json.

Parameters
filepath of the image (with or without extension)
prodif true, returns the default file extesions for product images
Returns
true if there's already an extension

◆ load_img() [1/2]

void satdump::image::load_img ( Image & img,
std::string file )

Load an image from an image file, automatically from the right format if supported.

Parameters
imgimage to load to
filefilepath to load the image from

◆ load_img() [2/2]

void satdump::image::load_img ( Image & img,
uint8_t * buffer,
int size )

Load an image from a memory buffer automatically from the right format if supported.

Parameters
imgimage to load to
bufferbuffer to load the image from
sizesize of the buffer

◆ load_j2k()

void satdump::image::load_j2k ( Image & img,
std::string file )

Load an image from a JPEG2000 file.

Parameters
imgimage to load to
filefilepath to load the image from

◆ load_jpeg() [1/2]

void satdump::image::load_jpeg ( Image & img,
std::string file )

Load an image from a JPEG (8-bit!) file.

Parameters
imgimage to load to
filefilepath to load the image from

◆ load_jpeg() [2/2]

void satdump::image::load_jpeg ( Image & img,
uint8_t * buffer,
int size )

Load an image from a JPEG (8-bit!) buffer.

Parameters
imgimage to load to
bufferbuffer to load the image from
sizesize of the buffer

◆ load_pbm()

void satdump::image::load_pbm ( Image & img,
std::string file )

Load an image from a PBM (and similar) file.

Parameters
imgimage to load to
filefilepath to load the image from

◆ load_png() [1/2]

void satdump::image::load_png ( Image & img,
std::string file,
bool disableIndexing = false )

Load an image from a PNG file.

Parameters
imgimage to load to
filefilepath to load the image from
disableIndexingignore palette, as to get grayscale

◆ load_png() [2/2]

void satdump::image::load_png ( Image & img,
uint8_t * buffer,
int size,
bool disableIndexing = false )

Load an image from a PNG buffer.

Parameters
imgimage to load to
bufferbuffer to load the image from
sizesize of the buffer
disableIndexingignore palette, as to get grayscale

◆ load_qoi()

void satdump::image::load_qoi ( Image & img,
std::string file )

Load an image from a QOI file.

Parameters
imgimage to load to
filefilepath to load the image from

◆ load_tiff()

void satdump::image::load_tiff ( Image & img,
std::string file )

Load an image from a TIFF file. Supports part of GeoTIFF specification.

Parameters
imgimage to load to
filefilepath to load the image from

◆ save_img()

void satdump::image::save_img ( Image & img,
std::string file,
bool fast = true )

Save an image to an image file automatically to the right format if supported.

Parameters
imgimage to save
filefilepath to save the image to with extension
fastwhether to save using fast mode (slightly worse compression on PNG) or not

◆ save_img_safe()

void satdump::image::save_img_safe ( Image & img,
std::string file,
bool fast = true )

Save an image to an image file automatically to the right format if supported. This variant will NOT override existing files.

Parameters
imgimage to save
filefilepath to save the image to with extension
fastwhether to save using fast mode (slightly worse compression on PNG) or not

◆ save_j2k()

void satdump::image::save_j2k ( Image & img,
std::string file )

Save an image to a JPEG2000 file.

Parameters
imgimage to save
filefilepath to save the image to with extension

◆ save_jpeg()

void satdump::image::save_jpeg ( Image & img,
std::string file )

Save an image to a JPEG (8-bit!) file.

Parameters
imgimage to save
filefilepath to save the image to with extension

◆ save_pbm()

void satdump::image::save_pbm ( Image & img,
std::string file )

Save an image to a PBM (and similar) file.

Parameters
imgimage to save
filefilepath to save the image to with extension

◆ save_png()

void satdump::image::save_png ( Image & img,
std::string file,
bool fast = true )

Save an image to a PNG file.

Parameters
imgimage to save
filefilepath to save the image to with extension
fastwhether to save using fast mode (slightly worse compression) or not

◆ save_qoi()

void satdump::image::save_qoi ( Image & img,
std::string file )

Save an image to a QOI file.

Parameters
imgimage to save
filefilepath to save the image to with extension

◆ save_tiff()

void satdump::image::save_tiff ( Image & img,
std::string file )

Save an image to a TIFF file. Supports part of GeoTIFF specification.

Parameters
imgimage to save
filefilepath to save the image to with extension