[BUGFIX] Fix filter being x/y flipped.

This commit is contained in:
Jan Philipp Timme 2015-12-18 13:04:46 +01:00
parent afdb507c9b
commit e0f93f3bbc
2 changed files with 4 additions and 3 deletions

View File

@ -548,7 +548,7 @@ void ImageViewer::applyBasicFilter() {
QColor color = QColor::fromRgb(original->getImage()->pixel(x+dx, y+dy)); QColor color = QColor::fromRgb(original->getImage()->pixel(x+dx, y+dy));
color.getHsl(&h, &s, &l); color.getHsl(&h, &s, &l);
//std::cout << "[" << fx << "," << fy <<"] " << l << " * " << data[fx*filter_size + fy] << " = "; //std::cout << "[" << fx << "," << fy <<"] " << l << " * " << data[fx*filter_size + fy] << " = ";
intensity_sum += (l * data[fx*filter_size + fy]); intensity_sum += (l * data[fy*filter_size + fx]);
//std::cout << intensity_sum << std::endl; //std::cout << intensity_sum << std::endl;
} }
} }
@ -619,7 +619,7 @@ void ImageViewer::applyBasicFilterWithOverflowHandling() {
QColor color = QColor::fromRgb(original->getPixel(x+dx, y+dy, overflow_mode)); QColor color = QColor::fromRgb(original->getPixel(x+dx, y+dy, overflow_mode));
color.getHsl(&h, &s, &l); color.getHsl(&h, &s, &l);
//std::cout << "[" << fx << "," << fy <<"] " << l << " * " << data[fx*filter_size + fy] << " = "; //std::cout << "[" << fx << "," << fy <<"] " << l << " * " << data[fx*filter_size + fy] << " = ";
intensity_sum += (l * data[fx*filter_size + fy]); intensity_sum += (l * data[fy*filter_size + fx]);
//std::cout << intensity_sum << std::endl; //std::cout << intensity_sum << std::endl;
} }
} }
@ -649,7 +649,7 @@ void ImageViewer::applyBasicFilterWithOverflowHandling() {
* @brief ImageViewer::runCannyEdge * @brief ImageViewer::runCannyEdge
*/ */
void ImageViewer::runCannyEdge(void) { void ImageViewer::runCannyEdge(void) {
//TODO
} }
/**************************************************************************************** /****************************************************************************************
* *

View File

@ -170,6 +170,7 @@ class ImageViewer : public QMainWindow {
void changeFilterSize(int s); void changeFilterSize(int s);
void applyBasicFilter(); void applyBasicFilter();
void applyBasicFilterWithOverflowHandling(); void applyBasicFilterWithOverflowHandling();
void runCannyEdge(void);
void open(); void open();
void openReference(); void openReference();