MeshLib
 
Loading...
Searching...
No Matches
MRImageLoad.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRIOFilters.h"
4#include "MRExpected.h"
5#include <filesystem>
6
7namespace MR
8{
9
10struct Image;
11
12namespace ImageLoad
13{
14
18
19MRMESH_API extern const IOFilters Filters;
20
21#ifndef MRMESH_NO_PNG
23MRMESH_API Expected<Image> fromPng( const std::filesystem::path& path );
25#endif
26
27#ifndef MRMESH_NO_JPEG
29MRMESH_API Expected<Image> fromJpeg( const std::filesystem::path& path );
31MRMESH_API Expected<Image> fromJpeg( const char* data, size_t size );
32#endif
33
35MRMESH_API Expected<Image> fromAnySupportedFormat( const std::filesystem::path& path );
36
38
39}
40
41}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:23
MRMESH_API const IOFilters Filters
MRMESH_API Expected< Image > fromPng(const std::filesystem::path &path)
loads from .png format
MRMESH_API Expected< Image > fromJpeg(const std::filesystem::path &path)
loads from .jpg format
MRMESH_API Expected< Image > fromAnySupportedFormat(const std::filesystem::path &path)
detects the format from file extension and loads image from it
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
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
tl::expected< T, E > Expected
Definition MRExpected.h:49