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
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
15typedef struct MR_expected_MR_TiffParameters_std_string MR_expected_MR_TiffParameters_std_string; // Defined in `#include <MRCMisc/expected_MR_TiffParameters_std_string.h>`.
16typedef struct MR_expected_void_std_string MR_expected_void_std_string; // Defined in `#include <MRCMisc/expected_void_std_string.h>`.
17
18
24
32
40
46
49
54
58
63
68
72
77
78// size of internal data in file
83
84// size of internal data in file
88
89// size of internal data in file
94
95// size of image if not layered, otherwise size of layer
100
101// size of image if not layered, otherwise size of layer
105
106// size of image if not layered, otherwise size of layer
111
115
120
124
127
130
135
139
144
147
150
156
161
162// true if tif file is tiled
167
168// true if tif file is tiled
172
173// true if tif file is tiled
178
183
187
192
197
201
206
207// tile depth (if several layers)
212
213// tile depth (if several layers)
217
218// tile depth (if several layers)
223
227
232
235
238
242
245
250
253
256
262
267
268// returns true if given file is tiff
271MRC_API bool MR_isTIFFFile(const char *path, const char *path_end);
272
273// reads parameters of tiff file
278
279// main output data, should be allocated
283MRC_API unsigned char *const *MR_RawTiffOutput_Get_bytes(const MR_RawTiffOutput *_this);
284
285// main output data, should be allocated
288MRC_API void MR_RawTiffOutput_Set_bytes(MR_RawTiffOutput *_this, unsigned char *value);
289
290// main output data, should be allocated
295
296// allocated data size
301
302// allocated data size
306
307// allocated data size
312
313// optional params output
318
319// optional params output
323
324// optional params output
329
330// optional pixel to world transform
335
336// optional pixel to world transform
340
341// optional pixel to world transform
346
347// input if true loads tiff file as floats array
352
353// input if true loads tiff file as floats array
357
358// input if true loads tiff file as floats array
363
364// min max
369
370// min max
374
375// min max
380
385
389
394
398
403
406MRC_API MR_RawTiffOutput *MR_RawTiffOutput_ConstructFrom(unsigned char *bytes, MR_uint64_t size, MR_TiffParameters *params, MR_AffineXf3f *p2wXf, bool convertToFloat, float *min, float *max);
407
410
413
418
421
424
430
431// load values from tiff to ouput.data
436MRC_API MR_expected_void_std_string *MR_readRawTiff(const char *path, const char *path_end, MR_RawTiffOutput *output);
437
438// writes bytes to tiff file
443MRC_API MR_expected_void_std_string *MR_writeRawTiff(const unsigned char *bytes, const char *path, const char *path_end, const MR_BaseTiffParameters *params);
444
445#ifdef __cplusplus
446} // extern "C"
447#endif
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:19
MRC_API MR_TiffParameters * MR_TiffParameters_AssignFromAnother(MR_TiffParameters *_this, const MR_TiffParameters *_other)
MRC_API void MR_RawTiffOutput_Set_bytes(MR_RawTiffOutput *_this, unsigned char *value)
MRC_API void MR_RawTiffOutput_Set_params(MR_RawTiffOutput *_this, MR_TiffParameters *value)
MRC_API void MR_BaseTiffParameters_Set_bytesPerSample(MR_BaseTiffParameters *_this, int value)
MRC_API MR_RawTiffOutput * MR_RawTiffOutput_ConstructFrom(unsigned char *bytes, MR_uint64_t size, MR_TiffParameters *params, MR_AffineXf3f *p2wXf, bool convertToFloat, float *min, float *max)
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 MR_BaseTiffParameters * MR_BaseTiffParameters_ConstructFrom(MR_BaseTiffParameters_SampleType sampleType, MR_BaseTiffParameters_ValueType valueType, int bytesPerSample, MR_Vector2i imageSize)
MRC_API bool MR_isTIFFFile(const char *path, const char *path_end)
MRC_API bool MR_equal_MR_TiffParameters(const MR_TiffParameters *_this, const MR_TiffParameters *_1)
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 MR_uint64_t * MR_RawTiffOutput_GetMutable_size(MR_RawTiffOutput *_this)
MRC_API const bool * MR_RawTiffOutput_Get_convertToFloat(const MR_RawTiffOutput *_this)
MRC_API const int * MR_TiffParameters_Get_depth(const MR_TiffParameters *_this)
MRC_API void MR_RawTiffOutput_Set_convertToFloat(MR_RawTiffOutput *_this, bool value)
MRC_API int * MR_BaseTiffParameters_GetMutable_bytesPerSample(MR_BaseTiffParameters *_this)
MRC_API const int * MR_TiffParameters_Get_layers(const MR_TiffParameters *_this)
MRC_API unsigned char *const * MR_RawTiffOutput_Get_bytes(const MR_RawTiffOutput *_this)
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...
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:45
MRC_API void MR_TiffParameters_Set_layers(MR_TiffParameters *_this, int value)
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:48
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 MR_expected_void_std_string * MR_writeRawTiff(const unsigned char *bytes, const char *path, const char *path_end, const MR_BaseTiffParameters *params)
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 void MR_TiffParameters_Set_depth(MR_TiffParameters *_this, int value)
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:23
MRC_API const int * MR_BaseTiffParameters_Get_bytesPerSample(const MR_BaseTiffParameters *_this)
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 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 unsigned char ** MR_RawTiffOutput_GetMutable_bytes(MR_RawTiffOutput *_this)
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)
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_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)
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 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 MR_Vector2i * MR_TiffParameters_GetMutable_tileSize(MR_TiffParameters *_this)
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)
MR_BaseTiffParameters_ValueType
Definition MRTiffIO.h:34
@ MR_BaseTiffParameters_ValueType_RGBA
Definition MRTiffIO.h:38
@ MR_BaseTiffParameters_ValueType_Unknown
Definition MRTiffIO.h:35
@ MR_BaseTiffParameters_ValueType_Scalar
Definition MRTiffIO.h:36
@ MR_BaseTiffParameters_ValueType_RGB
Definition MRTiffIO.h:37
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 int * MR_TiffParameters_GetMutable_depth(MR_TiffParameters *_this)
MRC_API const MR_BaseTiffParameters_ValueType * MR_BaseTiffParameters_Get_valueType(const MR_BaseTiffParameters *_this)
MR_BaseTiffParameters_SampleType
Definition MRTiffIO.h:26
@ MR_BaseTiffParameters_SampleType_Uint
Definition MRTiffIO.h:28
@ MR_BaseTiffParameters_SampleType_Float
Definition MRTiffIO.h:30
@ MR_BaseTiffParameters_SampleType_Unknown
Definition MRTiffIO.h:27
@ MR_BaseTiffParameters_SampleType_Int
Definition MRTiffIO.h:29
MRC_API int * MR_TiffParameters_GetMutable_layers(MR_TiffParameters *_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:15
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:27