Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/fitshistogram.cpp
Context not available. | |||||
31 | FITSHistogram::FITSHistogram(QWidget *parent) : QDialog(parent) | 31 | FITSHistogram::FITSHistogram(QWidget *parent) : QDialog(parent) | ||
---|---|---|---|---|---|
32 | { | 32 | { | ||
33 | ui = new histogramUI(this); | 33 | ui = new histogramUI(this); | ||
34 | tab = static_cast<FITSTab *>(parent); | 34 | tab = dynamic_cast<FITSTab *>(parent); | ||
35 | 35 | | |||
36 | customPlot = ui->histogramPlot; | 36 | customPlot = ui->histogramPlot; | ||
37 | 37 | | |||
Context not available. | |||||
73 | connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(checkRangeLimit(QCPRange))); | 73 | connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(checkRangeLimit(QCPRange))); | ||
74 | } | 74 | } | ||
75 | 75 | | |||
76 | void FITSHistogram::showEvent(QShowEvent *) | 76 | void FITSHistogram::showEvent(QShowEvent *event) | ||
77 | { | 77 | { | ||
78 | syncGUI(); | 78 | Q_UNUSED(event) | ||
79 | syncGUI(); | ||||
79 | } | 80 | } | ||
80 | 81 | | |||
81 | void FITSHistogram::constructHistogram() | 82 | void FITSHistogram::constructHistogram() | ||
Context not available. | |||||
132 | uint16_t fits_w = 0, fits_h = 0; | 133 | uint16_t fits_w = 0, fits_h = 0; | ||
133 | FITSData *image_data = tab->getView()->getImageData(); | 134 | FITSData *image_data = tab->getView()->getImageData(); | ||
134 | 135 | | |||
135 | T *buffer = reinterpret_cast<T *>(image_data->getImageBuffer()); | 136 | auto *buffer = reinterpret_cast<T *>(image_data->getImageBuffer()); | ||
136 | 137 | | |||
137 | image_data->getDimensions(&fits_w, &fits_h); | 138 | image_data->getDimensions(&fits_w, &fits_h); | ||
138 | image_data->getMinMax(&fits_min, &fits_max); | 139 | image_data->getMinMax(&fits_min, &fits_max); | ||
Context not available. | |||||
526 | FITSHistogramCommand::FITSHistogramCommand(QWidget *parent, FITSHistogram *inHisto, FITSScale newType, double lmin, | 527 | FITSHistogramCommand::FITSHistogramCommand(QWidget *parent, FITSHistogram *inHisto, FITSScale newType, double lmin, | ||
527 | double lmax) | 528 | double lmax) | ||
528 | { | 529 | { | ||
529 | tab = static_cast<FITSTab*>(parent); | 530 | tab = dynamic_cast<FITSTab*>(parent); | ||
530 | type = newType; | 531 | type = newType; | ||
531 | histogram = inHisto; | 532 | histogram = inHisto; | ||
532 | min = lmin; | 533 | min = lmin; | ||
Context not available. | |||||
538 | delete[] delta; | 539 | delete[] delta; | ||
539 | } | 540 | } | ||
540 | 541 | | |||
541 | bool FITSHistogramCommand::calculateDelta(uint8_t *buffer) | 542 | bool FITSHistogramCommand::calculateDelta(const uint8_t *buffer) | ||
542 | { | 543 | { | ||
543 | FITSData *image_data = tab->getView()->getImageData(); | 544 | FITSData *image_data = tab->getView()->getImageData(); | ||
544 | 545 | | |||
Context not available. | |||||
546 | int totalPixels = image_data->getSize() * image_data->getNumOfChannels(); | 547 | int totalPixels = image_data->getSize() * image_data->getNumOfChannels(); | ||
547 | unsigned long totalBytes = totalPixels * image_data->getBytesPerPixel(); | 548 | unsigned long totalBytes = totalPixels * image_data->getBytesPerPixel(); | ||
548 | 549 | | |||
549 | uint8_t *raw_delta = new uint8_t[totalBytes]; | 550 | auto *raw_delta = new uint8_t[totalBytes]; | ||
550 | 551 | | |||
551 | if (raw_delta == nullptr) | 552 | if (raw_delta == nullptr) | ||
552 | { | 553 | { | ||
Context not available. | |||||
597 | int totalPixels = size * channels; | 598 | int totalPixels = size * channels; | ||
598 | unsigned long totalBytes = totalPixels * image_data->getBytesPerPixel(); | 599 | unsigned long totalBytes = totalPixels * image_data->getBytesPerPixel(); | ||
599 | 600 | | |||
600 | uint8_t *output_image = new uint8_t[totalBytes]; | 601 | auto *output_image = new uint8_t[totalBytes]; | ||
601 | 602 | | |||
602 | if (output_image == nullptr) | 603 | if (output_image == nullptr) | ||
603 | { | 604 | { | ||
Context not available. | |||||
605 | return false; | 606 | return false; | ||
606 | } | 607 | } | ||
607 | 608 | | |||
608 | uint8_t *raw_delta = new uint8_t[totalBytes]; | 609 | auto *raw_delta = new uint8_t[totalBytes]; | ||
609 | 610 | | |||
610 | if (raw_delta == nullptr) | 611 | if (raw_delta == nullptr) | ||
611 | { | 612 | { | ||
Context not available. | |||||
673 | } | 674 | } | ||
674 | else | 675 | else | ||
675 | { | 676 | { | ||
676 | uint8_t *buffer = new uint8_t[size * channels * BBP]; | 677 | auto *buffer = new uint8_t[size * channels * BBP]; | ||
677 | 678 | | |||
678 | if (buffer == nullptr) | 679 | if (buffer == nullptr) | ||
679 | { | 680 | { | ||
Context not available. |