MeshLib C Docs
Loading...
Searching...
No Matches
MRTiffIO.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRVector2.h>
4#include <MRCMisc/common.h>
5#include <MRCMisc/exports.h>
6
7#include <stdbool.h>
8#include <stddef.h>
9#include <stdint.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
16typedef struct MR_expected_MR_TiffParameters_std_string MR_expected_MR_TiffParameters_std_string; // Defined in `#include <MRCMisc/expected_MR_TiffParameters_std_string.h>`.
17typedef struct MR_expected_void_std_string MR_expected_void_std_string; // Defined in `#include <MRCMisc/expected_void_std_string.h>`.
18
19
25
27enum // MR_BaseTiffParameters_SampleType
28{
33};
34
36enum // MR_BaseTiffParameters_ValueType
37{
42};
43
49
52
57
61
66
71
75
80
81// size of internal data in file
86
87// size of internal data in file
91
92// size of internal data in file
97
98// size of image if not layered, otherwise size of layer
103
104// size of image if not layered, otherwise size of layer
108
109// size of image if not layered, otherwise size of layer
114
118
123
127
130
133
138
142
147
150
153
159
164
165// true if tif file is tiled
170
171// true if tif file is tiled
175
176// true if tif file is tiled
181
186
190
195
200
204
209
210// tile depth (if several layers)
215
216// tile depth (if several layers)
220
221// tile depth (if several layers)
226
230
235
238
241
245
248
253
256
259
265
270
271// returns true if given file is tiff
274MRC_API bool MR_isTIFFFile(const char *path, const char *path_end);
275
276// reads parameters of tiff file
281
282// main output data, should be allocated
287
288// main output data, should be allocated
292
293// main output data, should be allocated
298
299// allocated data size
304
305// allocated data size
309
310// allocated data size
315
316// optional params output
321
322// optional params output
326
327// optional params output
332
333// optional pixel to world transform
338
339// optional pixel to world transform
343
344// optional pixel to world transform
349
350// input if true loads tiff file as floats array
355
356// input if true loads tiff file as floats array
360
361// input if true loads tiff file as floats array
366
367// min max
372
373// min max
377
378// min max
383
388
392
397
401
406
409MRC_API MR_RawTiffOutput *MR_RawTiffOutput_ConstructFrom(uint8_t *bytes, MR_uint64_t size, MR_TiffParameters *params, MR_AffineXf3f *p2wXf, bool convertToFloat, float *min, float *max);
410
413
416
421
424
427
433
434// load values from tiff to ouput.data
439MRC_API MR_expected_void_std_string *MR_readRawTiff(const char *path, const char *path_end, MR_RawTiffOutput *output);
440
441// writes bytes to tiff file
446MRC_API MR_expected_void_std_string *MR_writeRawTiff(const uint8_t *bytes, const char *path, const char *path_end, const MR_BaseTiffParameters *params);
447
448#ifdef __cplusplus
449} // extern "C"
450#endif
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:20
MRC_API MR_TiffParameters * MR_TiffParameters_AssignFromAnother(MR_TiffParameters *_this, const MR_TiffParameters *_other)
MRC_API void MR_RawTiffOutput_Set_params(MR_RawTiffOutput *_this, MR_TiffParameters *value)
MRC_API void MR_RawTiffOutput_Set_p2wXf(MR_RawTiffOutput *_this, MR_AffineXf3f *value)
MRC_API float ** MR_RawTiffOutput_GetMutable_min(MR_RawTiffOutput *_this)
MRC_API int32_t * MR_TiffParameters_GetMutable_depth(MR_TiffParameters *_this)
MRC_API bool MR_isTIFFFile(const char *path, const char *path_end)
MRC_API MR_BaseTiffParameters * MR_BaseTiffParameters_ConstructFrom(MR_BaseTiffParameters_SampleType sampleType, MR_BaseTiffParameters_ValueType valueType, int32_t bytesPerSample, MR_Vector2i imageSize)
MRC_API bool MR_equal_MR_TiffParameters(const MR_TiffParameters *_this, const MR_TiffParameters *_1)
MRC_API MR_expected_void_std_string * MR_writeRawTiff(const uint8_t *bytes, const char *path, const char *path_end, const MR_BaseTiffParameters *params)
MRC_API MR_TiffParameters * MR_TiffParameters_DefaultConstructArray(size_t num_elems)
MRC_API const bool * MR_TiffParameters_Get_tiled(const MR_TiffParameters *_this)
MRC_API MR_expected_MR_TiffParameters_std_string * MR_readTiffParameters(const char *path, const char *path_end)
MRC_API void MR_BaseTiffParameters_Set_valueType(MR_BaseTiffParameters *_this, MR_BaseTiffParameters_ValueType value)
MRC_API int32_t * MR_TiffParameters_GetMutable_layers(MR_TiffParameters *_this)
MRC_API uint8_t ** MR_RawTiffOutput_GetMutable_bytes(MR_RawTiffOutput *_this)
MRC_API MR_uint64_t * MR_RawTiffOutput_GetMutable_size(MR_RawTiffOutput *_this)
MRC_API const bool * MR_RawTiffOutput_Get_convertToFloat(const MR_RawTiffOutput *_this)
MRC_API void MR_RawTiffOutput_Set_convertToFloat(MR_RawTiffOutput *_this, bool value)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_ConstructFrom(uint8_t *bytes, MR_uint64_t size, MR_TiffParameters *params, MR_AffineXf3f *p2wXf, bool convertToFloat, float *min, float *max)
MRC_API MR_TiffParameters * MR_TiffParameters_DefaultConstruct(void)
MRC_API const MR_TiffParameters * MR_TiffParameters_OffsetPtr(const MR_TiffParameters *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_RawTiffOutput_Set_min(MR_RawTiffOutput *_this, float *value)
MRC_API MR_BaseTiffParameters * MR_TiffParameters_MutableUpcastTo_MR_BaseTiffParameters(MR_TiffParameters *object)
Upcasts an instance of MR::TiffParameters to its base class MR::BaseTiffParameters.
MRC_API const MR_uint64_t * MR_RawTiffOutput_Get_size(const MR_RawTiffOutput *_this)
MRC_API void MR_RawTiffOutput_Set_size(MR_RawTiffOutput *_this, MR_uint64_t value)
MRC_API void MR_RawTiffOutput_Destroy(const MR_RawTiffOutput *_this)
Destroys a heap-allocated instance of MR_RawTiffOutput. Does nothing if the pointer is null.
MRC_API bool * MR_TiffParameters_GetMutable_tiled(MR_TiffParameters *_this)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_ConstructFromAnother(const MR_RawTiffOutput *_other)
MRC_API const MR_RawTiffOutput * MR_RawTiffOutput_OffsetPtr(const MR_RawTiffOutput *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
@ MR_BaseTiffParameters_SampleType_Uint
Definition MRTiffIO.h:30
@ MR_BaseTiffParameters_SampleType_Float
Definition MRTiffIO.h:32
@ MR_BaseTiffParameters_SampleType_Unknown
Definition MRTiffIO.h:29
@ MR_BaseTiffParameters_SampleType_Int
Definition MRTiffIO.h:31
MRC_API float *const * MR_RawTiffOutput_Get_min(const MR_RawTiffOutput *_this)
MRC_API const MR_BaseTiffParameters_SampleType * MR_BaseTiffParameters_Get_sampleType(const MR_BaseTiffParameters *_this)
MRC_API const MR_Vector2i * MR_TiffParameters_Get_tileSize(const MR_TiffParameters *_this)
MRC_API MR_expected_void_std_string * MR_readRawTiff(const char *path, const char *path_end, MR_RawTiffOutput *output)
MRC_API const MR_BaseTiffParameters * MR_TiffParameters_UpcastTo_MR_BaseTiffParameters(const MR_TiffParameters *object)
MRC_API MR_BaseTiffParameters * MR_BaseTiffParameters_DefaultConstruct(void)
struct MR_TiffParameters MR_TiffParameters
Definition MRTiffIO.h:48
MRC_API MR_BaseTiffParameters_SampleType * MR_BaseTiffParameters_GetMutable_sampleType(MR_BaseTiffParameters *_this)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_AssignFromAnother(MR_RawTiffOutput *_this, const MR_RawTiffOutput *_other)
MRC_API MR_TiffParameters * MR_TiffParameters_ConstructFromAnother(const MR_TiffParameters *_other)
struct MR_RawTiffOutput MR_RawTiffOutput
Generated from class MR::RawTiffOutput.
Definition MRTiffIO.h:51
MRC_API void MR_TiffParameters_Destroy(const MR_TiffParameters *_this)
Destroys a heap-allocated instance of MR_TiffParameters. Does nothing if the pointer is null.
MRC_API const MR_Vector2i * MR_BaseTiffParameters_Get_imageSize(const MR_BaseTiffParameters *_this)
MRC_API MR_BaseTiffParameters * MR_BaseTiffParameters_OffsetMutablePtr(MR_BaseTiffParameters *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_BaseTiffParameters * MR_BaseTiffParameters_ConstructFromAnother(const MR_BaseTiffParameters *_other)
MRC_API float ** MR_RawTiffOutput_GetMutable_max(MR_RawTiffOutput *_this)
struct MR_BaseTiffParameters MR_BaseTiffParameters
Definition MRTiffIO.h:24
MRC_API void MR_BaseTiffParameters_DestroyArray(const MR_BaseTiffParameters *_this)
Destroys a heap-allocated array of MR_BaseTiffParameters. Does nothing if the pointer is null.
MRC_API uint8_t *const * MR_RawTiffOutput_Get_bytes(const MR_RawTiffOutput *_this)
MRC_API const MR_BaseTiffParameters * MR_BaseTiffParameters_OffsetPtr(const MR_BaseTiffParameters *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API bool MR_equal_MR_BaseTiffParameters(const MR_BaseTiffParameters *_this, const MR_BaseTiffParameters *_1)
MRC_API MR_AffineXf3f *const * MR_RawTiffOutput_Get_p2wXf(const MR_RawTiffOutput *_this)
@ MR_BaseTiffParameters_ValueType_RGBA
Definition MRTiffIO.h:41
@ MR_BaseTiffParameters_ValueType_Unknown
Definition MRTiffIO.h:38
@ MR_BaseTiffParameters_ValueType_Scalar
Definition MRTiffIO.h:39
@ MR_BaseTiffParameters_ValueType_RGB
Definition MRTiffIO.h:40
MRC_API MR_TiffParameters * MR_BaseTiffParameters_MutableStaticDowncastTo_MR_TiffParameters(MR_BaseTiffParameters *object)
MRC_API MR_BaseTiffParameters_ValueType * MR_BaseTiffParameters_GetMutable_valueType(MR_BaseTiffParameters *_this)
MRC_API void MR_TiffParameters_DestroyArray(const MR_TiffParameters *_this)
Destroys a heap-allocated array of MR_TiffParameters. Does nothing if the pointer is null.
MRC_API float *const * MR_RawTiffOutput_Get_max(const MR_RawTiffOutput *_this)
MRC_API const MR_TiffParameters * MR_BaseTiffParameters_StaticDowncastTo_MR_TiffParameters(const MR_BaseTiffParameters *object)
MRC_API void MR_RawTiffOutput_Set_max(MR_RawTiffOutput *_this, float *value)
MRC_API void MR_RawTiffOutput_DestroyArray(const MR_RawTiffOutput *_this)
Destroys a heap-allocated array of MR_RawTiffOutput. Does nothing if the pointer is null.
MRC_API MR_Vector2i * MR_BaseTiffParameters_GetMutable_imageSize(MR_BaseTiffParameters *_this)
MRC_API MR_TiffParameters *const * MR_RawTiffOutput_Get_params(const MR_RawTiffOutput *_this)
MRC_API void MR_RawTiffOutput_Set_bytes(MR_RawTiffOutput *_this, uint8_t *value)
MRC_API void MR_TiffParameters_Set_tileSize(MR_TiffParameters *_this, MR_Vector2i value)
MRC_API MR_AffineXf3f ** MR_RawTiffOutput_GetMutable_p2wXf(MR_RawTiffOutput *_this)
MRC_API MR_BaseTiffParameters * MR_BaseTiffParameters_DefaultConstructArray(size_t num_elems)
int32_t MR_BaseTiffParameters_SampleType
Definition MRTiffIO.h:26
MRC_API const int32_t * MR_BaseTiffParameters_Get_bytesPerSample(const MR_BaseTiffParameters *_this)
MRC_API MR_TiffParameters ** MR_RawTiffOutput_GetMutable_params(MR_RawTiffOutput *_this)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_DefaultConstruct(void)
MRC_API MR_TiffParameters * MR_TiffParameters_OffsetMutablePtr(MR_TiffParameters *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_BaseTiffParameters_Set_sampleType(MR_BaseTiffParameters *_this, MR_BaseTiffParameters_SampleType value)
MRC_API void MR_TiffParameters_Set_layers(MR_TiffParameters *_this, int32_t value)
MRC_API void MR_BaseTiffParameters_Set_bytesPerSample(MR_BaseTiffParameters *_this, int32_t value)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_OffsetMutablePtr(MR_RawTiffOutput *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const int32_t * MR_TiffParameters_Get_layers(const MR_TiffParameters *_this)
MRC_API MR_Vector2i * MR_TiffParameters_GetMutable_tileSize(MR_TiffParameters *_this)
MRC_API int32_t * MR_BaseTiffParameters_GetMutable_bytesPerSample(MR_BaseTiffParameters *_this)
int32_t MR_BaseTiffParameters_ValueType
Definition MRTiffIO.h:35
MRC_API void MR_BaseTiffParameters_Destroy(const MR_BaseTiffParameters *_this)
Destroys a heap-allocated instance of MR_BaseTiffParameters. Does nothing if the pointer is null.
MRC_API MR_BaseTiffParameters * MR_BaseTiffParameters_AssignFromAnother(MR_BaseTiffParameters *_this, const MR_BaseTiffParameters *_other)
MRC_API const int32_t * MR_TiffParameters_Get_depth(const MR_TiffParameters *_this)
MRC_API void MR_TiffParameters_Set_depth(MR_TiffParameters *_this, int32_t value)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_DefaultConstructArray(size_t num_elems)
MRC_API void MR_BaseTiffParameters_Set_imageSize(MR_BaseTiffParameters *_this, MR_Vector2i value)
MRC_API const MR_BaseTiffParameters_ValueType * MR_BaseTiffParameters_Get_valueType(const MR_BaseTiffParameters *_this)
MRC_API void MR_TiffParameters_Set_tiled(MR_TiffParameters *_this, bool value)
MRC_API bool * MR_RawTiffOutput_GetMutable_convertToFloat(MR_RawTiffOutput *_this)
struct MR_expected_MR_TiffParameters_std_string MR_expected_MR_TiffParameters_std_string
Definition MRTiffIO.h:16
uint64_t MR_uint64_t
Definition common.h:14
#define MRC_API
Definition exports.h:11
size_t size() const
Definition MRAffineXf.h:36
Definition MRVector2.h:28