Has a problem. I have an tiff image (that have 4 layers). My tasks is to make small changes in pixel's color to make image better. In this case I use GDAL library. My source is:
GDALDataset *poDataset;
GDALAllRegister();
poDataset = (GDALDataset *) GDALOpen(fileName.toStdString().c_str(), GA_ReadOnly);
if (poDataset == NULL) {
QMessageBox::information(0, "error", "We have problems");
} else {
QMessageBox::information(0, "Message", "All is ok");
}
int rasterCount = poDataset->GetRasterCount(); // Here is 4 raster images
GDALRasterBand *band = poDataset->GetRasterBand(1);
int width = band->GetXSize();
int height = band->GetYSize();
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
// cross all pixels
// How to get pixel color here?
}
}
So I dont know how to get pixel color in cycle. Can you give me advice pleasae?