Welcome, Guest. Please login or register.

Author Topic: Arghh.. getting errors in the jpeg.library includes with VBCC  (Read 3891 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Arghh.. getting errors in the jpeg.library includes with VBCC
« on: September 16, 2004, 09:05:20 PM »
@Jose

If decoding jpegs is sufficient for your needs, why not try using datatypes (this assumes, of course, OS3.x minimum) ?
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Arghh.. getting errors in the jpeg.library includes with VBCC
« Reply #1 on: September 16, 2004, 11:54:41 PM »
@Jose

It doesnt have to be that hard.

Here is some code that forms the ImageLoader class for the AmigaOS implementation of my OOP framework. Sorry it's C++, but at the same time you will see the OS functions you need. They are

NewDTObject( ) - creates a new (datatype) object (specified as a filename which is really handy!)

GetDTAttrs( ) - gets attributes of the object, in this case writing the bitmap data into a struct BitMapHeader and so on.

DoMethod( ) - invokes a method of the object - in this case PDTM_READPIXELARRAY which I use to get the raw RGB data out of my datatype, storing it in my own ImageBuffer object (which is a simply chunky pixel raster type thing).

DisposeDTObject( ) - destroys the datatype object once your'e done with it.

It's not as hard as it looks - I myself had to ask here originally for an example also (can't find the thread, but it must be here some place).

As for speed, it is highly subjective. 680x0 apps on my system can load jpegs in a flash since the decoding is using PPC ;-)

int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Arghh.. getting errors in the jpeg.library includes with VBCC
« Reply #2 on: September 17, 2004, 10:35:46 PM »
@Jose

Well, that example source is a small component of a much larger system so you won't be able to compile it. I just had it handy as a way of showing a quick way to load image data using datatypes. The same overall method is equally applicable to C code, so you should be able to do it in VBCC.

Using datatypes also, of course, allows you to keep your image as a struct BitMap if that is what you want. My needs were different (I just wanted the RGB data), since I had my own ImageBuffer class.
int p; // A