43#include <ACG/GL/acg_glew.hh>
45#include "PostProcessorPhilipsStereo.hh"
47#include <ACG/GL/ScreenQuad.hh>
52#include "CRC/crc32.hh"
54PostProcessorPhilipsStereoPlugin::PostProcessorPhilipsStereoPlugin():
56 settingsWidget_(nullptr),
62PostProcessorPhilipsStereoPlugin::~PostProcessorPhilipsStereoPlugin()
68 return QString(
"Philips Stereo Display Output");
71QAction* PostProcessorPhilipsStereoPlugin::optionsAction() {
72 action_ =
new QAction(
"Philips Stereo Options",0);
73 connect(action_,SIGNAL(triggered()),
this,SLOT(slotShowOptionsMenu()));
79QString PostProcessorPhilipsStereoPlugin::checkOpenGL() {
81 return QString(
"Insufficient OpenGL Version! OpenGL 3.0 or higher required");
86 missing +=
"GL_ARB_texture_rectangle extension missing\n";
93void PostProcessorPhilipsStereoPlugin::postProcess(
ACG::GLState* _glstate,
const std::vector<const PostProcessorInput*>& _input,
const PostProcessorOutput& _output) {
97 pProgram_ =
GLSL::loadProgram(
"Philips/screenquad.glsl",
"Philips/Fragment42.glsl");
102 int vp_l, vp_b, vp_w, vp_h;
112 _input[0]->bindDepthTex(1);
113 _input[0]->bindColorTex(0);
122 glDisable(GL_LIGHTING);
123 glDisable(GL_COLOR_MATERIAL);
124 glDisable(GL_DEPTH_TEST);
128 glColorMask(1,1,1,1);
139 _glstate->
ortho(0, vp_w, 0, vp_h, 0, 1);
144 glColor3f(1.0, 1.0, 1.0);
161 glBindTexture(GL_TEXTURE_2D, 0);
223 unsigned long checksum = CalcCRC32(&header[0], 6);
226 std::vector<uchar> bitVector;
229 for (
int i = 0; i < 6; i++) {
232 for (
int j = 7; j >= 0; --j) {
235 bitVector.push_back(0);
236 bitVector.push_back(0);
240 if (header[i] & (1 << j)) {
241 bitVector.push_back(255);
243 bitVector.push_back(0);
248 bitVector.push_back(0);
249 bitVector.push_back(0);
250 bitVector.push_back(0);
256 for (
int i = 31; i >= 0; i--) {
259 bitVector.push_back(0);
260 bitVector.push_back(0);
262 if (checksum & (1 << i))
263 bitVector.push_back(255);
265 bitVector.push_back(0);
269 bitVector.push_back(0);
270 bitVector.push_back(0);
271 bitVector.push_back(0);
277 glRasterPos2i(_output.viewport_[0], _output.viewport_[1] + _output.height - 1);
278 glDrawPixels(bitVector.size() / 3, 1, GL_RGB, GL_UNSIGNED_BYTE, &bitVector[0]);
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
void ortho(double _left, double _right, double _bottom, double _top, double _near_plane, double _far_plane)
orthographic projection
void pop_modelview_matrix()
pop modelview matrix
void pop_projection_matrix()
pop projection matrix
void push_projection_matrix()
push projection matrix
void reset_modelview()
reset modelview matrix (load identity)
void reset_projection()
reset projection matrix (load identity)
void get_viewport(int &_left, int &_bottom, int &_width, int &_height) const
get viewport
void push_modelview_matrix()
push modelview matrix
static void draw(GLSL::Program *_prog=0)
Draw the screen quad.
void disable()
Resets to standard rendering pipeline.
void use()
Enables the program object for using.
void setUniform(const char *_name, GLint _value)
Set int uniform to specified value.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
QString postProcessorName()
announce name for the postProcessor function
bool checkExtensionSupported(const std::string &_extension)
bool openGLVersion(const int _major, const int _minor, bool _verbose)
GLSL::PtrProgram loadProgram(const char *vertexShaderFile, const char *tessControlShaderFile, const char *tessEvaluationShaderFile, const char *geometryShaderFile, const char *fragmentShaderFile, const GLSL::StringList *macros, bool verbose)