eaarl-io
1.0.1+71abbd4
EAARL Input/Output Library (Public API)
|
Read/write support for the TLD file format. More...
#include "eaarlio/error.h"
#include "eaarlio/memory.h"
#include "eaarlio/raster.h"
#include "eaarlio/stream.h"
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | eaarlio_tld_header |
TLD record header. More... | |
Macros | |
#define | EAARLIO_TLD_TYPE_RASTER 5 |
Type value for an EAARL-A/B raster record. More... | |
#define | eaarlio_tld_header_empty() |
Empty eaarlio_tld_header value. More... | |
Functions | |
eaarlio_error | eaarlio_tld_read_record (struct eaarlio_stream *stream, struct eaarlio_tld_header *record_header, struct eaarlio_raster *raster, struct eaarlio_memory *memory, int include_pulses, int include_waveforms) |
Read a TLD record from a stream. More... | |
eaarlio_error | eaarlio_tld_read_raster (struct eaarlio_stream *stream, struct eaarlio_raster *raster, struct eaarlio_memory *memory, int include_pulses, int include_waveforms) |
Read a raster from a TLD stream. More... | |
eaarlio_error | eaarlio_tld_write_raster (struct eaarlio_stream *stream, struct eaarlio_raster *raster, struct eaarlio_memory *memory) |
Write a raster to a TLD stream. More... | |
Read/write support for the TLD file format.
struct eaarlio_tld_header |
TLD record header.
Each record in a TLD file starts with one of these.
Data Fields | ||
---|---|---|
uint32_t | record_length | Byte length of this record (including the header) |
uint8_t | record_type |
Record type. This is always EAARLIO_TLD_TYPE_RASTER (5) for EAARL-A/EAARL-B. |
#define eaarlio_tld_header_empty | ( | ) |
Empty eaarlio_tld_header value.
All fields will contain zero values.
#define EAARLIO_TLD_TYPE_RASTER 5 |
Type value for an EAARL-A/B raster record.
Only records with eaarlio_tld_header::record_type == EAARLIO_TLD_TYPE_RASTER are understood to be rasters by this library.
eaarlio_error eaarlio_tld_read_raster | ( | struct eaarlio_stream * | stream, |
struct eaarlio_raster * | raster, | ||
struct eaarlio_memory * | memory, | ||
int | include_pulses, | ||
int | include_waveforms | ||
) |
Read a raster from a TLD stream.
This function is convenience wrapper around eaarlio_tld_read_record and works nearly identically to it. The differences are:
Please refer to eaarlio_tld_read_record for further documentation.
eaarlio_error eaarlio_tld_read_record | ( | struct eaarlio_stream * | stream, |
struct eaarlio_tld_header * | record_header, | ||
struct eaarlio_raster * | raster, | ||
struct eaarlio_memory * | memory, | ||
int | include_pulses, | ||
int | include_waveforms | ||
) |
Read a TLD record from a stream.
[in] | stream | Stream with data to read |
[out] | record_header | Pointer to record header to be populated |
[out] | raster | Pointer to raster to be populated |
[in] | memory | Memory handler, or NULL for stdlib |
[in] | include_pulses | Should pulse data be read? 1 = yes, 0 = no |
[in] | include_waveforms | Should waveform data be read? 1 = yes, 0 = no |
stream
must be open for reading.record_header
is populated. record_header->record_type
is EAARLIO_TLD_TYPE_RASTER, then raster->header
is populated. record_header->record_type
is EAARLIO_TLD_TYPE_RASTER and include_pulses = 1, then raster->pulse
is populated; each pulse will have its header populated. record_header->record_type
is EAARLIO_TLD_TYPE_RASTER and include_pulses = 1 and include_waveforms = 1, then the waveforms for each pulse in raster->pulse
are populated. raster
are newly-allocated memory. eaarlio_error eaarlio_tld_write_raster | ( | struct eaarlio_stream * | stream, |
struct eaarlio_raster * | raster, | ||
struct eaarlio_memory * | memory | ||
) |
Write a raster to a TLD stream.
[in] | stream | Stream to be written to |
[in] | raster | Raster to write |
[in] | memory | Memory handler, or NULL for stdlib |
stream
must be open for writingstream
. stream
.