[TASK] Complete implementation of piecebased contrast adaption.

This commit is contained in:
Jan Philipp Timme 2015-11-20 13:37:48 +01:00
parent c0ed071190
commit d2efee34ed
1 changed files with 5 additions and 5 deletions

View File

@ -390,13 +390,13 @@ void ImageViewer::pieceLinearHistogrammAdaption() {
used_space += source_histogramm[source_cursor];
source_cursor++;
}
// If there is no more space, just put it to the last value used. :/
// Otherwise, we don't know what to do with some pixels.
if(source_histogramm[source_cursor] > (free_total_space - used_space)) {
histogramm_map[source_cursor] = i;
}
}
for(int i=0; i<256; i++) {
logFile << i << ": " << histogramm_map[i] << std::endl;
}
renewLogging();
// Apply the map for each pixel.
int h, s, l;
for(int x=0; x<working_copy->getImage()->width(); x++) {