Skip to content

Commit

Permalink
Expand DPX handling to permit more kinds of DPX files, including pack…
Browse files Browse the repository at this point in the history
…ed 10-bit luma (grayscale). Update error string handling.
  • Loading branch information
sjohnson-imi committed Mar 2, 2018
1 parent 39a5cdd commit fa69504
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 220 deletions.
4 changes: 2 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Copyright and Open Source Software License
----------------------------------------------------------------------

Copyright (c) 2015-2017 South Carolina Research Foundation
Copyright (c) 2015-2018 South Carolina Research Foundation
All Rights Reserved

AEO-Light, Ver. 2.3
AEO-Light, Ver. 2.3.2
Greg Wilsbacher, Pencho Petrushev, L. Scott Johnson, Tommy Aschenbach,
and the South Carolina Research Foundation

Expand Down
2 changes: 1 addition & 1 deletion aeogui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TEMPLATE = app

# The version of AEO-Light
APP_NAME = AEO-Light
VERSION = 2.3
VERSION = 2.3.2

# nb: when updating the version number, be sure to update LICENSE.txt too

Expand Down
140 changes: 25 additions & 115 deletions frame_view_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ Frame_Window::Frame_Window(int w,int h)
audio_float_texture = 0;
audio_int_texture = 0;
cal_audio_texture = 0;
vo.videobuffer=NULL;
is_videooutput=0;
vo.videobuffer=NULL;
is_videooutput=0;


}
Expand Down Expand Up @@ -726,6 +726,27 @@ void Frame_Window::update_parameters()
m_program->setUniformValue(m_overlap_target_loc, overlap_target);
}

void Frame_Window::CopyFrameBuffer(GLuint fbo, int width, int height)
{
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glDrawBuffer(GL_COLOR_ATTACHMENT1);
glClear(GL_COLOR_BUFFER_BIT);
glReadBuffer(GL_COLOR_ATTACHMENT0);

{
#ifndef __APPLE__
OGL_Fun.
#endif
glBlitFramebuffer(
0,0,width,height,
0,0,width,height,
GL_COLOR_BUFFER_BIT,GL_NEAREST);
}

glReadBuffer(0);
glDrawBuffer(0);
}

void Frame_Window::render()
{

Expand Down Expand Up @@ -806,125 +827,14 @@ void Frame_Window::render()
CHECK_GL_ERROR(__FILE__,__LINE__);



#define USE_GL_BLIT_FRAMEBUFFER

if(new_frame)
{
CUR_OP("binding adj_frame_fbo");

glBindFramebuffer(GL_FRAMEBUFFER, adj_frame_fbo);
CHECK_GL_ERROR(__FILE__,__LINE__);

glDrawBuffer(GL_COLOR_ATTACHMENT1);
glClear(GL_COLOR_BUFFER_BIT);
glReadBuffer(GL_COLOR_ATTACHMENT0);
CHECK_GL_FBO(GL_DRAW_FRAMEBUFFER,__FILE__,__LINE__);
CHECK_GL_FBO(GL_READ_FRAMEBUFFER,__FILE__,__LINE__);

CUR_OP("glBlitFrameBuffer()");
#ifdef USE_GL_BLIT_FRAMEBUFFER
#ifndef __APPLE__
{
OGL_Fun.glBlitFramebuffer(0,0,input_w,input_h,0,0,input_w,input_h,
GL_COLOR_BUFFER_BIT,GL_NEAREST);
}
#else
{
glBlitFramebuffer(0,0,input_w,input_h,0,0,input_w,input_h,
GL_COLOR_BUFFER_BIT,GL_NEAREST);
}
#endif

#else

//************************Adjustment Render********************************
// Input Textures: frame_tex (original from file)
// Renders to: adj_frame_tex
// Description: applies color and density correction to image

bool jitteractive = false;

m_program->setUniformValue(m_rendermode_loc, 0.0f);
if(!new_frame || !jitteractive)
glVertexAttribPointer(m_texAttr, 3, GL_FLOAT, GL_FALSE, 0, verticesTex);
else
glVertexAttribPointer(m_texAttr, 3, GL_FLOAT, GL_FALSE, 0,
verticesTexJitter);

CHECK_GL_ERROR(__FILE__,__LINE__);
glBindFramebuffer(GL_FRAMEBUFFER,adj_frame_fbo);
glDrawBuffer(GL_COLOR_ATTACHMENT1);
glViewport(0,0, input_w, input_h);
glClear(GL_COLOR_BUFFER_BIT);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);
CHECK_GL_ERROR(__FILE__,__LINE__);

#endif // USE_GL_BLIT_FRAMEBUFFER

glDrawBuffer(0);
glReadBuffer(0);
CopyFrameBuffer(adj_frame_fbo, input_w, input_h);
CHECK_GL_ERROR(__FILE__,__LINE__);

CUR_OP("binding to audio_fbo");

glBindFramebuffer(GL_FRAMEBUFFER, audio_fbo);
glDrawBuffer(GL_COLOR_ATTACHMENT1);
glClear(GL_COLOR_BUFFER_BIT);
glReadBuffer(GL_COLOR_ATTACHMENT0);

CUR_OP("glBlitFGrameBuffer() on audio_fbo");
#ifdef USE_GL_BLIT_FRAMEBUFFER
#ifndef __APPLE__
{
OGL_Fun.glBlitFramebuffer(0,0,2,samplesperframe,0,0,2,
samplesperframe,GL_COLOR_BUFFER_BIT,GL_NEAREST);
}
#else
{
glBlitFramebuffer(0,0,2,samplesperframe,0,0,2,
samplesperframe,GL_COLOR_BUFFER_BIT,GL_NEAREST);
}
#endif

#else

//********************************Audio RENDER*****************************
// Input Textures: adj_frame_texture (adjusted image texture)
// Renders to: audio_RGB_texture
// Description: steps through each line within x boundary and computes
// value for display

m_program->setUniformValue(m_rendermode_loc, 1.0f);
glVertexAttribPointer(m_texAttr, 3, GL_FLOAT, GL_FALSE, 0, verticesTex);
CHECK_GL_ERROR(__FILE__,__LINE__);
glBindFramebuffer(GL_FRAMEBUFFER,audio_fbo);
glDrawBuffer(GL_COLOR_ATTACHMENT1);
glViewport(0,0, 2, samplesperframe);

glClear(GL_COLOR_BUFFER_BIT);

glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);


