MeshLib C++ Docs
Loading...
Searching...
No Matches
MRRaster.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRExpected.h"
5#include "MRScalarConvert.h"
6#include "MRVector3.h"
7
8#include <vector>
9
10namespace MR
11{
12
16
19{
21 Vector3i dims;
22
25
28 int channels = 1;
29
31 [[nodiscard]] MRMESH_API size_t dataSize() const;
32
33 bool operator==( const RasterInfo& ) const = default;
34};
35
37struct Raster
38{
40
43 std::vector<uint8_t> data;
44};
45
51
56MR_BIND_IGNORE MRMESH_API Expected<void> convertRasterToFloats( const Raster& raster, float* dst, size_t size );
57
60MRMESH_API Expected<void> convertRasterToFloats( const Raster& raster, std::vector<float>& dst );
61
64{
67 AffineXf3f* xf = nullptr;
70};
71
74{
77 const AffineXf3f* xf = nullptr;
80};
81
83
84}
#define MRMESH_API
Definition MRMeshFwd.h:85
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:789
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:59
ScalarType
scalar value's binary format type
Definition MRScalarConvert.h:14
tl::expected< T, E > Expected
Definition MRExpected.h:31
@ Unknown
Definition MRScalarConvert.h:26
Expected< void > convertRasterToFloats(const Raster &raster, float *dst, size_t size)
Expected< Image > convertRasterToImage(const Raster &raster)
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
everything about a raster except its values
Definition MRRaster.h:19
size_t dataSize() const
returns the size of all values in bytes, or the largest size_t value if the size does not fit in size...
ScalarType type
type of all values
Definition MRRaster.h:24
bool operator==(const RasterInfo &) const =default
int channels
Definition MRRaster.h:28
Vector3i dims
number of pixels along each axis: x is the width, y is the height, z is the number of layers
Definition MRRaster.h:21
settings for loading rasters from external formats
Definition MRRaster.h:64
ProgressCallback progress
to report load progress and cancel loading if user desires
Definition MRRaster.h:69
AffineXf3f * xf
Definition MRRaster.h:67
settings for saving rasters in external formats
Definition MRRaster.h:74
ProgressCallback progress
to report save progress and cancel saving if user desires
Definition MRRaster.h:79
const AffineXf3f * xf
Definition MRRaster.h:77
regular grid of values of any type: an image if it has one layer, otherwise a volume
Definition MRRaster.h:38
std::vector< uint8_t > data
Definition MRRaster.h:43
RasterInfo info
Definition MRRaster.h:39