mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2026-03-15 00:14:04 +00:00
Put all classes in one header and rename case to cell
This commit is contained in:
20
src/CellMap.cpp
Normal file
20
src/CellMap.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user