summaryrefslogtreecommitdiffstats
path: root/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h
diff options
context:
space:
mode:
authorByunghun Jeon <bjeon@codeaurora.org>2015-08-03 17:42:49 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-08-12 18:03:03 -0700
commite713237ec94737904e339ce05a6d09fed5d9a72d (patch)
tree1ba6ce4732747a79e382125298a78ec40c376419 /jni/feature_mos/src/mosaic_renderer/WarpRenderer.h
parent4cc34823df8e420c366d4bf4497d7f906676a022 (diff)
downloadandroid_packages_apps_Snap-e713237ec94737904e339ce05a6d09fed5d9a72d.tar.gz
android_packages_apps_Snap-e713237ec94737904e339ce05a6d09fed5d9a72d.tar.bz2
android_packages_apps_Snap-e713237ec94737904e339ce05a6d09fed5d9a72d.zip
Revert "SnapdragonCamera: Improved panorama"
This reverts commit "SnapdragonCamera: Improved panorama" Change-Id: I7aef9427c218d06b78cbc097dd32a1629b5ab9d1
Diffstat (limited to 'jni/feature_mos/src/mosaic_renderer/WarpRenderer.h')
-rw-r--r--jni/feature_mos/src/mosaic_renderer/WarpRenderer.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h b/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h
new file mode 100644
index 000000000..2f50c6f34
--- /dev/null
+++ b/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#include "FrameBuffer.h"
+#include "Renderer.h"
+
+#include <GLES2/gl2.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+class WarpRenderer: public Renderer {
+ public:
+ WarpRenderer();
+ virtual ~WarpRenderer();
+
+ // Initialize OpenGL resources
+ // @return true if successful
+ bool InitializeGLProgram();
+
+ void SetViewportMatrix(int w, int h, int W, int H);
+ void SetScalingMatrix(float xscale, float yscale);
+ void SetRotation(int degree);
+ bool DrawTexture(GLfloat *affine);
+
+ private:
+ // Source code for shaders.
+ const char* VertexShaderSource() const;
+ const char* FragmentShaderSource() const;
+
+ GLuint mTexHandle; // Handle to s_texture.
+ GLuint mTexCoordHandle; // Handle to a_texCoord.
+ GLuint mTriangleVerticesHandle; // Handle to vPosition.
+
+ // Attribute locations
+ GLint mPositionLoc;
+ GLint mAffinetransLoc;
+ GLint mViewporttransLoc;
+ GLint mScalingtransLoc;
+ GLint mTexCoordLoc;
+ GLint mRotationtransLoc;
+
+ GLfloat mViewportMatrix[16];
+ GLfloat mScalingMatrix[16];
+ GLfloat mRotationMatrix[16];
+
+ // Sampler location
+ GLint mSamplerLoc;
+};
+