| 1. Preface
Nowadays several formats of wireless images
exist: WBMP (Wireless BitMaP), OTB (On-The-air Bitmap),
CLI (Caller Line Identifier) and Operator Logos. Various formats
require various image encoders and decoders. We decided to introduce a
new way of representing wireless images - XML for Wireless Images.
The benefits of this way are evident: if application A works with WBMP
and if application B works with OTB, they can exchange images using XWI
presentation. Neither application A needs to support OTB, nor
application B needs to support WBMP format. Besides, images can be
converted into other formats using just XSL transformations, without
complicated logic.
XML representation of a wireless images makes
possible to exchange images between different applications running on
different platforms. Application C may be written in C++ and may run on
MS Windows 2000, application D may be written in Java and may run on SUN
Solaris 2.6. If both these application support XWI, they can easily
exchange images.
2. Wireless Image XML Schema
<?xml
version="1.0"?>
<!--
Here several formats are supported: WBMP
(Wireless BitMaP), OTB
(On-The-air Bitmap), CLI
(Calling Line Identification), OPLOGO
(OPerator LOGO), NLM
(Nokia LogoManager).
-->
<wi:wireless-image
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:wi="http://www.wbmpcreator.com/schemas/wireless-image"
xsi:schemaLocation="http://www.wbmpcreator.com/dtd wireless-image.xsd"
image-width=""
image-height=""
bits-per-pixel="1"
compression-level="0"
image-level="0"
animated-frames=""
image-type="WBMP | OTB | CLI |
OPLOGO |
NLM">
<!--
This is a static image data. If an image has no animation, this is the
only frame. If an image is animated, this element represents the 0 frame
of the animation.
-->
<wi:static-image>raw data in hex</wi:static-image>
<!--
If an image contains animation, this element contains it. If no
animation presents, this element may be omitted
-->
<wi:animated-image frame-index="1..15">raw data in hex</wi:animated-image>
<!-- only for CLI -->
<wi:cli-header-body></wi:cli-header-body>
<!-- only for Operator Logo -->
<wi:operator-mcc></wi:operator-mcc>
<wi:operator-mnc></wi:operator-mnc>
<!-- only for Nokia LogoManager images
-->
<wi:nlm-graphic-type>0..3</wi:nlm-graphic-type>
</wi:wireless-image>
The prefix for XWI elements is wi:.
The <wi:wireless-image>
element is the root element. It contains the attributes common for ALL
wireless images. Some attributes (bits-per-pixel,
compression-level,
animated-frames)
are introduced for further usage.
3. Sample XWI-encoded image
<?xml version="1.0"?>
<!-- document generated with WBMPcreator (http://www.wbmpcreator.com/) -->
<wi:wireless-image xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:wi="http://www.wbmpcreator.com/schemas/wireless-image"
xsi:schemaLocation="http://www.wbmpcreator.com/dtd wireless-image.xsd"
image-width="100" image-height="100" image-type="WBMP" image-level="0"
bits-per-pixel="1" compression-level="0" animated-frames="0">
<wi:static-image>
AEFD6D7E8E778BD2DD8000940FFB6FBABBF7ABF8BD7A4006010F5590D7C
17854666BB62009425FEAFF6D7E9FFF9B94D9D00080AFBF6CBABBE229ED
EF6C04C0205F5793D7C57DD6577BB20B30C02FEAEF697E9EFDBA96D1AC8
C104FB778B6ABE12B4FE9605678041F5D97DF577FD6FD7F9009BB080FAE
EB68F896FDB2B66B9644820FF35DB7AF6BEB4D49D469BB408F5CBEDF57F
516FEFEABF674800FA7CB6AF89EED7397570989100FFC77B5EF6BFBDD6B
8FF002200F53BCDF17F516AFD4764220080FADCB6AFB1EED70AF8900450
60FFE77B5ACEBFBDF58168000100F13B8DA577516AFB6FA6C00820FEDDF
6FBB9EE9D07D04120041AF9FE5B5CC6BFF7FCA7947C02C4F763BDA77F51
6A935F6F828001FA9DE6FAA5AE9D7FB891AC0002FD7E5B5FDAF5F7EFFF6
A515148F7E7BDA57F5B6A964004048020FA9D467AA5AEBD7DB6C0000800
FF6AFBDFDEF5D6A3C000003090FDF73525795B6B7E0000000304F29DCED
AA7A6BDD50000000040FD6AFB7FDEDD56280000000118FFF535A57173EB
F0049CC00020F29BDEDAAFAEBD800002040001FD6CEB7DDED556001C003
08000FBF775C7617BE80020BC8B6204F79B9EBAFFBEB0005103149D00FD
6C6B7D1ED550038000684200F2F7F5C7E56FA80600B592B960FF9B1EBAF
AB8F029014AED0400F56DEB7D1FC74016002500021FFAF675D7ED7FA1E8
AF90000020FF1B9EAAD2A0E6B65768000008F5EDEB7D7FDF53483800008
001FEB6D597ADEFA8B08780020044FB5BFAEAD2B1C66B7C500804FAF5ED
0F75FD5E7B448000007BA0FEB2F59E2BEBAC800000518C44FB5FFAEBD6B
DD220C0012E703AF5A90F75F9527D5B0012918B81FAF6F5BE2FADA2A030
0FEA1400FF5BFACBD6FFD8C001F410A000F5AD5F35B9526E0C1C1380000
0FAF6A5FAEFAFB1138304440800FF7BDA8F52F7CE4044F0200260F48F7D
75AF5A78003000001000FBF487AAF8ADA48B4300022484FF7B7ADF57D7D
A040000000003F48FDD67AF7E69609000018040FBF4B7B8F8A9B0D20004
00088CFD4B5AFF57D6C9040401042003F2BFFD47AF7F72E10000080054F
FD4B6B8FAA985184200004088F96B5BDF55D6FA809000121500F7BDF56C
AB79634420380C281CFAD6A6B3D6AF97000400608081FD7B5BDD7D56EA6
800C1114300F7ACB5FEABE94491303E602000FA57EEB3D6BFB760060000
0000FFEB5B5D7D56C01F00E1908010F035A5EFAAEB4E008902600000FFD
EFE32D7FDB04F6400000000F9EB5BD57D46C9820080040000F67CA52BAA
BB1C07E400010408FBDFDEF657EDA6418000020801FDA27F59E956D9B04
000002080F77DAEAEBFAB0718A900008010FBDAD3F756DDE24C40000104
00FFA37E5DE97EB126BC80000108F45DFDEABFA378D03130600032FBF29
297565DBC011E41822001FF2FEF7BABFEDE200D86100180F45F3CA4F52B
6F402B38600832FBF2D2DF5ED5BFF80477820400F52FEFF3ABEE6FFC008
E443140FED5153EF53BD3FE00150A0800F3EEFAF57ED53DFFA00A344000
FD7BEDEBA7EEF2F9C00487A000FED436BCDD3B4D7FC0000E4000F32FDB5
772DDBAC2000000B000FDFB6DEEAFE6D720000000C100FED5B6A1D53B67
D80080000211F72EDBDF6AF5F8E00800000582F9DB2DEFBD4A97B010000
00210FEF5F6B1D7B77D480400000061F76A5B5E6EF8A6B0000000048EF9
9FEDABB94FDC607BBCC048C2FEF436FD57B77F800420207971F96BDB12E
AECA3800438204A48F796EDEF355BFD610420204BD2FC6D76B5DEB667C0
0420204A52F3FB9B5AEBEBBD820334C04A52FF16EDEF775D5A814000000
000F</wi:static-image></wi:wireless-image>
This big text in the <wi:static-image>
element is the HEX representation of a wireless image contents. It
contains ONLY the point data, not additional fields like width or
height. In this example the image has 1300 bytes of image data (1304
total), thus the HEX representation contains 2600 bytes.
|
NOTE |
Here the image contents
were carried over every 60 symbols (it's a matter of text
formatting). In practice, it's prohibited to carry over the HEX
string. |
The same coding convention is true
for <wi:animated-image>
element.
4. Using XWI
with JMS (Java Messaging Service)
Will be introduced soon
5. Using XWI
with EJB (Enterprise Java Beans)
Will be introduced soon
6. Using
XWI with SOAP (Simple Object Access Protocol)
Will be introduced soon
7. Using XSL transformations for
converting images
XWI 1.0 specification suggests that
converting images will be performed on-the-fly using XSL
transformations. Due to the fact that currently all images are
represented in the same way (level 0, uncompressed, monochrome),
the image contents are not changed. In most cases only parameters of <wi:wireless-image>
element need to be changed during transformation. Here is the example of
such stylesheet (it converts wireless images to OTB):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:wi="http://www.wbmpcreator.com/schemas/wireless-image">
<xsl:template match="wi:wireless-image">
<xsl:variable name="iw"
select="@image-width"/>
<xsl:variable name="ih"
select="@image-height"/>
<xsl:variable name="bpp"
select="@bits-per-pixel"/>
<xsl:variable name="cl"
select="@compression-level"/>
<xsl:variable name="il"
select="@image-level"/>
<wi:wireless-image
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:wi="http://www.wbmpcreator.com/schemas/wireless-image"
xsi:schemaLocation="http://www.wbmpcreator.com/dtd wireless-image.xsd"
image-width="{$iw}"
image-height="{$ih}"
animated-frames="{$af}"
bits-per-pixel="{$bpp}"
compression-level="{$cl}"
image-level="{$il}"
image-type="OTB">
<xsl:apply-templates select="wi:static-image"/>
<xsl:apply-templates select="wi:animated-image"/>
</wi:wireless-image>
</xsl:template>
<xsl:template match="wi:static-image">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="wi:animated-image">
<xsl:copy-of select=".|@*"/>
</xsl:template>
</xsl:stylesheet>
<!-- Copyright WAP Shareware, Inc. 2000-2001 --> |
Here all pieces of information
related to original and resulting wireless image in XWI format are
selected with blue.
If you perform a transformation to
a more narrow format (for example, from WBMP to CLI), you need to add
the CLI-specific element (<wi:cli-header-body>)
to the XSL file. To do it, just add the following line (if we speak
about CLI) after <xsl:apply-templates
select="wi:animated-image"/>:
| <wi:cli-header-body>your
content here</wi:cli-header-body> |
The same is true for Operator
Logos. So, as a conclusion, until all images are level 0, it
doesn't matter, what format you are converting your images from. Only
the resulting format affects your XSL document.
this page was last
updated: 27.08.2001
|