CHECK_GL_ERROR(__FILE__,__LINE__);
glBindFramebuffer(GL_FRAMEBUFFER,audio_fbo);
glReadBuffer(GL_COLOR_ATTACHMENT1);
CHECK_GL_ERROR(__FILE__,__LINE__);

//copy float buffer out
glReadPixels(0,0,2,samplesperframe,GL_RED, GL_FLOAT,audio_compare_buffer);
fullarray = (static_cast<GLfloat*>(audio_compare_buffer));

GLfloat* subdminarray = &fullarray[samplesperframe-samplesperframe/4];
float dmin =0.0;// GetMin(subdminarray,samplesperframe/4);
float dmax =1.0;// GetMax(subdminarray,samplesperframe/4);
m_program->setUniformValue(dminmax_loc, dmin,dmax);

#endif // USE_GL_BLIT_FRAMEBUFFER

glDrawBuffer(0);
glReadBuffer(0);
CopyFrameBuffer(audio_fbo, 2, samplesperframe);
CHECK_GL_ERROR(__FILE__,__LINE__);
}

Expand Down
20 changes: 11 additions & 9 deletions frame_view_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ class Frame_Window : public OpenGLWindow
float value;
} overlap_match;

typedef struct {
GLuint video_output_fbo;
GLuint video_output_texture;
int width;
int height;
uint8_t * videobuffer;
} video_output;
typedef struct {
GLuint video_output_fbo;
GLuint video_output_texture;
int width;
int height;
uint8_t * videobuffer;
} video_output;

void ParamUpdateCallback(FrameWindowCallbackFunction cb, void *userData);

Expand All @@ -86,7 +86,7 @@ class Frame_Window : public OpenGLWindow
void SetCalibrationMask(const float *mask);
void update_parameters();// update gpu variables and rerender

video_output vo;
video_output vo;
// working data
float * *FileRealBuffer;

Expand Down Expand Up @@ -136,7 +136,7 @@ class Frame_Window : public OpenGLWindow
bool overlapshow;
bool is_rendering;
bool is_debug;
bool is_videooutput;
bool is_videooutput;
int overrideOverlap;

float fps;
Expand All @@ -162,6 +162,8 @@ class Frame_Window : public OpenGLWindow
void gen_tex_bufs(); //generation of textures and buffers
bool new_frame; //is a new frame from seq

void CopyFrameBuffer(GLuint fbo, int width, int height);

GLenum *audio_draw_buffers;
GLuint audio_pbo;
GLuint m_posAttr; //vertex buffer
Expand Down
Loading

0 comments on commit fa69504

Please sign in to comment.