Put all classes in one header and rename case to cell

This commit is contained in:
2024-04-22 16:10:02 +02:00
parent 040e011a66
commit 8084db97a5
7 changed files with 84 additions and 82 deletions

20
src/CellMap.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include <cstdint>
#include <gdal/ogr_spatialref.h>
#include <ogr_spatialref.h>
#include "contour_creator.hh"
CellMap::CellMap(int width, int height, uint8_t* cells, OGRSpatialReference reference_system)
{
this->width = width;
this->height = height;
this->cells = cells;
this->reference_system = reference_system;
}
int CellMap::get_cell(int x, int y)
{
// all the cells are in an array of ints from left to right, top to bottom
int offset = ((this->width * y) + x);
return *(this->cells + offset);
}