Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

Images


Detailed Description

For details on image formats Ref. 11.11.

Attention:
There are following limits of image support in the current turbo kernel:
These limits exist because we have not found device supporting such features so we could not test them. Hopefully we will be able to fix that in the near future.

To display image there is the display_icon() function based on STK DISPLAY_TEXT command. In case you want to have pictures in other STK commands you can implement appropriate wrapper as in the stkcmd.c example.

To create image use the set_img() function. It has four parameters:

The image callback generates the image itself - it is called when ME requests the image.

Example - generate filled rectangle:

u8 generate_filled_rectangle (u16 i)
{
  return 0xFF;
}

img_bladox.xbm

Example - show 96x22 xbm format picture

u8 PROGMEM bladox_pic[]=        // xbm format
{
  0xff, 0xd7, 0xfe, 0xff, 0xfd, 0xdd, 0xff, 0xdf, 0xfe, 0xff, 0xbf, 0x7e, 
  0x87, 0xf9, 0xe7, 0x7f, 0x8f, 0xbf, 0x05, 0xff, 0x0f, 0xee, 0xf2, 0x73, 
  0x03, 0x80, 0x40, 0x00, 0x02, 0x43, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 
  0x01, 0x20, 0x60, 0x10, 0x00, 0x07, 0x00, 0x10, 0xe0, 0x30, 0x70, 0x60, 
  0xf1, 0xff, 0x70, 0x80, 0xe0, 0x07, 0xfc, 0x1b, 0xf0, 0x75, 0x7c, 0x38, 
  0xf1, 0xff, 0x70, 0x01, 0xe0, 0x07, 0xfc, 0x3f, 0xf8, 0x7b, 0xfa, 0x3c, 
  0xf9, 0xf7, 0x70, 0x30, 0xf0, 0x07, 0xfe, 0x7d, 0xfc, 0xeb, 0x74, 0x3e, 
  0xf3, 0xf0, 0x70, 0x08, 0x70, 0x2f, 0x9c, 0x79, 0x1e, 0xe0, 0x72, 0x3f, 
  0x3b, 0xf0, 0xf0, 0x04, 0x70, 0x4f, 0x3c, 0x78, 0x1e, 0xf0, 0xf1, 0x0f, 
  0x31, 0xf8, 0x70, 0x41, 0x38, 0x1f, 0x1e, 0x30, 0x0f, 0xe0, 0xc0, 0x2f, 
  0xf1, 0x5f, 0x70, 0x80, 0x38, 0x1f, 0x1c, 0x71, 0x4f, 0xf2, 0xc4, 0x07, 
  0xf9, 0xff, 0xf0, 0x00, 0x3c, 0x1e, 0x1c, 0x30, 0x1e, 0xc0, 0xc0, 0x0f, 
  0xf9, 0xff, 0xf1, 0x00, 0x1c, 0x3e, 0x3e, 0x78, 0x5b, 0xe0, 0xe3, 0x1f, 
  0xf3, 0xe0, 0x70, 0x02, 0x5c, 0x3f, 0x1c, 0x78, 0x1e, 0xf0, 0xe0, 0x1f, 
  0x71, 0xe0, 0x71, 0x00, 0xfe, 0x7f, 0x1c, 0x3c, 0x1a, 0x60, 0x70, 0x3e, 
  0x33, 0xf0, 0x30, 0x00, 0xfe, 0x3f, 0x0e, 0x3c, 0x2e, 0xf0, 0xf8, 0x3c, 
  0x31, 0xf8, 0x30, 0x60, 0xdf, 0x79, 0x0e, 0x3e, 0x1c, 0x7c, 0x78, 0x7e, 
  0xfb, 0xff, 0xf8, 0x7f, 0x0f, 0x78, 0xfc, 0x9f, 0x1e, 0x3c, 0xfc, 0x79, 
  0xfb, 0x7f, 0xf8, 0xbf, 0x2f, 0x7c, 0xff, 0x2f, 0xbe, 0x1f, 0x3e, 0x7c, 
  0xff, 0x17, 0xfe, 0xff, 0x07, 0x7d, 0xff, 0x07, 0xf8, 0x0f, 0x1f, 0x3e, 
  0x83, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};

u8 generate_bladox_pic (u16 i)
{
u8 j;
u8 x=rb(bladox_pic+i);
u8 ret=0;

// swap lsb/msb order 
for(j=0;j<8;j++)
        ret|=(x&(1<<j))?(1<<(7-j)):0;
return ret;
}

void foo()
{
display_icon(96, 22, IMG_BW, generate_bladox_pic, NULL, Q_DISPLAY_ICON_SELF_EXP);
}

Defines

Functions


Define Documentation

#define IMG_BW
 

Indicates black and white image.

#define IMG_COLOR
 

Indicates color image.


Function Documentation

u8 display_icon u8  w,
u8  h,
u8  fmt,
u8(*  img_fnc)(u16),
const u8 text,
u8  icon_q
 

Warning:
SIM Toolkit function, usable only in stk_thread(). Wrapper around the STK DISPLAY TEXT command with T_ICON_ID object.
Parameters:
w width of image
h height of image
fmt IMG_BW or IMG_COLOR
img_fnc image function (generates the image itself)
text text, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM.
icon_q Q_DISPLAY_ICON_SELF_EXP or Q_DISPLAY_ICON_NOT_SELF_EXP, Ref. 11.14 T_ICON_ID
Returns:
APP_BACK if user back, APP_END if user end, APP_OK if user ok.
Examples:
test_img.c.

void set_img u8  w,
u8  h,
u8  fmt,
u8(*  fnc)(u16)
 

In case you wanted to write a new STK command wrapper using T_ICON_ID use this function to set the image generating function.

Parameters:
w width
h height
fmt IMG_BW or IMG_COLOR
fnc image function (generates the image itself)
Examples:
stkcmd.c.


Copyright © 2004-2006 BLADOX
Turbo version 1.2