Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
bmp2raw

 
Post new topic   Reply to topic Printable version
 View previous topic  do YOU have an idea? Post :: Post visual studio disassembly debugging  View next topic  
Author Message
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sun Sep 09, 2007 5:59 am    Post subject: bmp2raw Reply to topic Reply with quote

Since tcsoccerman decided not make this, and I kinda needed it I went ahead and made it.

It's primary purpose is generating raw textures for graphics libraries such as Open GL.

Currently it accepts 24-bit bmp's as from mspaint and can convert them to 8888, 4444, 5551 and 5650 formats. It can also optionally convert 1 color to represent full alpha transparency. One notable limitation is I didn't add support for the trailing zeroes found in bmp's that don't have a width divisible by 4, this isn't too much of a problem as textures have to be a power of 2 anyway.

I've included two sample images, they can be opened with Irfanview, but it has the byte order the wrong way round so colors are inversed (or something like that).

Here are the comments at the top of the source file:
Code: Show/Hide
* notes:
* - bitmap must be 24-bit format (default output of mspaint).
* - bitmap width must be a multiple of 4 (due to trailing zeroes).
* - for use as a texture bitmap dimensions must be a power of 2, but they
*    don't have to be the same, for example width 64 and height 128.
*
* fixme:
* - add support for bmps with widths not a multiple of 4 (trailing zeroes)
* - add support for paletted bmps (8-bit, etc) -> 8888
* - add support for generating palettes from 8888 bmps
*   (most likely use first n colors found instead of smart dithering)

_________________
ss news




src, windows exe, example images

bmp2raw.zip - 25.62 KB
File downloaded or viewed 39 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Sep 09, 2007 11:04 am    Post subject: Reply to topic Reply with quote

Sorry i couldn't make it, i had no idea what raw files were. I'll check it out.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sun Sep 09, 2007 12:16 pm    Post subject: Reply to topic Reply with quote

That's ok. There's many different things with the .raw extension. Even Irfanview a generic image viewer opens my raw's differently from what I need.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


Age:26
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Sep 09, 2007 1:51 pm    Post subject: Reply to topic Reply with quote

ya i downloaded irfranview and it lookedwierd...
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 79 page(s) served in previous 5 minutes.

phpBB Created this page in 0.114278 seconds : 30 queries executed (41.6%): GZIP compression disabled