Fixed alpha band for 16bit datasets

pull/1057/head
Piero Toffanin 2019-12-05 20:56:46 +00:00
rodzic f484cc6771
commit e39f3a6835
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -319,6 +319,10 @@ void OdmOrthoPhoto::saveTIFF(const std::string &filename, GDALDataType dataType)
for (size_t i = 0; i < bands.size(); i++){
hBand = GDALGetRasterBand( hDstDS, static_cast<int>(i) + 1 );
// Set alpha band
if (i == 3) GDALSetRasterColorInterpretation(hBand, GCI_AlphaBand );
if (GDALRasterIO( hBand, GF_Write, 0, 0, width, height,
bands[i], width, height, dataType, 0, 0 ) != CE_None){
std::cerr << "Cannot write TIFF to " << filename << std::endl;