|
![](/i/fill.gif) |
Mike Weber wrote:
>
> I thought about it myself. I think what I need to do is write a small
> Windows program that I can specify the command line, name of the files to
> annotate and indicating the start and stop numbers. I have image001.tga
> image002.tga...image 360.tga and shell out to DOS to have it run.
I sort of already wrote it a while ago. But having DOS pointer problems.
urggg.
A simple thing called imprint.exe. It takes a file called imprint.tga
and alphas it onto every other TGA file in your current directory that
has has the same width/height/uncompressed 24 bit format. If I have a
little more time tonight I'll see about finishing it. Or at least
posting it somewhere here to let other people more familiar with DOS
16-bit oddities have a go at debugging. :)
If it wasn't for 16-bit probs, I'd have already had her done.
This is the TGA file format btw:
/*
--------------------------------------------------------------------------------
DATA TYPE 2: Unmapped RGB
images. |
_______________________________________________________________________________|
| Offset | Length |
Description |
|--------|--------|------------------------------------------------------------|
|--------|--------|------------------------------------------------------------|
| 0 | 1 | Number of Characters in Identification
Field. |
| |
| |
| | | This field is a one-byte unsigned integer,
specifying |
| | | the length of the Image Identification Field. Its
value |
| | | is 0 to 255. A value of 0 means that no
Image |
| | | Identification Field is
included. |
| |
| |
|--------|--------|------------------------------------------------------------|
| 1 | 1 | Color Map
Type. |
| |
| |
| | | This field contains either 0 or 1. 0 means no
color map |
| | | is included. 1 means a color map is included, but
since |
| | | this is an unmapped image it is usually ignored.
TIPS |
| | | ( a Targa paint system ) will set the border
color |
| | | the first map color if it is
present. |
| |
| |
|--------|--------|------------------------------------------------------------|
| 2 | 1 | Image Type
Code. |
| |
| |
| | | This field will always contain a binary
2. |
| | | ( That's what makes it Data Type 2
). |
| |
| |
|--------|--------|------------------------------------------------------------|
| 3 | 5 | Color Map
Specification. |
| |
| |
| | | Ignored if Color Map Type is 0; otherwise,
interpreted |
| | | as
follows: |
| |
| |
| 3 | 2 | Color Map
Origin. |
| | | Integer ( lo-hi ) index of first color map
entry. |
| |
| |
| 5 | 2 | Color Map
Length. |
| | | Integer ( lo-hi ) count of color map
entries. |
| |
| |
| 7 | 1 | Color Map Entry
Size. |
| | | Number of bits in color map entry. 16 for the
Targa 16, |
| | | 24 for the Targa 24, 32 for the Targa
32. |
| |
| |
|--------|--------|------------------------------------------------------------|
| 8 | 10 | Image
Specification. |
| |
| |
| 8 | 2 | X Origin of
Image. |
| | | Integer ( lo-hi ) X coordinate of the lower left
corner |
| | | of the
image. |
| |
| |
| 10 | 2 | Y Origin of
Image. |
| | | Integer ( lo-hi ) Y coordinate of the lower left
corner |
| | | of the
image. |
| |
| |
| 12 | 2 | Width of
Image. |
| | | Integer ( lo-hi ) width of the image in
pixels. |
| |
| |
| 14 | 2 | Height of
Image. |
| | | Integer ( lo-hi ) height of the image in
pixels. |
| |
| |
| 16 | 1 | Image Pixel
Size. |
| | | Number of bits in a pixel. This is 16 for Targa
16, |
| | | 24 for Targa 24, and .... well, you get the
idea. |
| |
| |
| 17 | 1 | Image Descriptor
Byte. |
| | | Bits 3-0 - number of attribute bits associated with
each |
| | | pixel. For the Targa 16, this would be
0 or |
| | | 1. For the Targa 24, it should be 0.
For |
| | | Targa 32, it should be
8. |
| | | Bit 4 - reserved. Must be set to
0. |
| | | Bit 5 - screen origin
bit. |
| | | 0 = Origin in lower left-hand
corner. |
| | | 1 = Origin in upper left-hand
corner. |
| | | Must be 0 for Truevision
images. |
| | | Bits 7-6 - Data storage interleaving
flag. |
| | | 00 =
non-interleaved. |
| | | 01 = two-way (even/odd)
interleaving. |
| | | 10 = four way
interleaving. |
| | | 11 =
reserved. |
| |
| |
|--------|--------|------------------------------------------------------------|
| 18 | varies | Image Identification
Field. |
| | | Contains a free-form identification field of the
length |
| | | specified in byte 1 of the image record. It's
usually |
| | | omitted ( length in byte 1 = 0 ), but can be up to
255 |
| | | characters. If more identification information
is |
| | | required, it can be stored after the image
data. |
| |
| |
|--------|--------|------------------------------------------------------------|
| varies | varies | Color map
data. |
| |
| |
| | | If the Color Map Type is 0, this field doesn't
exist. |
| | | Otherwise, just read past it to get to the
image. |
| | | The Color Map Specification describes the size of
each |
| | | entry, and the number of entries you'll have to
skip. |
| | | Each color map entry is 2, 3, or 4
bytes. |
| |
| |
|--------|--------|------------------------------------------------------------|
| varies | varies | Image Data
Field. |
| |
| |
| | | This field specifies (width) x (height) pixels.
Each |
| | | pixel specifies an RGB color value, which is stored
as |
| | | an integral number of
bytes. |
| |
| |
| | | The 2 byte entry is broken down as
follows: |
| | | ARRRRRGG GGGBBBBB, where each letter represents a
bit. |
| | | But, because of the lo-hi storage order, the first
byte |
| | | coming from the file will actually be GGGBBBBB, and
the |
| | | second will be ARRRRRGG. "A" represents an
attribute bit. |
| |
| |
| | | The 3 byte entry contains 1 byte each of blue,
green, |
| | | and
red. |
| |
| |
| | | The 4 byte entry contains 1 byte each of blue,
green, |
| | | red, and attribute. For faster speed (because of
the |
| | | hardware of the Targa board itself), Targa 24
images are |
| | | sometimes stored as Targa 32
images. |
| |
| |
--------------------------------------------------------------------------------
*/
--
Lewis A. Sellers: writer and contract Multimedia Website Developer
mailto:lse### [at] usit net (The Fourth Millennium Foundation)
http://www.public.usit.net/lsellers/ & http://www.intrafoundation.com
http://brain-of-pooh.tech-soft.com/users/critters/bios/sellers_lewis.html
You can bug the living bejesus out of me live on ICQ @ 491461
(If I don't get back to you within a month, I'm out of prozac in some
dark corner somewhere screaming things quite unintelligable but -- most
curiously -- thick with a sumerian accent.)
"The comedy is over" -i pagliacci
Post a reply to this message
|
![](/i/fill.gif) |