| 703 | } |
| 704 | |
| 705 | void HyperHdrInstance::updateResult(std::vector<ColorRgb> _ledBuffer) |
| 706 | { |
| 707 | // stats |
| 708 | int64_t now = InternalClock::now(); |
| 709 | int64_t diff = now - _computeStats.statBegin; |
| 710 | int64_t prevToken = _computeStats.token; |
| 711 | |
| 712 | if (_computeStats.token <= 0 || diff < 0) |
| 713 | { |
| 714 | _computeStats.token = PerformanceCounters::currentToken(); |
| 715 | _computeStats.statBegin = now; |
| 716 | _computeStats.total = 1; |
| 717 | } |
| 718 | else if (prevToken != (_computeStats.token = PerformanceCounters::currentToken())) |
| 719 | { |
| 720 | |
| 721 | if (diff >= 59000 && diff <= 65000) |
| 722 | emit GlobalSignals::getInstance()->SignalPerformanceNewReport( |
| 723 | PerformanceReport(hyperhdr::PerformanceReportType::INSTANCE, _computeStats.token, _name, _computeStats.total / qMax(diff / 1000.0, 1.0), _computeStats.total, 0, 0, getInstanceIndex())); |
| 724 | |
| 725 | _computeStats.statBegin = now; |
| 726 | _computeStats.total = 1; |
| 727 | } |
| 728 | else |
| 729 | _computeStats.total++; |
| 730 | |
| 731 | _currentLedColors = _ledBuffer; |
| 732 | |
| 733 | for (int disabledProcessing = 0; disabledProcessing < 2; disabledProcessing++) |
| 734 | { |
| 735 | if (disabledProcessing == 1) |
| 736 | { |
| 737 | _ledColorCalibration->applyAdjustment(_ledBuffer); |
| 738 | } |
| 739 | |
| 740 | if (_ledString.hasDisabled) |
| 741 | { |
| 742 | auto ledsCurrent = _ledString.leds().begin(); |
| 743 | auto ledsEnd = _ledString.leds().end(); |
| 744 | auto colorsCurrent = _ledBuffer.begin(); |
| 745 | auto colorsEnd = _ledBuffer.end(); |
| 746 | for (; colorsCurrent != colorsEnd && ledsCurrent != ledsEnd; ++colorsCurrent, ++ledsCurrent) |
| 747 | if ((*ledsCurrent).disabled) |
| 748 | (*colorsCurrent) = ColorRgb::BLACK; |
| 749 | } |
| 750 | |
| 751 | if (disabledProcessing == 0) |
| 752 | emit SignalRawColorsChanged(_ledBuffer); |
| 753 | } |
| 754 | |
| 755 | if (_ledString.colorOrder != LedString::ColorOrder::ORDER_RGB) |
| 756 | { |
| 757 | for (ColorRgb& color : _ledBuffer) |
| 758 | { |
| 759 | // correct the color byte order |
| 760 | switch (_ledString.colorOrder) |
| 761 | { |
| 762 | case LedString::ColorOrder::ORDER_RGB: |
nothing calls this directly
no test coverage detected