contour-creator/src/casemap.cpp

22 lines
473 B
C++

#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);
}