libsdfio
1.0.0
Reader and writer for ISO 25178-71 SDF surface data files in C
Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2026 Thomas Ascher <thomas.ascher@gmx.at>
3
*
4
* SPDX-License-Identifier: MIT
5
*/
6
11
12
#ifndef SDFIO_HEADER_H
13
#define SDFIO_HEADER_H
14
15
#include <sdfio/sdfio_export.h>
16
#include <
sdfio/types.h
>
17
18
#include <stdbool.h>
19
#include <stdint.h>
20
#include <time.h>
21
22
#ifdef __cplusplus
23
extern
"C"
24
{
25
#endif
26
42
typedef
struct
sdfio_header
sdfio_header
;
43
64
SDFIO_API
sdfio_status
sdfio_header_create
(
const
sdfio_allocator
*allocator,
65
sdfio_header
**header);
66
76
SDFIO_API
sdfio_status
sdfio_header_copy
(
sdfio_header
*dst,
77
const
sdfio_header
*src);
78
85
SDFIO_API
void
sdfio_header_free
(
sdfio_header
*header);
86
92
SDFIO_API
sdfio_revision
sdfio_header_revision
(
const
sdfio_header
*header);
93
102
SDFIO_API
sdfio_status
sdfio_header_set_revision
(
sdfio_header
*header,
103
sdfio_revision
revision);
104
110
SDFIO_API
sdfio_format
sdfio_header_format
(
const
sdfio_header
*header);
111
120
SDFIO_API
sdfio_status
sdfio_header_set_format
(
sdfio_header
*header,
121
sdfio_format
format);
122
128
SDFIO_API
sdfio_data_type
sdfio_header_data_type
(
const
sdfio_header
*header);
129
138
SDFIO_API
sdfio_status
sdfio_header_set_data_type
(
sdfio_header
*header,
139
sdfio_data_type
data_type);
140
146
SDFIO_API uint32_t
sdfio_header_columns
(
const
sdfio_header
*header);
147
156
SDFIO_API
sdfio_status
sdfio_header_set_columns
(
sdfio_header
*header,
157
uint32_t columns);
158
164
SDFIO_API uint32_t
sdfio_header_rows
(
const
sdfio_header
*header);
165
174
SDFIO_API
sdfio_status
sdfio_header_set_rows
(
sdfio_header
*header,
175
uint32_t rows);
176
182
SDFIO_API
double
sdfio_header_x_scale
(
const
sdfio_header
*header);
183
191
SDFIO_API
sdfio_status
sdfio_header_set_x_scale
(
sdfio_header
*header,
192
double
x_scale);
193
200
SDFIO_API
double
sdfio_header_y_scale
(
const
sdfio_header
*header);
201
210
SDFIO_API
sdfio_status
sdfio_header_set_y_scale
(
sdfio_header
*header,
211
double
y_scale);
212
219
SDFIO_API
double
sdfio_header_z_scale
(
const
sdfio_header
*header);
220
232
SDFIO_API
sdfio_status
sdfio_header_set_z_scale
(
sdfio_header
*header,
233
double
z_scale);
234
242
SDFIO_API
double
sdfio_header_z_resolution
(
const
sdfio_header
*header);
243
252
SDFIO_API
sdfio_status
sdfio_header_set_z_resolution
(
sdfio_header
*header,
253
double
z_resolution);
254
267
SDFIO_API time_t
sdfio_header_created
(
const
sdfio_header
*header);
268
279
SDFIO_API
sdfio_status
sdfio_header_set_created
(
sdfio_header
*header,
280
time_t created);
281
288
SDFIO_API time_t
sdfio_header_modified
(
const
sdfio_header
*header);
289
300
SDFIO_API
sdfio_status
sdfio_header_set_modified
(
sdfio_header
*header,
301
time_t modified);
302
312
SDFIO_API
sdfio_status
sdfio_header_set_dates
(
sdfio_header
*header,
313
time_t date);
314
323
SDFIO_API
const
char
*
sdfio_header_manufacturer
(
const
sdfio_header
*header);
324
335
SDFIO_API
sdfio_status
sdfio_header_set_manufacturer
(
sdfio_header
*header,
336
const
char
*manufacturer);
337
344
SDFIO_API
bool
sdfio_revision_allows
(
sdfio_revision
revision,
345
sdfio_data_type
type);
346
347
#ifdef __cplusplus
348
}
349
#endif
350
351
#endif
/* SDFIO_HEADER_H */
sdfio_header
struct sdfio_header sdfio_header
Header of a file, with the field names of the standard.
Definition
header.h:42
sdfio_header_set_z_scale
sdfio_status sdfio_header_set_z_scale(sdfio_header *header, double z_scale)
Sets the z-scale factor.
sdfio_header_set_manufacturer
sdfio_status sdfio_header_set_manufacturer(sdfio_header *header, const char *manufacturer)
Sets the manufacturer's identifier.
sdfio_header_z_resolution
double sdfio_header_z_resolution(const sdfio_header *header)
Returns the z-resolution: the quantization step of the instrument in metres, or SDFIO_NO_RESOLUTION.
sdfio_header_set_z_resolution
sdfio_status sdfio_header_set_z_resolution(sdfio_header *header, double z_resolution)
Sets the z-resolution.
sdfio_header_set_revision
sdfio_status sdfio_header_set_revision(sdfio_header *header, sdfio_revision revision)
Sets the revision of the format.
sdfio_header_data_type
sdfio_data_type sdfio_header_data_type(const sdfio_header *header)
Returns the data type of the coded values in the data area.
sdfio_header_free
void sdfio_header_free(sdfio_header *header)
Releases a header that sdfio_header_create() created.
sdfio_header_format
sdfio_format sdfio_header_format(const sdfio_header *header)
Returns the format of the file.
sdfio_header_revision
sdfio_revision sdfio_header_revision(const sdfio_header *header)
Returns the revision of the format.
sdfio_header_set_x_scale
sdfio_status sdfio_header_set_x_scale(sdfio_header *header, double x_scale)
Sets the sampling interval along x in metres.
sdfio_header_modified
time_t sdfio_header_modified(const sdfio_header *header)
Returns the last modification date and time.
sdfio_header_created
time_t sdfio_header_created(const sdfio_header *header)
Returns the original creation date and time as a time_t, which is read as integer seconds since 1970-...
sdfio_revision_allows
bool sdfio_revision_allows(sdfio_revision revision, sdfio_data_type type)
Returns true if a revision permits a data type.
sdfio_header_rows
uint32_t sdfio_header_rows(const sdfio_header *header)
Returns the number of rows N of the data matrix: 1 for a profile.
sdfio_header_set_modified
sdfio_status sdfio_header_set_modified(sdfio_header *header, time_t modified)
Sets the last modification date and time.
sdfio_header_create
sdfio_status sdfio_header_create(const sdfio_allocator *allocator, sdfio_header **header)
Creates a header with default values.
sdfio_header_copy
sdfio_status sdfio_header_copy(sdfio_header *dst, const sdfio_header *src)
Copies every field of a header into another header, which keeps its allocator.
sdfio_header_set_created
sdfio_status sdfio_header_set_created(sdfio_header *header, time_t created)
Sets the original creation date and time, rounded down to the minute.
sdfio_header_set_rows
sdfio_status sdfio_header_set_rows(sdfio_header *header, uint32_t rows)
Sets the number of rows N of the data matrix.
sdfio_header_columns
uint32_t sdfio_header_columns(const sdfio_header *header)
Returns the number of columns M of the data matrix: the points along x.
sdfio_header_x_scale
double sdfio_header_x_scale(const sdfio_header *header)
Returns the sampling interval along x in metres (X-scale factor).
sdfio_header_set_format
sdfio_status sdfio_header_set_format(sdfio_header *header, sdfio_format format)
Sets the format of the file.
sdfio_header_manufacturer
const char * sdfio_header_manufacturer(const sdfio_header *header)
Returns the manufacturer's identifier: at most SDFIO_MANUFACTURER_ID_MAX bytes, terminated by a null ...
sdfio_header_set_columns
sdfio_status sdfio_header_set_columns(sdfio_header *header, uint32_t columns)
Sets the number of columns M of the data matrix.
sdfio_header_set_dates
sdfio_status sdfio_header_set_dates(sdfio_header *header, time_t date)
Sets the creation date and the modification date to the same time, rounded down to the minute.
sdfio_header_set_y_scale
sdfio_status sdfio_header_set_y_scale(sdfio_header *header, double y_scale)
Sets the sampling interval along y in metres.
sdfio_header_set_data_type
sdfio_status sdfio_header_set_data_type(sdfio_header *header, sdfio_data_type data_type)
Sets the data type of the coded values in the data area.
sdfio_header_z_scale
double sdfio_header_z_scale(const sdfio_header *header)
Returns the z-scale factor: the height in metres that a coded value of 1 in the data area stands for.
sdfio_header_y_scale
double sdfio_header_y_scale(const sdfio_header *header)
Returns the sampling interval along y in metres (Y-scale factor).
sdfio_allocator
Memory management callbacks that replace malloc() and free(), for example with a pool or a bump alloc...
Definition
types.h:180
types.h
Status codes, enumerations, constants, and the structures for allocator, stream and time zone.
sdfio_revision
sdfio_revision
Revision of the SDF format that a file follows.
Definition
types.h:72
sdfio_format
sdfio_format
Format of a file.
Definition
types.h:81
sdfio_status
sdfio_status
Result of a function call.
Definition
types.h:31
sdfio_data_type
sdfio_data_type
Type of the coded values of the data area of a file, and of the elements of a buffer of heights.
Definition
types.h:112
include
sdfio
header.h
Generated by
1.15.0