Does exist in opengl or in c++ some function to load jpg files ?
Bohus
|
|
0
|
|
|
|
Reply
|
Bohus
|
12/12/2003 7:00:56 PM |
|
"Bohus Kral" wrote:
> Does exist in opengl or in c++ some function
>to load jpg files ?
www.wotsit.org and search for jpeg
bye
marcus
|
|
0
|
|
|
|
Reply
|
marcus
|
12/12/2003 7:03:35 PM
|
|
> www.wotsit.org and search for jpeg
>
Thank you, but i was looking for some function that loads on my c++ program
jpg file, i am not interested of jpeg compression.
Bohus
|
|
0
|
|
|
|
Reply
|
Bohus
|
12/12/2003 7:59:25 PM
|
|
On Fri, 12 Dec 2003 20:59:25 +0100, Bohus Kral wrote:
>
>> www.wotsit.org and search for jpeg
>>
> Thank you, but i was looking for some function that loads on my c++ program
> jpg file, i am not interested of jpeg compression.
a Google search for:
opengl jpeg display function
gave:
http://members.tripod.com/rglass/code.htm
or you could go to:
http://www.geocities.com/~charlie_x/gfxlinks.htm
and scan down the page for jpeg.
John
|
|
0
|
|
|
|
Reply
|
intermezzo
|
12/12/2003 8:29:05 PM
|
|
Bohus Kral wrote:
> Does exist in opengl or in c++ some function to load jpg files ?
>
No.
The official library for loading JPG files is here:
http://www.ijg.org/
If you're only interested in using Microsoft Windows
then Intel makes a library which is a little bit easier
to use. Get it here:
http://www.intel.com/software/products/perflib/ijl/
If you might be interested in more image types then
OpenIL might be for you:
http://openil.sourceforge.net/
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
|
|
0
|
|
|
|
Reply
|
fungus
|
12/12/2003 8:32:06 PM
|
|
"fungus" <openglMY@SOCKSartlum.com> wrote in message
news:aBpCb.1884519$uj6.4571604@telenews.teleline.es...
> Bohus Kral wrote:
> > Does exist in opengl or in c++ some function to load jpg files ?
> If you're only interested in using Microsoft Windows
> then Intel makes a library which is a little bit easier
> to use. Get it here:
>
> http://www.intel.com/software/products/perflib/ijl/
Intel no longer provide the simple IJL library. Only IPP which was a 75Mbyte
download last time I looked.
Old copies of the IJL library are extremely elusive. The following
application http://www.john.findlay1.btinternet.co.uk/apps/apps.htm is a C
language (for lcc-win32) program that contains IJL15.DLL and IJL.H, perhaps
this can be adapted for C++.
IJL15.DLL contains some half-dozen functions including Load and Save JPEG
files from a memory bitmap, very simple. Most people aren't interested in
the complexities of JPEG.
Bart.
|
|
0
|
|
|
|
Reply
|
Bart
|
12/12/2003 9:29:52 PM
|
|
Bart Casiero wrote:
> "fungus" <openglMY@SOCKSartlum.com> wrote in message
> news:aBpCb.1884519$uj6.4571604@telenews.teleline.es...
>
>>Intel makes a library which is a little bit easier
>>to use. Get it here:
>>
>>http://www.intel.com/software/products/perflib/ijl/
>
>
> Intel no longer provide the simple IJL library. Only IPP which was a 75Mbyte
> download last time I looked.
>
Oh, you�re right. It�s vanished!
> Old copies of the IJL library are extremely elusive.
I've got a copy somewhere. I doubt if I'm allowed to
distribute it though.
> The following
> application http://www.john.findlay1.btinternet.co.uk/apps/apps.htm is a C
> language (for lcc-win32) program that contains IJL15.DLL and IJL.H, perhaps
> this can be adapted for C++.
>
The DLL file has exactly six functions in it....not hard
to hack an interface to it.
> IJL15.DLL contains some half-dozen functions including Load and Save JPEG
> files from a memory bitmap, very simple. Most people aren't interested in
> the complexities of JPEG.
>
Yes, it's very easy to use. Four or five lines of code
will load a file.
It's not as fast as the IJG library though (despite
Intel's dreams for it to be so...:-)
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
|
|
0
|
|
|
|
Reply
|
fungus
|
12/13/2003 2:23:11 AM
|
|
I use GDI+ (Windows only) to load all sort of fileformats (BMP, GIF, JPEG,
JPG, PNG, TIFF), works perfectly. Code extract to read the file below (I
presume you know how to turn it into a texture, or draw it directly)
Kind regards
Bart De Lathouwer
m_pData = NULL;
Bitmap * pPicture = new Bitmap( bstrFilename );
if (! pPicture || (pPicture && pPicture->GetLastStatus() != Ok))
throw _T("Failed to create new Bitmap");
pPicture->RotateFlip(Rotate180FlipX);
//
switch (pPicture->GetPixelFormat()) {
case PixelFormat8bppIndexed:
m_sSize.c = 1;
m_iInternalFormat = GL_ALPHA;
m_eFormat = GL_ALPHA;
break;
case PixelFormat24bppRGB:
m_sSize.c = 3;
m_iInternalFormat = m_sSize.c;
m_eFormat = GL_BGR_EXT;
break;
case PixelFormat32bppARGB:
m_sSize.c = 4;
m_iInternalFormat = m_sSize.c;
m_eFormat = GL_BGRA_EXT;
break;
case PixelFormat32bppRGB:
m_sSize.c = 4;
m_iInternalFormat = m_sSize.c;
m_eFormat = GL_BGRA_EXT;
break;
}
m_sSize.x = pPicture->GetWidth();
m_sSize.y = pPicture->GetHeight();
m_sSize.z = 1;
// Access
BitmapData bitmapData;
Rect bounds;
bounds.Width = pPicture->GetWidth();
bounds.Height = pPicture->GetHeight();
pPicture->LockBits(&bounds, ImageLockModeRead, pPicture->GetPixelFormat(),
&bitmapData);
UINT size = bitmapData.Height * bitmapData.Stride;
m_pData = new unsigned char[size];
memcpy(m_pData, bitmapData.Scan0, size);
pPicture->UnlockBits(&bitmapData);
"fungus" <openglMY@SOCKSartlum.com> wrote in message
news:jKuCb.1892641$uj6.4594221@telenews.teleline.es...
> Bart Casiero wrote:
> > "fungus" <openglMY@SOCKSartlum.com> wrote in message
> > news:aBpCb.1884519$uj6.4571604@telenews.teleline.es...
> >
> >>Intel makes a library which is a little bit easier
> >>to use. Get it here:
> >>
> >>http://www.intel.com/software/products/perflib/ijl/
> >
> >
> > Intel no longer provide the simple IJL library. Only IPP which was a
75Mbyte
> > download last time I looked.
> >
>
> Oh, you�re right. It�s vanished!
>
> > Old copies of the IJL library are extremely elusive.
>
> I've got a copy somewhere. I doubt if I'm allowed to
> distribute it though.
>
> > The following
> > application http://www.john.findlay1.btinternet.co.uk/apps/apps.htm is a
C
> > language (for lcc-win32) program that contains IJL15.DLL and IJL.H,
perhaps
> > this can be adapted for C++.
> >
>
> The DLL file has exactly six functions in it....not hard
> to hack an interface to it.
>
>
> > IJL15.DLL contains some half-dozen functions including Load and Save
JPEG
> > files from a memory bitmap, very simple. Most people aren't interested
in
> > the complexities of JPEG.
> >
>
> Yes, it's very easy to use. Four or five lines of code
> will load a file.
>
> It's not as fast as the IJG library though (despite
> Intel's dreams for it to be so...:-)
>
>
> --
> <\___/> For email, remove my socks.
> / O O \
> \_____/ FTB. Why isn't there mouse-flavored cat food?
>
>
|
|
0
|
|
|
|
Reply
|
Bart
|
12/13/2003 9:28:23 AM
|
|
I use DevIL (from sourceforge http://openil.sourceforge.net/) to load all
kinds of images. very easy to use, cros platform, and even has good
documentation!
eg:
// load image using devIL.
ILuint id, Error;
ilGenImages(1, &id);
ilBindImage(id);
ilLoadImage((char* const)strFileName);
Error = ilGetError();
if (Error)
{
g_debug << "DevIL Error " << (int)Error;
}
if (bMipMap)
iluBuildMipmaps();
"Bart De Lathouwer" <bart.de.lathouwer@cue-graphics.nospam.tv> wrote in
message news:XYACb.75424$f15.3018803@phobos.telenet-ops.be...
> I use GDI+ (Windows only) to load all sort of fileformats (BMP, GIF, JPEG,
> JPG, PNG, TIFF), works perfectly. Code extract to read the file below (I
> presume you know how to turn it into a texture, or draw it directly)
>
> Kind regards
>
> Bart De Lathouwer
>
>
>
> m_pData = NULL;
>
> Bitmap * pPicture = new Bitmap( bstrFilename );
> if (! pPicture || (pPicture && pPicture->GetLastStatus() != Ok))
> throw _T("Failed to create new Bitmap");
> pPicture->RotateFlip(Rotate180FlipX);
>
> //
> switch (pPicture->GetPixelFormat()) {
> case PixelFormat8bppIndexed:
> m_sSize.c = 1;
> m_iInternalFormat = GL_ALPHA;
> m_eFormat = GL_ALPHA;
> break;
> case PixelFormat24bppRGB:
> m_sSize.c = 3;
> m_iInternalFormat = m_sSize.c;
> m_eFormat = GL_BGR_EXT;
> break;
> case PixelFormat32bppARGB:
> m_sSize.c = 4;
> m_iInternalFormat = m_sSize.c;
> m_eFormat = GL_BGRA_EXT;
> break;
> case PixelFormat32bppRGB:
> m_sSize.c = 4;
> m_iInternalFormat = m_sSize.c;
> m_eFormat = GL_BGRA_EXT;
> break;
> }
>
> m_sSize.x = pPicture->GetWidth();
> m_sSize.y = pPicture->GetHeight();
> m_sSize.z = 1;
>
> // Access
> BitmapData bitmapData;
> Rect bounds;
> bounds.Width = pPicture->GetWidth();
> bounds.Height = pPicture->GetHeight();
> pPicture->LockBits(&bounds, ImageLockModeRead, pPicture->GetPixelFormat(),
> &bitmapData);
> UINT size = bitmapData.Height * bitmapData.Stride;
> m_pData = new unsigned char[size];
> memcpy(m_pData, bitmapData.Scan0, size);
> pPicture->UnlockBits(&bitmapData);
>
>
>
>
>
>
>
>
>
>
> "fungus" <openglMY@SOCKSartlum.com> wrote in message
> news:jKuCb.1892641$uj6.4594221@telenews.teleline.es...
> > Bart Casiero wrote:
> > > "fungus" <openglMY@SOCKSartlum.com> wrote in message
> > > news:aBpCb.1884519$uj6.4571604@telenews.teleline.es...
> > >
> > >>Intel makes a library which is a little bit easier
> > >>to use. Get it here:
> > >>
> > >>http://www.intel.com/software/products/perflib/ijl/
> > >
> > >
> > > Intel no longer provide the simple IJL library. Only IPP which was a
> 75Mbyte
> > > download last time I looked.
> > >
> >
> > Oh, you�re right. It�s vanished!
> >
> > > Old copies of the IJL library are extremely elusive.
> >
> > I've got a copy somewhere. I doubt if I'm allowed to
> > distribute it though.
> >
> > > The following
> > > application http://www.john.findlay1.btinternet.co.uk/apps/apps.htm is
a
> C
> > > language (for lcc-win32) program that contains IJL15.DLL and IJL.H,
> perhaps
> > > this can be adapted for C++.
> > >
> >
> > The DLL file has exactly six functions in it....not hard
> > to hack an interface to it.
> >
> >
> > > IJL15.DLL contains some half-dozen functions including Load and Save
> JPEG
> > > files from a memory bitmap, very simple. Most people aren't interested
> in
> > > the complexities of JPEG.
> > >
> >
> > Yes, it's very easy to use. Four or five lines of code
> > will load a file.
> >
> > It's not as fast as the IJG library though (despite
> > Intel's dreams for it to be so...:-)
> >
> >
> > --
> > <\___/> For email, remove my socks.
> > / O O \
> > \_____/ FTB. Why isn't there mouse-flavored cat food?
> >
> >
>
>
|
|
0
|
|
|
|
Reply
|
Andy
|
12/13/2003 11:26:54 AM
|
|
Bohus Kral wrote:
> Does exist in opengl or in c++ some function to load jpg files ?
I use the OpenIL (aka DevIL) library - piece of cake to use with opengl.
http://openil.sourceforge.net
Regards,
\\Mikkel Gjoel
|
|
0
|
|
|
|
Reply
|
Mikkel
|
12/15/2003 3:15:34 AM
|
|
If you're windows only, simply make use of the simple IPicture interface.
WTH
"Bohus Kral" <bohusk@host.sk> wrote in message
news:brd399$23c9c$1@ID-112213.news.uni-berlin.de...
> Does exist in opengl or in c++ some function to load jpg files ?
>
> Bohus
>
>
|
|
0
|
|
|
|
Reply
|
WTH
|
12/15/2003 4:15:40 AM
|
|
|
10 Replies
373 Views
(page loaded in 0.224 seconds)
|