I open and use bitmaps in OpenGL as following:
AUX_RGBImageRec *TextureImage[4];
memset(TextureImage,0,sizeof(void*)*1);
TextureImage[0] = auxDIBImageLoad("Data/5.bmp");
glGenTextures(1,&texture[0]);
glBindTexture(GL_TEXTURE_2D,texture[0]);
glTexImage2D(GL_TEXTURE_2D,0,3,
TextureImage[0]->sizeX,TextureImage[0]->sizeY,0,GL_RGB,GL_UNSIGNED_BYTE,Text
ureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
My question is:
How I can open, read and use .jpg file?
Thanks for help.
|
|
0
|
|
|
|
Reply
|
wowiii
|
12/25/2005 1:55:16 PM |
|
wowiii wrote:
> I open and use bitmaps in OpenGL as following:
>
>
> AUX_RGBImageRec *TextureImage[4];
> memset(TextureImage,0,sizeof(void*)*1);
> TextureImage[0] = auxDIBImageLoad("Data/5.bmp");
>
> glGenTextures(1,&texture[0]);
>
> glBindTexture(GL_TEXTURE_2D,texture[0]);
> glTexImage2D(GL_TEXTURE_2D,0,3,
> TextureImage[0]->sizeX,TextureImage[0]->sizeY,0,GL_RGB,GL_UNSIGNED_BYTE,Text
> ureImage[0]->data);
> glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
> glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
>
> My question is:
> How I can open, read and use .jpg file?
>
> Thanks for help.
>
>
>
0) google ;-)
a) use an appropriate lib (libjpeg)
b) use a general lib that allows you to load all kind of file formats
(devil)
c) program your own library according to the JPEG spec
image loading is not supported by OpenGL.
|
|
0
|
|
|
|
Reply
|
David
|
12/25/2005 2:13:09 PM
|
|
David Zellhoefer wrote:
> wowiii wrote:
>
>> I open and use bitmaps in OpenGL as following:
>>
>>
>> AUX_RGBImageRec *TextureImage[4];
>> memset(TextureImage,0,sizeof(void*)*1);
>> TextureImage[0] = auxDIBImageLoad("Data/5.bmp");
>>
>> glGenTextures(1,&texture[0]);
>>
>> glBindTexture(GL_TEXTURE_2D,texture[0]);
>> glTexImage2D(GL_TEXTURE_2D,0,3,
>> TextureImage[0]->sizeX,TextureImage[0]->sizeY,0,GL_RGB,GL_UNSIGNED_BYTE,Text
>>
>> ureImage[0]->data);
>> glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
>> glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
>>
>> My question is:
>> How I can open, read and use .jpg file?
>>
>> Thanks for help.
>>
>>
>>
> 0) google ;-)
> a) use an appropriate lib (libjpeg)
> b) use a general lib that allows you to load all kind of file formats
> (devil)
> c) program your own library according to the JPEG spec
>
> image loading is not supported by OpenGL.
i forgot to say that jpgs are not recommended as a texture image format,
browse the group for details.
|
|
0
|
|
|
|
Reply
|
David
|
12/25/2005 2:14:22 PM
|
|
David Zellhoefer wrote:
>
> jpgs are not recommended as a texture image format,
> browse the group for details.
I use them all the time...what's the problem?
--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.
In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again. They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful. But it happens
every day. I cannot recall the last time something like
that happened in politics or religion.
- Carl Sagan, 1987 CSICOP keynote address
|
|
0
|
|
|
|
Reply
|
fungus
|
12/25/2005 7:22:16 PM
|
|
fungus wrote:
> David Zellhoefer wrote:
>
>>
>> jpgs are not recommended as a texture image format, browse the group
>> for details.
>
>
> I use them all the time...what's the problem?
Presumably the lossy compression, when a texture is magnified so are the
compression artifacts. If you can deal with the quality trade-off there
is no reason not to use jpg...
|
|
0
|
|
|
|
Reply
|
Michael
|
12/25/2005 9:08:21 PM
|
|
fungus wrote:
> David Zellhoefer wrote:
>>
>> jpgs are not recommended as a texture image format,
>> browse the group for details.
>
> I use them all the time...what's the problem?
JPEGs are not intended to be tiled. It easily happens that the
compression affects the colour and brightness at the edges
differently depending on the surrounding pixel values. If you
lossy compress a seamless texture w/o using a tilig aware
algorithm you will get noticable edges.
Wolfgang Draxinger
--
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
12/25/2005 9:39:21 PM
|
|
|
5 Replies
289 Views
(page loaded in 0.077 seconds)
Similiar Articles: Jpg with OpenGL - comp.graphics.api.openglI open and use bitmaps in OpenGL as following: AUX_RGBImageRec *TextureImage[4]; memset(TextureImage,0,sizeof(void*)*1); TextureImage[0] = auxDIBIma... jpg loader for .3ds textures - comp.graphics.api.openglHi, I have a 3d engine (visual c++ native) based on Opengl. I recently injected some code to load and display .3ds objects. However, the code use... opengl save as jpeg - comp.soft-sys.matlabHello, I am plotting a map using geoshow then I mask out the oceans. For it to look right on the screen I set the renderer to opengl. Looks exac... Creating a color map with opengl - comp.graphics.api.opengl ...Is there any possibility to plot this with openGL, are there any predefined ... Tim [1]http://www.zeigen.com/blog/wp-content/weather-map.jpg Loading Images (JPEG, GIF, TGA, BMP, ...) into OpenGL for texture ...Is there a universal library for loading images into OpenGL for textures? If there is, then I cannot find it. In addition, is there a better image fo... OpenGL extensions in VB - comp.graphics.api.openglAPI save as jpeg - comp.cad.solidworks DLL engine with a Visual Basic API that converts PDF to JPEG ... ... Jpg with OpenGL - comp.graphics.api.opengl I open and ... Export figures to bmp or jpg. Change bit depth or size - comp.soft ...Jpg with OpenGL - comp.graphics.api.opengl Export figures to bmp or jpg. Change bit depth or size - comp.soft ... Change bit depth or size - comp.soft ... C++ code for 3ds load and display on WinXP and Linux - comp ...Jpg with OpenGL - comp.graphics.api.opengl C++ code for 3ds load and display on WinXP and Linux - comp ... C++ source code to load and display 3ds, lwo, obj files - opengl ... WANTED: OpenGL 2D plotting library - comp.graphics.api.opengl ...Hallo! Currently I'm developing a scientific application, which is written in C++ for Windows. I've already implemented 3D visualization using OpenGL... Texture Compression - comp.graphics.api.openglJpg with OpenGL - comp.graphics.api.opengl Presumably the lossy compression, when a texture is magnified so are the compression artifacts. If you can deal with the quality ... OpenGL FAQ / 24 MiscellaneousA 3DS import library in Delphi designed for use with OpenGL can be found here. 24.050 How can I save my OpenGL rendering as an image file, such as GIF, TIF, JPG ... Jpg with OpenGL - comp.graphics.api.opengl | Computer GroupI open and use bitmaps in OpenGL as following: AUX_RGBImageRec *TextureImage[4]; memset(TextureImage,0,sizeof(void*)*1); TextureImage[0] = auxDIBIma... 7/24/2012 3:58:46 PM
|