Welcome, Guest. Please login or register.

Author Topic: Pen Independent Images.  (Read 4580 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Pen Independent Images.
« Reply #14 from previous page: August 07, 2007, 11:18:13 PM »
Quote

BOBs or Blitter OBjects are just rectangular gfx drawn by the system. With gfxcard you can use BltBitMap family routines (see graphics.doc). Note that you'll need to handle background restoration yourself (if you need any).


In fact with modern gfx boards BOBs are faster and more versatile than sprites. But I know you knew this already :-)
My Amigas: A500, Mac Mini and PowerBook
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show only replies by EDanaII
    • http://www.EdwardGDanaII.info
Re: Pen Independent Images.
« Reply #15 on: August 08, 2007, 05:35:21 AM »
@ Piru

There's a tool on Aminet (and included with Amikit) called GfxCon that converts between many different formats, including what it calls "RGB-Raw." I've no clue if this is ARGB or RGBA format, but I suspect I'll find out once I begin to experiment with it.

Ed.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show only replies by EDanaII
    • http://www.EdwardGDanaII.info
Re: Pen Independent Images.
« Reply #16 on: August 17, 2007, 07:16:20 AM »
All right, following up on this, I took Piru's example and changed the part where he populated the array variable with this bit of code:
Code: [Select]
     while(!done) {
          UBYTE a; if (!done) if (!(a = fgetc(test))) done = TRUE;
          UBYTE r; if (!done) if (!(r = fgetc(test))) done = TRUE;
          UBYTE g; if (!done) if (!(g = fgetc(test))) done = TRUE;
          UBYTE b; if (!done) if (!(b = fgetc(test))) done = TRUE;
          if (!done) array[y * WIDTH + x] = (r << 16) | (g << 8) | b;
      }


Unfortunately, and not unexpectedly, all I got was garbage. I even switched the "UBYTE a" variable from first to last to account for the differences between ARGB and RGBA. I may be approaching this completely wrong and may have made a number of bad assumptions. As always, if ya gots some clues, please enlighten me. :-)

Ed.
Ed.
 

Offline EDanaIITopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 579
    • Show only replies by EDanaII
    • http://www.EdwardGDanaII.info
Re: Pen Independent Images.
« Reply #17 on: August 17, 2007, 04:54:47 PM »
I figured it out... The raw format I was using has no alpha channel, so it was simple RGB, not RGBA or ARGB. Also, I needed to redefine char to UBYTE, like so:
Code: [Select]
         UBYTE r = (UBYTE)fgetc(test);
          UBYTE g = (UBYTE)fgetc(test);
          UBYTE b = (UBYTE)fgetc(test);


Ed.
Ed.