Questions tagged [glreadpixels]

glReadPixels is an OpenGL API function to read pixels data from source framebuffer to destination memory buffer. When FBO is supported, the source could be FBO; when PBO is supported, the destination could be PBO.

197 questions
23
votes
2 answers

Converting data from glReadPixels() to OpenCV::Mat

I want to get every OpenGL frame from an animation with glReadPixels() and convert the data to OpenCV::Mat. I know that glReadPixels() gets the data by rows from the lower one to upper one, from left to right. On the other hand, OpenCV stores the…
Jav_Rock
  • 21,011
  • 18
  • 115
  • 164
19
votes
7 answers

How to take screenshot in OpenGL

How to take a screenshot of an OpenGL window in C++ and save it to file. I found the glReadPixels() function, but I don't know what to do next. Where I can set path to a file, for example? If not difficult, write code, please.
EthanHunt
  • 433
  • 2
  • 8
  • 19
13
votes
2 answers

Read texture bytes with glReadPixels?

I want to dump raw texture data to disk (to read back later), and I'm not sure about glReadPixel will read from the currently bound texture. How can I read the buffer from my texture?
Geri Borbás
  • 13,770
  • 13
  • 97
  • 158
12
votes
2 answers

Reading the pixels values from the Frame Buffer Object (FBO) using Pixel Buffer Object (PBO)

Can I use Pixel Buffer Object (PBO) to directly read the pixels values (i.e. using glReadPixels) from the FBO (i.e. while FBO is still attached)? If yes, What are the advantages and disadvantages of using PBO with FBO? What is the problem with…
Rudi
  • 680
  • 1
  • 8
  • 19
8
votes
2 answers

Asynchronous glReadPixels with PBO

I want to use two PBOs to read pixel in alternative way. I thought the PBO way will much faster, because glReadPixels returns immediately when using PBO, and a lot of time can be overlapped. Strangely there seems to be not much benefit. Considering…
Martin Wang
  • 927
  • 12
  • 17
7
votes
1 answer

glReadPixels clears buffer in openGL ES 2?

I have an OpenGL ES 2 drawing app (iOS 4), so I'm retaining backing in my CAEAGLLayer rather than clearing on every frame: eaglLayer.opaque = TRUE; eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: …
anna
  • 2,725
  • 4
  • 25
  • 36
6
votes
5 answers

Pixel formats, CVPixelBufferRefs and glReadPixels

I'm using glReadPixels to read data into a CVPixelBufferRef. I use the CVPixelBufferRef as the input into an AVAssetWriter. Unfortunately the pixel formats seem to be mismatched. I think glReadPixels is returning pixel data in RGBA format while…
MrDatabase
  • 39,447
  • 40
  • 105
  • 151
5
votes
1 answer

Using OpenGL ES texture caches instead of glReadPixels to get texture data

In iOS 5, OpenGL ES Texture caches were introduced to provide a direct way from the camera video data to OpenGL without the need of copying the buffers. There was a brief introduction to texture caches in session 414 - Advances in OpenGL ES for iOS…
Etan
  • 15,505
  • 17
  • 83
  • 142
5
votes
1 answer

glReadPixels too slow to use

I am using glReadPixels to take a snapshot at regular intervals in drawFrame method of GLSurfaceView.Renderer. I need to take this snapshot at regular intervals to keep saving my data as per my app requirements. However glReadPixels performance is…
random
  • 9,832
  • 8
  • 53
  • 97
5
votes
2 answers

how to record screen video as like Talking Tomcat application does in iphone?

hey i m trying the record the gameplay of my game so that i can upload its video to youtube from device itself...m trying to do same thing as Talking tomcat app for iphone..recording the video then playing it ,etc... i m using glReadPixels() for…
Tornado
  • 1,021
  • 11
  • 28
5
votes
1 answer

How to draw screenshot captured from glReadPixels to wxWidgets dialog/panel

I have an OpenGL window, and a wxWidget dialog. I want to mirror the OpenGL to the dialog. So what I intend to do is: Capture the screenshot of the opengl Display it onto the wxwidgets dialog. Any idea? Update: This is how I currently use…
huy
  • 4,314
  • 6
  • 33
  • 41
5
votes
2 answers

readPixels to base64 (WebGL Server side buffer conversion)

I am using headless-gl to run webGL on Node.js, creating an image dynamically on server. Once created, the image is to be stored in database (MongoDB), before user accessing the image again via API. Below is the part where the image is…
cristie09
  • 141
  • 1
  • 9
5
votes
0 answers

Why glReadPixels give missaligned result on some older android devices?

I have an app that works perfectly on many devices, I have a couple of users that reported app is not saving images properly. The comman thing about the devices with problem is, they all are very old devices. Most likely they all use armeabi as…
user65721
  • 2,503
  • 2
  • 15
  • 28
5
votes
3 answers

glReadPixels() really slow, better solution to get OpenGL coordinates from mouse position?

This is my code that I use to get my mouse position in the 3d scene: void GetOGLPos(int x, int y, GLdouble &pX, GLdouble &pY, GLdouble &pZ){ GLint viewport[4]; GLdouble modelview[16]; GLdouble projection[16]; GLfloat winX, winY, winZ; …
Newbie
  • 1,509
  • 8
  • 34
  • 49
5
votes
2 answers

How do I flip an image horizontally flip with glReadPixels() Bufferedimage and out put with ImageIO?

How do I flip an Screenshot image? I can't find my problem anywhere else.Example code: /* *@param fileLoc //Location of fileoutput destination *@param format //"png" *@param WIDTH //Display.width(); *@param HEIGHT //Display.height(); */ private…
Maarten
  • 575
  • 1
  • 7
  • 27
1
2 3
13 14