42 uint64_t vectorSize=0;
44 vlsv::datatype::type dataType;
45 std::list<std::pair<std::string,std::string> > attribs;
46 attribs.push_back(std::pair<std::string,std::string>(
"name",
"CellID"));
47 if( r.getArrayInfo(
"VARIABLE",attribs, arraySize,vectorSize,dataType,byteSize) ==
false ) {
48 std::cerr <<
"getArrayInfo returned false when trying to read CellID VARIABLE." << std::endl;
52 if(dataType != vlsv::datatype::type::UINT || byteSize != 8 || vectorSize != 1) {
53 std::cerr <<
"Datatype of CellID VARIABLE entries is not uint64_t." << std::endl;
58 std::vector<uint64_t> cellIds(arraySize*vectorSize);
60 if( r.readArray(
"VARIABLE",attribs,0,arraySize,(
char*) cellIds.data()) ==
false) {
61 std::cerr <<
"readArray faied when trying to read CellID Variable." << std::endl;
int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes)