Hallo Cheatah,
war mit den vorhergehenden Sachen wohl noch nicht ganz durch.
Der Text zu GIF89a ist wohl doch um ein Vielfaches präziser.
Zu HEADER
hier wird die Signatur explizit auf 'GIF' begrenzt.
Der String '87a' oder '89a' wird benutzt um der verarbeitenden
Anwendung mitzuteilen welche Fähigkeiten sie aufweisen muß.
Kann eine Anwendung eine 89a-Datei nicht verarbeiten, so
sollte sie eine Fehlermeldung ausgeben.
Wenn Du also auch Bilder einlesen willst, dann solltest Du
besser GIF89a 'können'.
HINWEIS: der HEADER muß vorhanden sein, und zwar genau 1mal.
BEACHTE, in den Tabellen sind die Zählweisen geändert,
sie beginnen jetzt mit 0!
7 6 5 4 3 2 1 0 Field Name Type
+---------------+
0 | | 'G' Signature 3 Bytes
+- -+
1 | | 'I'
+- -+
2 | | 'F'
+---------------+
3 | | '8' Version 3 Bytes
+- -+
4 | | '7' oder '9'
+- -+
5 | | 'a'
+---------------+
zu LOGICAL SCREEN DESCRIPTOR.
7 6 5 4 3 2 1 0 Field Name Type
+---------------+
0 | | Logical Screen Width Unsigned
+- -+
1 | |
+---------------+
2 | | Logical Screen Height Unsigned
+- -+
3 | |
+---------------+
4 | | | | | <Packed Fields> See below
+---------------+
5 | | Background Color Index Byte
+---------------+
6 | | Pixel Aspect Ratio Byte
+---------------+
HINWEIS: der LOGICAL SCREEN DESCRIPTOR muß vorhanden sein,
und zwar genau 1mal.
zu Logical Screen Width und Logical Screen Height ist mir nichts
neues aufgefallen.
<Packed Fields> =
Global Color Table Flag 1 Bit (M)
Color Resolution 3 Bits (cr)
Sort Flag 1 Bit (0)
Size of Global Color Table 3 Bits (bits/pixel)
hier sind nun alle bits belegt.
GLOBAL COLOR TABLE FLAG (M) wie gehabt, mit dem Zusatz, daß der Inhalt
des Feldes Background bedeutungslos ist wenn dieses Bit = 0.
Values : 0 - No Global Color Table follows, the Background
Color Index field is meaningless.
1 - A Global Color Table will immediately follow, the
Background Color Index field is meaningful.
COLOR RESOLUTION (cr) Erklärung präziser. Dieses Feld hat 3 bit,
womit ein maximaler Wert von 8 angegeben werden kann, also 8 bit
pro RGB-Farbe und Pixel.
Damit können dann maximal 24bit-Farben definiert werden (256 aus...).
Color Resolution - Number of bits per primary color available
to the original image, minus 1. This value represents the size of
the entire palette from which the colors in the graphic were
selected, not the number of colors actually used in the graphic.
For example, if the value in this field is 3, then the palette of
the original image had 4 bits per primary color available to create
the image. This value should be set to indicate the richness of
the original palette, even if not every color from the whole
palette is available on the source machine.
SORT FLAG (0) ist neu, war vorher null. Dieses Bit oder Flag gibt
an ob die Palette (wohl nach Häufigkeit) sortiert ist oder nicht.
v) Sort Flag - Indicates whether the Global Color Table is sorted.
If the flag is set, the Global Color Table is sorted, in order of
decreasing importance. Typically, the order would be decreasing
frequency, with most frequent color first. This assists a decoder,
with fewer available colors, in choosing the best subset of colors;
the decoder may use an initial segment of the table to render the
graphic.
Values : 0 - Not ordered.
1 - Ordered by decreasing importance, most
important color first.
SIZE OF GLOBAL COLOR TABLE (bits/pixel) Erklärung besser.
Dieser Wert hoch 2 genommen gibt die Länge der globalen
Palette an. 2 hoch 8 ergibt 256, wodurch die Palette also maximal
256 Einträge bekommen kann. Die Palette kann aber wiederum
aus 24bit-Werten bestehen, was besagte 16Mio Farben ergeben könnte.
Das hier beschriebene Prinzip ermöglicht also eine Auswahl
von 256 Farben aus 16Mio. Das kommt einem doch bekannt vor, oder?
Size of Global Color Table - If the Global Color Table Flag is
set to 1, the value in this field is used to calculate the number
of bytes contained in the Global Color Table. To determine that
actual size of the color table, raise 2 to [the value of the field
- 1]. Even if there is no Global Color Table specified, set this
field according to the above formula so that decoders can choose
the best graphics mode to display the stream in. (This field is
made up of the 3 least significant bits of the byte.)
BACKGROUND COLOR INDEX Erklärung besser.
Für HTML eigentlich bedeutungslos da dabei der Hintergrund, der
Bereich um das Bild herum anders bestimmt wird.
Index into the Global Color Table for
the Background Color. The Background Color is the color used for
those pixels on the screen that are not covered by an image. If the
Global Color Table Flag is set to (zero), this field should be zero
and should be ignored.
PIXEL ASPECT RATIO neu, war vorher auf null. Gibt das Seitenverhältnis
einzelner Pixel an. Solltest Du auf vermutlich lieber null halten.
Mir ist nicht klar inwieweit diese Information mit den Setitenver-
hältnissen des Bildes zusammenspielen muß. Gesetzt den Fall Du hast
oben 100*100 Pixel gesagt und hier steht 4, wie soll Dein Bild werden?
Ist es dann 400*100 oder 100*400?
Pixel Aspect Ratio - Factor used to compute an approximation
of the aspect ratio of the pixel in the original image. If the
value of the field is not 0, this approximation of the aspect ratio
is computed based on the formula:
Aspect Ratio = (Pixel Aspect Ratio + 15) / 64
The Pixel Aspect Ratio is defined to be the quotient of the pixel's
width over its height. The value range in this field allows
specification of the widest pixel of 4:1 to the tallest pixel of
1:4 in increments of 1/64th.
Values : 0 - No aspect ratio information is given.
1..255 - Value used in the computation.
Weiter sind wir eigentlich noch nicht, aber ein paar Sachen werden
mir langsam etwas klarer, Dir auch?
Die Unterschiede zwischen 87a und 89a scheinen mir bislang nicht so
gravierend zu sein als daß man sich deswegen auf 87a beschränken sollte.
Klaus
PS: da scheint ja einiger Traffic zu sein und Du scheinst auch langsam
Blut zu lecken. Unabhängig davon ob es schon was gibt, sollten wir
uns da langsam mal durchfressen. Was ich von Deinen Überlegungen auf
die Schnelle so gesehen habe scheint ok zu sein. Gucke es mir aber erst
später genauer an.