|
|
Displaying 10-bit image data using OpenGL
I am trying to take the data in a framegrabber buffer and display it in
a dialog using OpenGL. The reason for this is becasue OpenGL will allow
me to scale the image up or down so i can view the entire 1020x1240
image. The camera taking the images, streams the data at 10-bits per
pixel to the buffer. In order to test the following section of code i
saved the buffer to no image format so that it is only pixel data and i
tried to display it but it does not work. I have only started using
OpenGL and i am only at the stage of initialising OpenGL and displaying
triangles in a dialog box. I have inlcuded a portion of the code to
help my explaination.
Crispen
ps: All the sizes for the image mallocing and reading i have made big
because i was not sure how big they needed to be.
void COpenGL::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
HDC hdc = ::GetDC(m_hWnd);
HGLRC hglrc;
// TODO: Add your message handler code here
glClearColor(0,0,0,0);
glColor3f(1, 1, 1);
if (hglrc = wglCreateContext(hdc))
{
if(wglMakeCurrent(hdc, hglrc))
{
BYTE *pData = (BYTE*)malloc(10000 * 10000 * 3 * sizeof(BYTE));
FILE* fp = fopen("test.shit","r");
fread(pData,2,1068000,fp);
glClear(GL_COLOR_BUFFER_BIT);
glDrawPixels(1000,1016,GL_COLOR_INDEX,GL_UNSIGNED_SHORT,pData);
free(pData);
fclose(fp);
SwapBuffers(hdc);
}
}
wglMakeCurrent(NULL, NULL) ;
::ReleaseDC (m_hWnd, hdc) ;
wglDeleteContext(hglrc);
// Do not call CWnd::OnPaint() for painting messages
}
|
|
0
|
|
|
|
Reply
|
cjb111 (6)
|
5/12/2005 1:33:43 AM |
|
cjb111@student.canterbury.ac.nz wrote:
> glDrawPixels(1000,1016,GL_COLOR_INDEX,GL_UNSIGNED_SHORT,pData);
I don't think you want "GL_COLOR_INDEX" here...
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.
|
|
0
|
|
|
|
Reply
|
fungus
|
5/12/2005 1:48:24 AM
|
|
|
1 Replies
350 Views
(page loaded in 0.089 seconds)
Similiar Articles: Displaying 10-bit image data using OpenGL - comp.graphics.api ...I am trying to take the data in a framegrabber buffer and display it in a dialog using OpenGL. The reason for this is becasue OpenGL will allow me to scale the image ... What is the fastest bitmap/texture to texture copy with stencil ...Displaying 10-bit image data using OpenGL - comp.graphics.api ... What is the fastest bitmap/texture to texture copy with stencil ..... and I would like to program demos ... To display a 3D skeleton, what do I need to learn? - comp.graphics ...Displaying 10-bit image data using OpenGL - comp.graphics.api ... To display a 3D skeleton, what do I need to learn? - comp.graphics ..... the object (But, again, OpenGL ... bitmap as array - comp.graphics.api.openglDisplaying 10-bit image data using OpenGL - comp.graphics.api ... What is the fastest bitmap/texture to texture copy with stencil ..... and I ... bitmap as array - comp ... Saving image in OpenGl - comp.graphics.api.openglDisplaying 10-bit image data using OpenGL - comp.graphics.api ... opengl save as jpeg - comp.soft-sys.matlab Change bit ... save an OpenGL scene as an image without showing ... what is native texture image format on graphics card? - comp ...What is the fastest bitmap/texture to texture copy with stencil ..... copied into the fast memory on the graphics card ... Displaying 10-bit image data using OpenGL ... opengl save as jpeg - comp.soft-sys.matlabDisplaying 10-bit image data using OpenGL - comp.graphics.api ... opengl save as jpeg - comp.soft-sys.matlab Change bit ... save an OpenGL scene as an image without showing ... glDrawPixels and Display lists - comp.graphics.api.opengl ...Displaying 10-bit image data using OpenGL - comp.graphics.api ... cjb111@student.canterbury.ac.nz wrote: > glDrawPixels(1000,1016,GL_COLOR_INDEX,GL ... display 2d cross-sections in 3d box - comp.lang.idl-pvwave ...Displaying 10-bit image data using OpenGL - comp.graphics.api ... In order to test the following section of code i saved ... Hi, I'm using OpenGl to display 2d data by a ... Display 2D circle on "screen" over 3D scene - comp.graphics.api ...Displaying 10-bit image data using OpenGL - comp.graphics.api ... screen coordinates and mouse event - comp.graphics.api.opengl ... Hi, I'm using OpenGl to display 2d data ... Displaying 10-bit image data using OpenGL - comp.graphics.api ...I am trying to take the data in a framegrabber buffer and display it in a dialog using OpenGL. The reason for this is becasue OpenGL will allow me to scale the image ... Help with displaying image using OpenGL...: Apple Support CommunitiesI am using some sample code that currently displays an image ... 2D texture image, provideing the a pointer to the image data ... Help with displaying image using OpenGL ... 7/22/2012 12:06:39 AM
|
|
|
|
|
|
|
|
|