„X BitMap“ – Versionsunterschied
[gesichtete Version] | [gesichtete Version] |
Nutze C Syntaxhighlight |
MIME-Type durch Mozilla belegt / Archivlink bestätigt / Nutzung der Vorlage Internetquelle / MIME-Typ => MIME-Type (einheitlich mit der Infobox, wo auch Type steht) / Quellen => Einzelnachweise ("Standardbegriff") |
||
Zeile 7: | Zeile 7: | ||
| Dateiendung = <code>.xbm</code> |
| Dateiendung = <code>.xbm</code> |
||
| MIME = image/x‑xbitmap, image/x‑xbm |
| MIME = image/x‑xbitmap, image/x‑xbm |
||
| MIME-Anm = <ref name="iana">Der .xbm [[Internet Media Type|MIME- |
| MIME-Anm = <ref name="iana">Der .xbm [[Internet Media Type|MIME-Type]] ist nicht bei der [[Internet Assigned Numbers Authority|IANA]] [http://www.iana.org/assignments/media-types/media-types.xhtml#image registriert]</ref><ref name="MDN_MimeType">{{Internetquelle|titel=Image file type and format guide > XBM (X Window System Bitmap file)|url=http://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types|hrsg=Mozilla|sprache=en|abruf=2022-06-19}}</ref> |
||
| MagischeZahl = |
| MagischeZahl = |
||
| MagischeZahlNotation = |
| MagischeZahlNotation = |
||
Zeile 24: | Zeile 24: | ||
}} |
}} |
||
'''X BitMap (XBM)''' ist ein Format für die Darstellung von monochromen Rastergrafiken, hauptsächlich [[Cursor]]s und [[Icon (Computer)|Icons]]. Das XBM-Dateiformat wurde 1989 durch [[XPM]] für X11 ersetzt.<ref>{{ |
'''X BitMap (XBM)''' ist ein Format für die Darstellung von monochromen Rastergrafiken, hauptsächlich [[Cursor]]s und [[Icon (Computer)|Icons]]. Das XBM-Dateiformat wurde 1989 durch [[XPM]] für X11 ersetzt.<ref name="W3_XPM_Story">{{Internetquelle|autor=Daniel Dardailler, Colas Nahaboo, Arnaud Le Hors|titel=The XPM Story|url=http://www.w3.org/People/danield/xpm_story.html|datum=1996-07-15|sprache=en|archiv-url=http://web.archive.org/web/20181114053701/http://www.w3.org/People/danield/xpm_story.html|archiv-datum=2018-11-14|abruf=2022-06-19}}</ref> |
||
Die Grafiken bestehen aus reinen Textdateien in der Syntax der Programmiersprache [[C (Programmiersprache)|C]]; |
Die Grafiken bestehen aus reinen Textdateien in der Syntax der Programmiersprache [[C (Programmiersprache)|C]]; |
||
Zeile 90: | Zeile 90: | ||
das erste Pixel des Bildes, also seine linke obere Ecke, ist das Nullte Bit des ersten Bytes. |
das erste Pixel des Bildes, also seine linke obere Ecke, ist das Nullte Bit des ersten Bytes. |
||
== |
== Einzelnachweise == |
||
<references /> |
<references /> |
||
Aktuelle Version vom 19. Juni 2022, 05:49 Uhr
X BitMap | |
---|---|
![]() | |
Dateiendung: |
|
MIME-Type: | image/x‑xbitmap, image/x‑xbm [1][2]
|
Art: | Grafikformat |
Erweitert von: | C (Programmiersprache) |
Erweitert zu: | X PixMap (XPM) |
X BitMap (XBM) ist ein Format für die Darstellung von monochromen Rastergrafiken, hauptsächlich Cursors und Icons. Das XBM-Dateiformat wurde 1989 durch XPM für X11 ersetzt.[3]
Die Grafiken bestehen aus reinen Textdateien in der Syntax der Programmiersprache C; sie können daher mit einem einfachen Texteditor bearbeitet und direkt in Quellcode (C oder C++) eingebunden werden.
Obwohl das Grafikformat schon sehr alt und in seiner Funktionalität zudem so stark eingeschränkt ist, eignet es sich jedoch aufgrund seiner Einfachheit hervorragend zur Verwendung in kleinen Lehr- oder Beispielprogrammen, die pixelbasiert arbeiten.
Beispiel
[Bearbeiten | Quelltext bearbeiten]
Dieses Dateibeispiel zeigt das X11-Logo in einer Auflösung von 64 × 64 Pixeln:
#define w 64
#define h 64
static char img[] = {
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0xf8, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x7c,
0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x07, 0x00,
0x00, 0x00, 0x00, 0x1f, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x0f,
0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0x0f, 0xc0, 0xff, 0x3f, 0x00,
0x00, 0x00, 0xc0, 0x07, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0x03,
0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0xff, 0xff, 0x00,
0x00, 0x00, 0xf8, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x00,
0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xfc, 0xff, 0x03,
0x00, 0x00, 0x3e, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x1f, 0x00,
0x00, 0xf0, 0xff, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0x0f,
0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xc0, 0x07, 0x00,
0x00, 0xc0, 0xff, 0x3f, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xff, 0x7f,
0x00, 0xf0, 0x01, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x3e, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x03, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcf, 0x07, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xcf, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xe7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xf3, 0x01, 0x00, 0x00,
0x00, 0x00, 0x80, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7e, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x07, 0x00, 0x00,
0x00, 0x00, 0x80, 0xcf, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe7,
0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe7, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xc3, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc1,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x80, 0xff, 0x7f, 0x00, 0x00,
0x00, 0x00, 0x7c, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xfe, 0xff, 0x01, 0x00,
0x00, 0x00, 0x1f, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x80, 0x0f, 0x00,
0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0x07, 0x00, 0xf0, 0xff, 0x0f, 0x00,
0x00, 0xe0, 0x03, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0x03, 0x00,
0xe0, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0x01, 0x00, 0xc0, 0xff, 0x3f, 0x00,
0x00, 0xf8, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x7c, 0x00, 0x00,
0x80, 0xff, 0x7f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x00,
0x00, 0xfc, 0xff, 0x03, 0x80, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03,
0xc0, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00,
0x00, 0xf0, 0xff, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f,
0xf0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0xf8, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xff, 0x3f, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f,
0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff};
Syntax (Dateiformat)
[Bearbeiten | Quelltext bearbeiten]Die ersten 2 Zeilen legen die Breite und Höhe des codierten Bildes als #define für den C-Präprozessor fest. Danach folgen zeilenweise sequentiell die Pixel des Bildes, codiert als die gesetzten Bits in jedem Byte der Folge. Die Reihenfolge ist dabei vom LSB zum MSB, d. h., das erste Pixel des Bildes, also seine linke obere Ecke, ist das Nullte Bit des ersten Bytes.
Einzelnachweise
[Bearbeiten | Quelltext bearbeiten]- ↑ Der .xbm MIME-Type ist nicht bei der IANA registriert
- ↑ Image file type and format guide > XBM (X Window System Bitmap file). Mozilla, abgerufen am 19. Juni 2022 (englisch).
- ↑ Daniel Dardailler, Colas Nahaboo, Arnaud Le Hors: The XPM Story. 15. Juli 1996, archiviert vom am 14. November 2018; abgerufen am 19. Juni 2022 (englisch).