24#include "oneapi/tbb.h"
28int32_t GPUDisplay::getNumThreads()
33 return tbb::info::default_concurrency();
37void GPUDisplay::updateOptions()
39 if (mCfgH.splitCETracks == -1 && mParam) {
44void GPUDisplay::disableUnsupportedOptions()
47 mCfgH.markAdjacentClusters = 0;
50 mCfgH.markFakeClusters = 0;
53 mCfgL.excludeClusters = mCfgL.drawInitLinks = mCfgL.drawLinks = mCfgL.drawSeeds = mCfgL.drawTracklets = mCfgL.drawTracks = mCfgL.drawExtrapolatedTracks = 0;
55 if (mConfig.showTPCTracksFromO2Format && mParam->
par.earlyTpcTransform) {
56 throw std::runtime_error(
"Cannot run GPU display with early Transform when input is O2 tracks");
60void GPUDisplay::DoScreenshot(
const char*
filename, std::vector<char>&
pixels,
float animateTime)
62 size_t screenshot_x = mBackend->mScreenWidth * mCfgR.screenshotScaleFactor;
63 size_t screenshot_y = mBackend->mScreenHeight * mCfgR.screenshotScaleFactor;
64 size_t size = 4 * screenshot_x * screenshot_y;
66 GPUError(
"Pixel array of incorrect size obtained");
73 GPUError(
"Error opening screenshot file %s",
filename);
79 memset(&bmpFH, 0,
sizeof(bmpFH));
80 memset(&bmpIH, 0,
sizeof(bmpIH));
83 bmpFH.
bfSize =
sizeof(bmpFH) +
sizeof(bmpIH) +
size;
84 bmpFH.
bfOffBits =
sizeof(bmpFH) +
sizeof(bmpIH);
86 bmpIH.
biSize =
sizeof(bmpIH);
96 fwrite(&bmpFH, 1,
sizeof(bmpFH), fp);
97 fwrite(&bmpIH, 1,
sizeof(bmpIH), fp);
103void GPUDisplay::showInfo(
const char* info)
105 mBackend->prepareText();
106 float colorValue = mCfgL.invertColors ? 0.f : 1.f;
107 OpenGLPrint(info, 40.f, 20.f + std::max(20, mDrawTextFontSize + 4), colorValue, colorValue, colorValue, 1);
110 mInfoText2Timer.
Reset();
112 OpenGLPrint(mInfoText2, 40.f, 20.f, colorValue, colorValue, colorValue, 6 - mInfoText2Timer.
GetCurrentElapsedTime());
115 if (mInfoHelpTimer.
IsRunning() || mPrintInfoTextAlways) {
117 mInfoHelpTimer.
Reset();
119 PrintGLHelpText(colorValue);
122 mBackend->finishText();
125void GPUDisplay::OpenGLPrint(
const char* s,
float x,
float y,
float r,
float g,
float b,
float a,
bool fromBotton)
127 if (mBackend->mFreetypeInitialized) {
129 y = mBackend->mScreenHeight -
y;
132 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