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>`.
17typedef struct MR_std_string MR_std_string; // Defined in `#include <MRCMisc/std_string.h>`.
18
19
25
33
41
47
50
53
58
62
67
72
76
81
82// size of internal data in file
87
88// size of internal data in file
92
93// size of internal data in file
98
99// size of image if not layered, otherwise size of layer
104
105// size of image if not layered, otherwise size of layer
109
110// size of image if not layered, otherwise size of layer
115
119
124
128
131
134
139
143
148
151
154
160
165
166// true if tif file is tiled
171
172// true if tif file is tiled
176
177// true if tif file is tiled
182
187
191
196
201
205
210
211// tile depth (if several layers)
216
217// tile depth (if several layers)
221
222// tile depth (if several layers)
227
231
236
239
242
246
249
254
257
260
266
271
272// returns true if given file is tiff
275MRC_API bool MR_isTIFFFile(const char *path, const char *path_end);
276
277// reads parameters of tiff file
282
283// main output data, should be allocated
287MRC_API unsigned char *const *MR_RawTiffOutput_Get_bytes(const MR_RawTiffOutput *_this);
288
289// main output data, should be allocated
292MRC_API void MR_RawTiffOutput_Set_bytes(MR_RawTiffOutput *_this, unsigned char *value);
293
294// main output data, should be allocated
299
300// allocated data size
305
306// allocated data size
310
311// allocated data size
316
317// optional params output
322
323// optional params output
327
328// optional params output
333
334// optional pixel to world transform
339
340// optional pixel to world transform
344
345// optional pixel to world transform
350
351// input if true loads tiff file as floats array
356
357// input if true loads tiff file as floats array
361
362// input if true loads tiff file as floats array
367
368// min max
373
374// min max
378
379// min max
384
389
393
398
402
407
410MRC_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);
411
414
417
422
425
428
434
435// load values from tiff to ouput.data
440MRC_API MR_expected_void_std_string *MR_readRawTiff(const char *path, const char *path_end, MR_RawTiffOutput *output);
441
446
451
456
457// optional transformation data written to GeoTIFF's ModelTransformationTag
462
463// optional transformation data written to GeoTIFF's ModelTransformationTag
467
468// optional transformation data written to GeoTIFF's ModelTransformationTag
473
474// optional NoData value written to GDAL_NODATA
479
480// optional NoData value written to GDAL_NODATA
485MRC_API void MR_WriteRawTiffParams_Set_noData(MR_WriteRawTiffParams *_this, const char *value, const char *value_end);
486
487// optional NoData value written to GDAL_NODATA
492
496
501
507MRC_API MR_WriteRawTiffParams *MR_WriteRawTiffParams_ConstructFrom(const MR_BaseTiffParameters *baseParams, const MR_AffineXf3f *xf, const char *noData, const char *noData_end);
508
511
514
518
521
524
529
530// writes bytes to tiff file
535MRC_API MR_expected_void_std_string *MR_writeRawTiff_3(const unsigned char *bytes, const char *path, const char *path_end, const MR_WriteRawTiffParams *params);
536
541MRC_DEPRECATED_REASON("use WriteRawTiffParams version instead")
542MRC_API MR_expected_void_std_string *MR_writeRawTiff_4(const unsigned char *bytes, const char *path, const char *path_end, const MR_BaseTiffParameters *params, const MR_AffineXf3f *xf);
543
544#ifdef __cplusplus
545} // extern "C"
546#endif
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:19
struct MR_std_string MR_std_string
Definition MRE57.h:22
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 void MR_WriteRawTiffParams_Set_xf(MR_WriteRawTiffParams *_this, const MR_AffineXf3f *value)
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 MR_WriteRawTiffParams * MR_WriteRawTiffParams_OffsetPtr(const MR_WriteRawTiffParams *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 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)
struct MR_WriteRawTiffParams MR_WriteRawTiffParams
Generated from class MR::WriteRawTiffParams.
Definition MRTiffIO.h:52
MRC_API MR_uint64_t * MR_RawTiffOutput_GetMutable_size(MR_RawTiffOutput *_this)
MRC_API MR_expected_void_std_string * MR_writeRawTiff_3(const unsigned char *bytes, const char *path, const char *path_end, const MR_WriteRawTiffParams *params)
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 MR_std_string * MR_WriteRawTiffParams_GetMutable_noData(MR_WriteRawTiffParams *_this)
MRC_API void MR_WriteRawTiffParams_Set_noData(MR_WriteRawTiffParams *_this, const char *value, const char *value_end)
MRC_API MR_WriteRawTiffParams * MR_WriteRawTiffParams_DefaultConstruct(void)
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 const MR_AffineXf3f *const * MR_WriteRawTiffParams_Get_xf(const MR_WriteRawTiffParams *_this)
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 MR_BaseTiffParameters * MR_WriteRawTiffParams_GetMutable_baseParams(MR_WriteRawTiffParams *_this)
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 MR_WriteRawTiffParams * MR_WriteRawTiffParams_DefaultConstructArray(size_t num_elems)
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:46
MRC_API void MR_TiffParameters_Set_layers(MR_TiffParameters *_this, int value)
MRC_API const MR_std_string * MR_WriteRawTiffParams_Get_noData(const MR_WriteRawTiffParams *_this)
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:49
MRC_API void MR_WriteRawTiffParams_DestroyArray(const MR_WriteRawTiffParams *_this)
Destroys a heap-allocated array of MR_WriteRawTiffParams. Does nothing if the pointer is null.
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 void MR_WriteRawTiffParams_Set_baseParams(MR_WriteRawTiffParams *_this, const MR_BaseTiffParameters *value)
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_WriteRawTiffParams_Destroy(const MR_WriteRawTiffParams *_this)
Destroys a heap-allocated instance of MR_WriteRawTiffParams. Does nothing if the pointer is null.
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:24
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_expected_void_std_string * MR_writeRawTiff_4(const unsigned char *bytes, const char *path, const char *path_end, const MR_BaseTiffParameters *params, const MR_AffineXf3f *xf)
MRC_API MR_WriteRawTiffParams * MR_WriteRawTiffParams_ConstructFromAnother(MR_PassBy _other_pass_by, MR_WriteRawTiffParams *_other)
MRC_API MR_AffineXf3f *const * MR_RawTiffOutput_Get_p2wXf(const MR_RawTiffOutput *_this)
MRC_API MR_WriteRawTiffParams * MR_WriteRawTiffParams_OffsetMutablePtr(MR_WriteRawTiffParams *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_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_AffineXf3f ** MR_WriteRawTiffParams_GetMutable_xf(MR_WriteRawTiffParams *_this)
MRC_API MR_WriteRawTiffParams * MR_WriteRawTiffParams_AssignFromAnother(MR_WriteRawTiffParams *_this, MR_PassBy _other_pass_by, MR_WriteRawTiffParams *_other)
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 const MR_BaseTiffParameters * MR_WriteRawTiffParams_Get_baseParams(const MR_WriteRawTiffParams *_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 MR_WriteRawTiffParams * MR_WriteRawTiffParams_ConstructFrom(const MR_BaseTiffParameters *baseParams, const MR_AffineXf3f *xf, const char *noData, const char *noData_end)
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:35
@ MR_BaseTiffParameters_ValueType_RGBA
Definition MRTiffIO.h:39
@ MR_BaseTiffParameters_ValueType_Unknown
Definition MRTiffIO.h:36
@ MR_BaseTiffParameters_ValueType_Scalar
Definition MRTiffIO.h:37
@ MR_BaseTiffParameters_ValueType_RGB
Definition MRTiffIO.h:38
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:27
@ MR_BaseTiffParameters_SampleType_Uint
Definition MRTiffIO.h:29
@ MR_BaseTiffParameters_SampleType_Float
Definition MRTiffIO.h:31
@ MR_BaseTiffParameters_SampleType_Unknown
Definition MRTiffIO.h:28
@ MR_BaseTiffParameters_SampleType_Int
Definition MRTiffIO.h:30
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
#define MRC_DEPRECATED_REASON(str)
Definition common.h:79
MR_PassBy
Definition common.h:19
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