mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2024-12-04 21:10:17 +00:00
Compare commits
No commits in common. "25354cc115f04984c7c7f1178f05fe591a73567e" and "2f908278138f8200bf39c6a72d4f3a3b9fee304d" have entirely different histories.
25354cc115
...
2f90827813
@ -1,5 +1,4 @@
|
||||
#! /bin/sh
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -B build
|
||||
cmake --build build --parallel
|
||||
|
@ -1,22 +0,0 @@
|
||||
#include <gdal/gdal.h>
|
||||
#include "gdal/gdal_priv.h"
|
||||
#include <iostream>
|
||||
|
||||
#include <stdfloat>
|
||||
|
||||
#include "CaseMap.hh"
|
||||
#include "HeightMap.hh"
|
||||
|
||||
CaseMap::CaseMap(int width, int height, int* cases)
|
||||
{
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
this->cases = cases;
|
||||
|
||||
}
|
||||
int CaseMap::get_case(int x, int y)
|
||||
{
|
||||
// all the pixels are in an array of floats from left to right, top to bottom
|
||||
int offset = ((this->width * y) + x);
|
||||
return *(this->cases + offset);
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/**
|
||||
@brief stores the cases produced from image
|
||||
*/
|
||||
class CaseMap
|
||||
{
|
||||
public:
|
||||
float* data;
|
||||
int width; //!< width of image in cases
|
||||
int height; //!< height of image in cases
|
||||
|
||||
CaseMap(int width, int height, int* cases);
|
||||
float get_case(int x,int y);
|
||||
};
|
16
src/main.cpp
16
src/main.cpp
@ -1,20 +1,6 @@
|
||||
#include "HeightMap.hh"
|
||||
#include "CaseMap.hh"
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
#include <gdal/gdal.h>
|
||||
|
||||
std::vector<CaseMap> produce_casemap(HeightMap* heightmap)
|
||||
{
|
||||
std::vector<CaseMap> output;
|
||||
int* test = (int *) CPLMalloc(sizeof(int)*heightmap->width*heightmap->height);
|
||||
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[])
|
||||
{
|
||||
@ -33,6 +19,4 @@ int main(int argc, const char* argv[])
|
||||
std::cout << "\n";
|
||||
}
|
||||
std::cout << "\nend🤡\n";
|
||||
casemap = produce_casemap(map);
|
||||
std::cout << casemap.get_case( 2, 2)
|
||||
}
|
Loading…
Reference in New Issue
Block a user