MeshLib
 
Loading...
Searching...
No Matches
MRImageSave.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRIOFilters.h"
5#include "MRExpected.h"
6#include <filesystem>
7
8namespace MR
9{
10
11struct Image;
12
13namespace ImageSave
14{
15
19
20MRMESH_API extern const IOFilters Filters;
21
23MRMESH_API VoidOrErrStr toBmp( const Image& image, const std::filesystem::path& path );
24
25#ifndef MRMESH_NO_PNG
27MRMESH_API VoidOrErrStr toPng( const Image& image, const std::filesystem::path& path );
28
30MRMESH_API VoidOrErrStr toPng( const Image& image, std::ostream& os );
31#endif
32
33#ifndef MRMESH_NO_JPEG
35MRMESH_API VoidOrErrStr toJpeg( const Image& image, const std::filesystem::path& path );
36#endif
37
38#ifndef __EMSCRIPTEN__
39
40#ifndef MRMESH_NO_TIFF
41MRMESH_API VoidOrErrStr toTiff( const Image& image, const std::filesystem::path& path );
42#endif
43
44#endif
45
47MRMESH_API VoidOrErrStr toAnySupportedFormat( const Image& image, const std::filesystem::path& path );
48
50
51}
52
53}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:23
MRMESH_API VoidOrErrStr toJpeg(const Image &image, const std::filesystem::path &path)
saves in .jpg format
MRMESH_API VoidOrErrStr toBmp(const Image &image, const std::filesystem::path &path)
saves in .bmp format
MRMESH_API VoidOrErrStr toTiff(const Image &image, const std::filesystem::path &path)
MRMESH_API const IOFilters Filters
MRMESH_API VoidOrErrStr toAnySupportedFormat(const Image &image, const std::filesystem::path &path)
detects the format from file extension and save image to it
MRMESH_API VoidOrErrStr toPng(const Image &image, const std::filesystem::path &path)
saves in .png format
MRVIEWER_API void Image(const MR::ImGuiImage &image, const ImVec2 &size, const MR::Color &multColor)
draw image with Y-direction inversed up-down
Definition MRCameraOrientationPlugin.h:7
Expected< void > VoidOrErrStr
return type for a void function that can produce an error string
Definition MRExpected.h:60
Definition MRImage.h:15