Cogs.Core
GeoTiff.h
1#pragma once
2#include "Rendering/DataFormat.h"
3
4#include "Foundation/Memory/MemoryBuffer.h"
5
6#include <tiffio.h>
7
8#include <optional>
9
10namespace Cogs::Core::TerrainProvider {
11
12
14 {
15 Cogs::TextureFormat format = Cogs::TextureFormat::Unknown;
16 unsigned width = 0;
17 unsigned height = 0;
18 double scale[3] = { 0 };
19 double origin[3] = { 0 };
20
21 std::optional<float> noData;
22 std::optional<float> minSample;
23 std::optional<float> maxSample;
24
25 bool valid = false;
26
27 double tiePoint[6] = { 0.0 };
28
29 GeoTiffView(const void* ptr, size_t size);
31
32 bool getFullImage(Memory::MemoryBuffer& buffer, float suggested_nodata);
33
34 const void* ptr = nullptr;
35 size_t size = 0;
36 size_t offset = 0;
37 tiff* tif = nullptr;
38 };
39
40 bool createTiff(Memory::MemoryBuffer& out, const Memory::MemoryBuffer& in, unsigned w, unsigned h, Cogs::TextureFormat format);
41
42}