pull/1082/head
Piero Toffanin 2020-03-18 14:39:19 +00:00
commit 7b94d25c0c
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -278,7 +278,7 @@ inline T maxRange(){
template <typename T>
void OdmOrthoPhoto::initBands(int count){
size_t pixelCount = static_cast<size_t>(width * height);
size_t pixelCount = static_cast<size_t>(width) * static_cast<size_t>(height);
// Channels
for (int i = 0; i < count; i++){
@ -292,7 +292,7 @@ void OdmOrthoPhoto::initBands(int count){
template <typename T>
void OdmOrthoPhoto::initAlphaBand(){
size_t pixelCount = static_cast<size_t>(width * height);
size_t pixelCount = static_cast<size_t>(width) * static_cast<size_t>(height);
// Alpha
if (alphaBand == nullptr){
T *arr = new T[pixelCount];
@ -308,7 +308,7 @@ void OdmOrthoPhoto::finalizeAlphaBand(){
// Adjust alpha band values, only pixels that have
// values on all bands should be visible
size_t pixelCount = static_cast<size_t>(width * height);
size_t pixelCount = static_cast<size_t>(width) * static_cast<size_t>(height);
int channels = bands.size();
T *arr = reinterpret_cast<T *>(alphaBand);
@ -935,7 +935,7 @@ void OdmOrthoPhoto::renderPixel(int row, int col, float s, float t, const cv::Ma
top = static_cast<int>(topF);
// The interpolated color values.
size_t idx = static_cast<size_t>(row * width + col);
size_t idx = static_cast<size_t>(row) * static_cast<size_t>(width) + static_cast<size_t>(col);
T *data = reinterpret_cast<T *>(texture.data); // Faster access
int numChannels = texture.channels();