Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
tannermpeterson committed Jan 29, 2025
1 parent b882bc2 commit 1f37631
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/app/src/liveview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ void main() {
//account for flipped y-axis viewport
uv.y += (iScreen.y - iResolution.y) / iResolution.y;
//TODO switch back to texCoord
float px = clamp(iAuto.x * (texture(u_image, uv).r - iAuto.y), 0.0f, 1.0f);
float px = clamp(iAuto.x * (texture(u_image, texCoord).r - iAuto.y), 0.0f, 1.0f);
vec4 texColor = vec4(px, px, px, 1.0);
if (px < iLevels.x) {
Expand All @@ -80,9 +79,7 @@ void main() {
texColor = vec4(1.0, 0.0, 0.0, 1.0);
}
//TODO need a uniform to control showing the rois
//TODO switch back to texCoord
fragColor = mix(texColor, vec4(0.0f, 1.0f, 0.0f, 1.0f), float(texture(u_rois, uv).r));
fragColor = mix(texColor, vec4(0.0f, 1.0f, 0.0f, 1.0f), float(texture(u_rois, texCoord).r));
})";

/*
Expand All @@ -94,22 +91,21 @@ LiveView::LiveView(QWidget* parent, uint32_t width, uint32_t height, bool vflip,
m_width = width;
m_height = height;

m_roisTex = new uint8_t[ROIS_TEX_MAX_SIDE_LEN * ROIS_TEX_MAX_SIDE_LEN];
memset(m_roisTex, 0x00, ROIS_TEX_MAX_SIDE_LEN * ROIS_TEX_MAX_SIDE_LEN);

m_imageInFmt = fmt;

m_vflip = vflip;
m_hflip = hflip;

m_displayRois = displayRois;

m_texData = new uint8_t[m_width * m_height * CHANNEL_COUNT];
memset(m_texData, 255, m_width * m_height * CHANNEL_COUNT);

float aspect = float(m_width) / float(m_height);
int min = std::min(this->size().height(), this->size().width());

m_roisTex = new uint8_t[ROIS_TEX_MAX_SIDE_LEN * ROIS_TEX_MAX_SIDE_LEN];
memset(m_roisTex, 0x00, ROIS_TEX_MAX_SIDE_LEN * ROIS_TEX_MAX_SIDE_LEN);
m_displayRois = displayRois;

m_backgroundImage = new uint16_t[m_width*m_height];
for (size_t i = 0; i < m_width*m_height; i++) {
m_backgroundImage[i] = 0x6000;
Expand Down

0 comments on commit 1f37631

Please sign in to comment.