2-8
Cisco Unified IP Phone Services Application Development Notes
OL-18696-01
Chapter 2 CiscoIPPhone XML Objects
XML Object Definitions
Use
LocationX
and
LocationY
to position the graphic on the phone display. Position the upper, left corner
of the graphic at the pixel defined by these two parameters. Setting the X and Y location values to (0, 0)
positions the graphic at the upper, left corner of the display. Setting the X and Y location values to (-1,
-1) centers the graphic in the services pane of the phone display.
Use
Width
and
Height
to size the graphic. If the values do not match with the pixel stream specified in
the
Data
field, results will be unpredictable incorrect.
Depth
specifies the number of bits per pixel. Cisco Unified IP Phones support a maximum value of 2. A
bit depth of 1 is black and white.
The
Data
tag delimits a string of hexadecimal digits that contain the packed value of the pixels in the
display. In the Cisco Unified IP Phone, each pixel has only four possible values, which means that you
can pack four pixels into a single byte. A pair of hexadecimal digits represents each byte.
Figure 2-3
provides an example of the mechanics of pixel packing. Scanning from left to right in the
display, the illustration shows the process for packing consecutive pixel values of 1, 3, 2, and 0. First,
the pixels get converted to 2-bit binary numbers. Then, the binary pairs get re-ordered in sets of four to
create a single re-ordered byte, which two hexadecimal digits represent.
Figure 2-3
Packed Pixel Translation Example
Example
The following XML code defines a
CiscoIPPhoneImage
object that displays the sequence of pixels shown
in
Figure 2-3
as a graphic positioned at the center of the phone display:
<CiscoIPPhoneImage>
<Title/>
<LocationX>-1</LocationX>
<LocationY>-1</LocationY>
<Width>4</Width>
<Height>1</Height>
<Depth>2</Depth>
<Data>2D</Data>
<Prompt/>
</CiscoIPPhoneImage>
The graphic display comprises a contiguous stream of hexadecimal digits, with no spaces or other
separators. If the number of pixels to be displayed does not represent an even multiple of four, pad the
end of the pixel data with blank (zero value) pixels, so the data is packed correctly. The phone ignores
the padded data.
Pixel values original sequence
1
3
2
0
Pixel values converted to 2-bit
binary pairs
01
00
10
11
Re-ordered binary pairs
2D
1-byte packed hexadecimal value
00
01
10
11