Opened 9 years ago

Last modified 8 years ago

#7661 closed

wxTGAHandler

Reported by: sethjackson Owned by: jrgadd
Priority: low Milestone:
Component: Version:
Keywords: Cc: sethjackson, jrgadd, vadz
Blocked By: Blocking:
Patch: yes

Description

Hi I have (with a lot of help) coded a wxTGAHandler. It
supports the loading, but not saving of TGA files.

All TGA files are supported except data types 32 and 33.

Which are :

32 - Compressed color-mapped data, using Huffman,
Delta, and

runlength encoding.

33 - Compressed color-mapped data, using Huffman,

Delta, and

runlength encoding. 4-pass quadtree-type

process.

I hope it is usefull. :)

For some reason the imagtga.h header gets excluded from
my patch. It needs to go into include/wx.

Attachments (1)

wxWidgets.patch download (25.6 KB) - added by sethjackson 9 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by sethjackson

Well SF won't let me upload it. LOL

Here are the modified files

comment:2 Changed 9 years ago by sethjackson

Argh here is the zip archive of the changes.....

comment:3 Changed 9 years ago by sethjackson

Ok finnally I zipped the patch up. :) For some reason the
imagtga.h header doesn't get included in the .pacth file; it
needs to go in include/wx. Happy New Year. :)

comment:4 Changed 9 years ago by jrgadd

Can you please resubmit the patch without all the modified
makefiles?

And where's the save feature? :)

Thanks
Jamie

Changed 9 years ago by sethjackson

comment:5 Changed 9 years ago by sethjackson

Here you go. This is the same patch without the makefile.
Somehow the imagtga.h header got included this time......
Sorry no save feature (yet).

comment:6 Changed 9 years ago by jrgadd

This has been discussed and will be accepted into wx.

I will test and apply this patch when I have more time later
this month or early next. Can you please include a patch for
the documentation also.

Did you make any progress on the save feature?

comment:7 Changed 9 years ago by sethjackson

How do I create a doc patch? This handler works like all the
other handlers, except there is no save.... TGA is compiled
by default as you can see with my patch. Just use
wxBITMAP_TYPE_TGA (with a TGA file ofcourse) with
wxImage::LoadFile(), and you are all set.

No I didn't start coding the save feature.

comment:8 Changed 9 years ago by jrgadd

docs/latex/wx/image.tex will need to be updated so people
know that there is a TGA handler. I will do this.

It would be nice if samples/image was updated to showcase
the TGA support.

I asked about the save as you said "Sorry no save feature
(yet)". Just curious if you still intend on doing it as it
would be easier for me to test it all at once.

I'm well aware of how the patch works, I helped debug it on
the forum :-)

comment:9 Changed 9 years ago by sethjackson

Yeah it would be nice to have some image samples.... I'm not
much of a graphic artist, but I belive there are some
royalty free TGA files floating around on the 'net. Oh BTW
thanks for helping me code/debug this. :D I'm glad it is
going to be in wx. At the moment I don't have wx CVS sources
on my computer, and I wasn't planning on coding a save
feature anytime soon.... However if many people ask for it
coding a save function shouldn't be that hard. :D

comment:10 Changed 9 years ago by vadz

I think we should take the horse and convert it to TGA
(ImageMagick should be able to do it, shouldn't it?)

comment:11 Changed 9 years ago by sethjackson

ImageMagick supports TGA files so I guess it could (I have
never used ImageMagick though).

http://www.imagemagick.org/script/formats.php

Umm I'm not sure what horse you are talking about?
*embarrassed*

comment:12 Changed 8 years ago by vadz

I've decided we really had to apply this now if we wanted to
have it in 2.8, so this is what I did.

FYI, the horse is the image used throughout the image
sample. I've added it to the sample myself, updated the docs
and applied the patch.

I didn't have time to clean up the code in imagtga.cpp
itself unfortunately though. The ReadTGA() function is ~500
lines and this really shouldn't be changed, I hope someone
[else] can do it.

Note: See TracTickets for help on using tickets.