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
27
35
42
49
53
57
62
66
71
76
80
85
86// size of internal data in file
91
92// size of internal data in file
96
97// size of internal data in file
102
103// size of image if not layered, otherwise size of layer
108
109// size of image if not layered, otherwise size of layer
113
114// size of image if not layered, otherwise size of layer
119
123
128
132
135
138
143
147
152
155
158
164
169
170// true if tif file is tiled
175
176// true if tif file is tiled
180
181// true if tif file is tiled
186
191
195
200
205
209
214
215// tile depth (if several layers)
220
221// tile depth (if several layers)
225
226// tile depth (if several layers)
231
236
240
245
250
254
259
260// size of internal data in file
265
266// size of internal data in file
270
271// size of internal data in file
276
277// size of image if not layered, otherwise size of layer
282
283// size of image if not layered, otherwise size of layer
287
288// size of image if not layered, otherwise size of layer
293
297
302
305
308
312
315
320
323
326
332
337
338// returns true if given file is tiff
341MRC_API bool MR_isTIFFFile(const char *path, const char *path_end);
342
343// reads parameters of tiff file
348
349// main output data, should be allocated
353MRC_API unsigned char *const *MR_RawTiffOutput_Get_bytes(const MR_RawTiffOutput *_this);
354
355// main output data, should be allocated
358MRC_API void MR_RawTiffOutput_Set_bytes(MR_RawTiffOutput *_this, unsigned char *value);
359
360// main output data, should be allocated
365
366// allocated data size
371
372// allocated data size
376
377// allocated data size
382
383// optional params output
388
389// optional params output
393
394// optional params output
399
400// optional pixel to world transform
405
406// optional pixel to world transform
410
411// optional pixel to world transform
416
417// input if true loads tiff file as floats array
422
423// input if true loads tiff file as floats array
427
428// input if true loads tiff file as floats array
433
434// min max
439
440// min max
444
445// min max
450
455
459
464
468
473
476MRC_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);
477
480
483
488
491
494
500
501// load values from tiff to ouput.data
506MRC_API MR_expected_void_std_string *MR_readRawTiff(const char *path, const char *path_end, MR_RawTiffOutput *output);
507
512
517
522
523// optional transformation data written to GeoTIFF's ModelTransformationTag
528
529// optional transformation data written to GeoTIFF's ModelTransformationTag
533
534// optional transformation data written to GeoTIFF's ModelTransformationTag
539
540// optional NoData value written to GDAL_NODATA
545
546// optional NoData value written to GDAL_NODATA
551MRC_API void MR_WriteRawTiffParams_Set_noData(MR_WriteRawTiffParams *_this, const char *value, const char *value_end);
552
553// optional NoData value written to GDAL_NODATA
558
562
567
573MRC_API MR_WriteRawTiffParams *MR_WriteRawTiffParams_ConstructFrom(const MR_BaseTiffParameters *baseParams, const MR_AffineXf3f *xf, const char *noData, const char *noData_end);
574
577
580
584
587
590
595
596// writes bytes to tiff file
601MRC_API MR_expected_void_std_string *MR_writeRawTiff_3(const unsigned char *bytes, const char *path, const char *path_end, const MR_WriteRawTiffParams *params);
602
607MRC_DEPRECATED_REASON("use WriteRawTiffParams version instead")
608MRC_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);
609
610#ifdef __cplusplus
611} // extern "C"
612#endif
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:26
struct MR_std_string MR_std_string
Definition MRCtm.h:32
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 MR_Vector2i * MR_TiffParameters_Get_imageSize(const MR_TiffParameters *_this)
MRC_API const bool * MR_TiffParameters_Get_tiled(const MR_TiffParameters *_this)
MRC_API MR_Vector2i * MR_TiffParameters_GetMutable_imageSize(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
Definition MRTiffIO.h:56
MRC_API void MR_TiffParameters_Set_imageSize(MR_TiffParameters *_this, MR_Vector2i value)
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 const int * MR_TiffParameters_Get_bytesPerSample(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 void MR_TiffParameters_Set_valueType(MR_TiffParameters *_this, MR_BaseTiffParameters_ValueType value)
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_BaseTiffParameters_ValueType * MR_TiffParameters_GetMutable_valueType(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:48
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
Definition MRTiffIO.h:52
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:41
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 int * MR_TiffParameters_GetMutable_bytesPerSample(MR_TiffParameters *_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 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 MR_BaseTiffParameters_SampleType * MR_TiffParameters_GetMutable_sampleType(MR_TiffParameters *_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 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 void MR_TiffParameters_Set_bytesPerSample(MR_TiffParameters *_this, int value)
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_sampleType(MR_TiffParameters *_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:29
@ MR_BaseTiffParameters_ValueType_RGBA
Definition MRTiffIO.h:33
@ MR_BaseTiffParameters_ValueType_Unknown
Definition MRTiffIO.h:30
@ MR_BaseTiffParameters_ValueType_Scalar
Definition MRTiffIO.h:31
@ MR_BaseTiffParameters_ValueType_RGB
Definition MRTiffIO.h:32
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:21
@ MR_BaseTiffParameters_SampleType_Uint
Definition MRTiffIO.h:23
@ MR_BaseTiffParameters_SampleType_Float
Definition MRTiffIO.h:25
@ MR_BaseTiffParameters_SampleType_Unknown
Definition MRTiffIO.h:22
@ MR_BaseTiffParameters_SampleType_Int
Definition MRTiffIO.h:24
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
MRC_API const MR_BaseTiffParameters_ValueType * MR_TiffParameters_Get_valueType(const MR_TiffParameters *_this)
MRC_API const MR_BaseTiffParameters_SampleType * MR_TiffParameters_Get_sampleType(const MR_TiffParameters *_this)
#define MRC_DEPRECATED_REASON(str)
Definition common.h:83
MR_PassBy
Definition common.h:23
uint64_t MR_uint64_t
Definition common.h:18
#define MRC_API
Definition exports.h:11
size_t size() const
Definition MRAffineXf.h:39
Definition MRVector2.h:29