42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#include "HeightMap.hh"
|
|
#include "CaseMap.hh"
|
|
#include <iostream>
|
|
#include <ostream>
|
|
#include <vector>
|
|
#include <gdal/gdal.h>
|
|
#include "gdal/gdal_priv.h"
|
|
#include <gdal/gdal_frmts.h>
|
|
|
|
std::vector<CaseMap> produce_casemap(HeightMap* heightmap)
|
|
{
|
|
std::vector<CaseMap> output;
|
|
int* test = (int *) CPLMalloc(sizeof(int)*heightmap->width*heightmap->height);
|
|
*(test + 4) = 13;
|
|
CaseMap casemap1(heightmap->width-1, heightmap->height-1, test);
|
|
output.push_back(casemap1);
|
|
return output;
|
|
}
|
|
//(int a, int b, )
|
|
|
|
|
|
int main(int argc, const char* argv[])
|
|
{
|
|
const char* filepath = argv[1];
|
|
HeightMap map(filepath);
|
|
|
|
std::cout << "x: " << map.width << " y: " << map.height << "\n";
|
|
std::cout << "max: " << map.max << " min: " << map.min << "\n";
|
|
/*
|
|
for (int y = 0; y < map.height; y++)
|
|
{
|
|
for (int x = 0; x < map.width; x++)
|
|
{
|
|
std::cout << map.get_pixel(x, y) << " ";
|
|
}
|
|
std::cout << "\n";
|
|
}
|
|
*/
|
|
std::cout << "\nend🤡\n";
|
|
auto casemap = produce_casemap(&map);
|
|
std::cout << casemap[0].get_case( 4, 0);
|
|
} |