• Welcome to Valhalla Legends Archive.
 

TGA and other image handling.

Started by TheNewOne, August 23, 2005, 02:05 AM

Previous topic - Next topic

TheNewOne

Alright Ive been asked to write some software for a companys os platform to support tga and other such images. Ive been researching tga to begin with and I was wondering how to exclude certain bytes or to include new ones to change the format. This way I can handle different parts of this image on my own how i want to handle them. Any insight would be greatly appreciated.

R.a.B.B.i.T

If you want to exclude them...ignore them :|
If you want to include them...add them!
A linked-list sounds good for easy manipulation of what you are asking (at least by the sounds of it), though if it's C, you're out of luck on the linked list part...
struct tga_byte
{
    void *next;
    void *first;
    unsigned char data;
    // other stuff
}

Eric

You'll have to decompress the entire Targa file before you can change it's format.

Adron

Really, your question makes no sense. You want to change the format, add and remove a few bytes here and there? Just read the original file and write a new file with your bytes added / removed. Does it matter that it's a tga file? Not at all. It probably won't be a tga file after you change the format of it though.

Arta

Quote from: rabbit on August 23, 2005, 02:44 AM
though if it's C, you're out of luck on the linked list part...

Youwhatnow?

R.a.B.B.i.T

Last time I tried to use a struct in any of my C I got errors about undefined type, and I haven't learned a way to make linked lists to easy in C thus far.  AFAIK structs are C++?

Blaze

Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

MyndFyre

It depends on how you define it.  Semantically, AFAIK, the following are differently-named (besides capitalization):

typedef struct tagByteNode {
  unsigned char data;
  struct tagByteNode* next;
} BYTE_NODE, *PBYTE_NODE;

struct byteNode {
  unsigned char data;
  byteNode* next;
}


AFAIK, you can't reference the first as "tagByteNode", only as BYTE_NODE, or via a pointer as PBYTE_NODE.  The latter you reference by the name you give the structure.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

R.a.B.B.i.T

Nevermind about being out of luck then.