shadercam | Simple OpenGL Shaders with the camera2 apis in Android | Camera library
kandi X-RAY | shadercam Summary
kandi X-RAY | shadercam Summary
Simple OpenGL Shaders with the [camera2] apis in Android 7.0+.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Called when the buffer is available
- Draws camera
- Stops this recorder
- Copy the file to a local temp file
- Starts the camera preview
- Returns the optimal size for a given array of sizes
- Draws the surface
- Set the extra texture ids
- Creates a new program
- Compiles the specified shader source
- The main loop
- Sets the coordinates and attributes of the camera
- Initializes the View
- This method checks if the AppCompatActivity has been granted
- Updates the camera preview
- Allocates a direct float buffer
- Creates a texture from raw data
- Log the current EGL context
- Starts the resume view
- Saves the frame to a file
- Returns a suitable EGLConfig
- Initializes this thread
- Called when the window is resume
- Set the uniforms and attributes
- Updates an active texture
- Writes GL version information to the log
shadercam Key Features
shadercam Examples and Code Snippets
Community Discussions
Trending Discussions on shadercam
QUESTION
I am currently programming an application for image processing. To achieve the needed performance, I have to use the GPU to compute the camera input, more specifically use OpenGL ES 2.0. With the help of this project (https://github.com/yulu/ShaderCam) I achieved to pass the image to the pipeline and do simple operations with the fragment shader (like inverting colors etc).
My knowledge of GLSL, fragment shaders and vertex shaders is fairly limited but I am aware of pipeline constraints and what the two shaders do in the pipeline. So - formulating the problem - I would like to calculate the average color of a row in my received image and return it (per row) to my application. I read here https://stackoverflow.com/a/13866636/8038866 that this is generally possible, however I can't seem to find out the following things:
1 (edit: SOLVED by simply passing the w and h of my texture to the vertex and fragment shader): Knowing where the row ends (and having that information in the fragment shader). For this I assume that I would have to pass the width of the picture to the vertex shader and from there to the fragment shader, right?
2.: How to calculate the average the color values of each row in the fragment shader and then pass them to the application. If I understand it correctly - the fragment shader only excutes the code per pixel, so I am not sure how to achieve this.
Here are the two very basic shaders vertex shader:
...ANSWER
Answered 2017-Jun-11 at 13:34I found a way that does the trick for me. The idea is to calculate the mean for only one row of pixels and then later in the application to get this line with
glReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data);
Here is my fragment shader (notice that the width of the surface is required as well):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shadercam
You can use shadercam like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the shadercam component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page