21#include "oneapi/tbb.h"
25int32_t GPUDisplay::getNumThreads()
30 return tbb::info::default_concurrency();
34void GPUDisplay::updateOptions()
36 if (mCfgH.splitCETracks == -1 && mParam) {
41void GPUDisplay::disableUnsupportedOptions()
44 mCfgH.markAdjacentClusters = 0;
47 mCfgH.markFakeClusters = 0;
50 mCfgL.excludeClusters = mCfgL.drawInitLinks = mCfgL.drawLinks = mCfgL.drawSeeds = mCfgL.drawTracklets = mCfgL.drawTracks = mCfgL.drawExtrapolatedTracks = 0;
52 if (mConfig.showTPCTracksFromO2Format && mParam->
par.earlyTpcTransform) {
53 throw std::runtime_error(
"Cannot run GPU display with early Transform when input is O2 tracks");
57void GPUDisplay::DoScreenshot(
const char*
filename, std::vector<char>&
pixels,
float animateTime)
59 size_t screenshot_x = mBackend->mScreenWidth * mCfgR.screenshotScaleFactor;
60 size_t screenshot_y = mBackend->mScreenHeight * mCfgR.screenshotScaleFactor;
61 size_t size = 4 * screenshot_x * screenshot_y;
63 GPUError(
"Pixel array of incorrect size obtained");
70 GPUError(
"Error opening screenshot file %s",
filename);
76 memset(&bmpFH, 0,
sizeof(bmpFH));
77 memset(&bmpIH, 0,
sizeof(bmpIH));
80 bmpFH.
bfSize =
sizeof(bmpFH) +
sizeof(bmpIH) +
size;
81 bmpFH.
bfOffBits =
sizeof(bmpFH) +
sizeof(bmpIH);
83 bmpIH.
biSize =
sizeof(bmpIH);
93 fwrite(&bmpFH, 1,
sizeof(bmpFH), fp);
94 fwrite(&bmpIH, 1,
sizeof(bmpIH), fp);
100void GPUDisplay::showInfo(
const char* info)
102 mBackend->prepareText();
103 float colorValue = mCfgL.invertColors ? 0.f : 1.f;
104 OpenGLPrint(info, 40.f, 20.f + std::max(20, mDrawTextFontSize + 4), colorValue, colorValue, colorValue, 1);
107 mInfoText2Timer.
Reset();
109 OpenGLPrint(mInfoText2, 40.f, 20.f, colorValue, colorValue, colorValue, 6 - mInfoText2Timer.
GetCurrentElapsedTime());
112 if (mInfoHelpTimer.
IsRunning() || mPrintInfoTextAlways) {
114 mInfoHelpTimer.
Reset();
116 PrintGLHelpText(colorValue);
119 mBackend->finishText();
122void GPUDisplay::OpenGLPrint(
const char* s,
float x,
float y,
float r,
float g,
float b,
float a,
bool fromBotton)
124 if (mBackend->mFreetypeInitialized) {
126 y = mBackend->mScreenHeight -
y;
129 mBackend->OpenGLPrint(s,
x,
y,
color, 1.0f);
double GetCurrentElapsedTime(bool reset=false)
const GPUSettingsProcessing & GetProcessingSettings() const
virtual void OpenGLPrint(const char *s, float x, float y, float r, float g, float b, float a, bool fromBotton=true)=0
GLboolean GLboolean GLboolean b
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
GLboolean GLboolean GLboolean GLboolean a
const uint32_t * mergedTrackHitAttachment
int32_t continuousMaxTimeBin