Read strip data

This commit is contained in:
2024-05-01 00:17:53 +01:00
parent d508af1809
commit 69c13b83ea
2 changed files with 103 additions and 16 deletions

View File

@@ -12,6 +12,14 @@ extern "C" {
#define TYPE_MAX_COUNT (UINT8_MAX * sizeof(const char *))
typedef struct short_long_value ShortLongValue;
struct short_long_value {
union {
u16 short_val;
u32 long_val;
};
};
typedef struct hdr TiffHdr;
struct hdr {
u16 order;
@@ -113,10 +121,12 @@ struct tiff_image {
bool bits_per_sample_offset;
u16 compression;
u16 photometric_interpretation;
u32 strip_offsets;
u16 strip_offsets_type_byte_count;
ShortLongValue strip_offsets;
bool strip_offsets_offset;
u32 rows_per_strip;
u32 strip_byte_counts;
u16 strip_byte_count_type_byte_count;
ShortLongValue strip_byte_counts;
bool strip_byte_counts_offset;
u32 strip_count;
u32 color_map;
@@ -125,6 +135,12 @@ struct tiff_image {
bool extra_samples_offset;
};
typedef struct tiff_strip TiffStrip;
struct tiff_strip {
u32 offset;
u32 byte_count;
};
Image *read_baseline_tiff(const char *file, Arena *arena);
#ifdef __cplusplus