SWILIB API (SG)    
Loading...
Searching...
No Matches
Image

Detailed Description

Basic function for working with images.

Usage: #include <swilib.h> or #include <swilib/images.h>

Data Structures

struct  PNGLIST
 
struct  DYNPNGICONLIST
 
struct  PNGTOP_DESC
 
struct  IMGHDR
 Image header. More...
 
struct  EIMGHDR
 Extended image header (without 255x255 limitation). More...
 

Macros

#define FIRST_UCS2_BITMAP   0xE137
 

Typedefs

typedef struct IMGHDR IMGHDR
 
typedef struct EIMGHDR EIMGHDR
 
typedef struct PNGLIST PNGLIST
 
typedef struct DYNPNGICONLIST DYNPNGICONLIST
 
typedef struct PNGTOP_DESC PNGTOP_DESC
 

Enumerations

enum  ImghdrBitmapType {
  IMGHDR_TYPE_WB = 1 ,
  IMGHDR_TYPE_RGB332 = 5 ,
  IMGHDR_TYPE_ARGB4444 = 7 ,
  IMGHDR_TYPE_RGB565 = 8 ,
  IMGHDR_TYPE_ARGB8888 = 0xA ,
  IMGHDR_TYPE_RLE_RGB332 = 0x85 ,
  IMGHDR_TYPE_RLE_ARGB4444 = 0x87 ,
  IMGHDR_TYPE_RLE_RGB565 = 0x88 ,
  IMGHDR_TYPE_RLE_ARGB8888 = 0x8A
}
 Type of IMGHDR bitmap. More...
 
enum  ThemeCacheImageID {
  TCI_HEADLINE_DEFAULT ,
  TCI_HEADLINE_FULLSCREEN ,
  TCI_BODY_DEFAULT ,
  TCI_BODY_TAB ,
  TCI_BOTTOM_DEFAULT ,
  TCI_BOTTOM_FULLSCREEN ,
  TCI_POPUP_OPTIONS ,
  TCI_POPUP_FEEDBACK ,
  TCI_SELECTION_1_LINE ,
  TCI_SELECTION_2_LINE ,
  TCI_SELECTION_3_LINE ,
  TCI_SELECTION_ICON_ONLY ,
  TCI_POPUP_SEARCH_FIELD ,
  TCI_POPUP_QUICK_ACCESS_FIELD ,
  TCI_PROGRESS_BAR ,
  TCI_TAB_SELECTED ,
  TCI_TAB_UNSELECTED ,
  TCI_STATUS_BAR_STANDARD ,
  TCI_STATUS_BAR_FULLSCREEN ,
  TCI_TOTAL
}
 ID of theme cache images. More...
 

Functions

PNGTOP_DESC * PNG_TOP (void)
 Get a pointer to the PNG list (PIT overrides).
 
IMGHDR * GetPITaddr (int picture)
 Get an image from the PIT table (images in firmware).
 
int GetImgHeight (int picture)
 Get the width of the image from the PIT table.
 
int GetImgWidth (int picture)
 Get the height of the image from the PIT table.
 
IMGHDR * CreateIMGHDRFromPngFile (const char *path, int type)
 Load PNG image from the filesystem.
 
IMGHDR * GetIMGHDRFromThemeCache (int index)
 Get an image from the phone theme.
 
int GetPicNByUnicodeSymbol (int symbol)
 Get image from U+E1XX "emoji".
 
int CalcBitmapSize (short w, short h, char type)
 Calculate bitmap size by WxH and type.
 

Canvas

"Canvas" is a really meaning for standard UI background.

IMGHDR * GetIMGHDRFromCanvasCache (char canvas_id)
 Get an image by canvas_id from cache.
 
IMGHDR * GetCanvasBufferPicPtr (char canvas_id)
 Get an image by canvas_id (low level).
 
int IsCanvasBufferSet (char canvas_id)
 Check if canvas exists for the given canvas_id.
 
void MMI_CanvasBuffer_FlushV (char canvas_id)
 Flush "canvas" in cache.
 

Dynamic PIT

void PIT_ClearCache (void)
 Clear the in‑memory PIT image cache.
 
void PIT_SetImage (uint32_t picture, const IMGHDR *img)
 Override the default image for a given PIT slot.
 
void PIT_ResetImage (uint32_t picture)
 Restore the original image for a given PIT slot.
 
int GetPITSize ()
 Get the maximum count of PIT icons.
 
int16_t GetLgpIcon (int lgp_id)
 Get image by LGP_ID.
 

Dynamic icons

Dynamic icons - are those icons which can be used as U+E2XX unicode sequences in the standard UI.

XX in U+E2XX is the dynamic image slot number.

IMGHDR * GetPitAdrBy0xE200Symbol (int symbol)
 Get image from U+E2XX dynamic image.
 
int GetMaxDynIcon (void)
 Get the maximum count of the dynamic icons.
 
int IsDynIconBusy (int picture)
 Check if the specified slot of the dynamic icons is used.
 
void SetDynIcon (int picture, IMGHDR *img, char *bitmap)
 Set the image to the slot of the dynamic images.
 
void FreeDynIcon (int picture)
 Release the slot of the dynamic icons.
 

Data Structure Documentation

◆ PNGLIST

struct PNGLIST

◆ DYNPNGICONLIST

struct DYNPNGICONLIST

◆ PNGTOP_DESC

struct PNGTOP_DESC

◆ IMGHDR

struct IMGHDR

◆ EIMGHDR

struct EIMGHDR

Macro Definition Documentation

◆ FIRST_UCS2_BITMAP

#define FIRST_UCS2_BITMAP   0xE137

Definition at line 138 of file image.h.

Typedef Documentation

◆ IMGHDR

typedef struct IMGHDR IMGHDR

Definition at line 17 of file image.h.

◆ EIMGHDR

typedef struct EIMGHDR EIMGHDR

Definition at line 18 of file image.h.

◆ PNGLIST

typedef struct PNGLIST PNGLIST

Definition at line 19 of file image.h.

◆ DYNPNGICONLIST

typedef struct DYNPNGICONLIST DYNPNGICONLIST

Definition at line 20 of file image.h.

◆ PNGTOP_DESC

typedef struct PNGTOP_DESC PNGTOP_DESC

Definition at line 21 of file image.h.

Enumeration Type Documentation

◆ ImghdrBitmapType

Type of IMGHDR bitmap.

Enumerator
IMGHDR_TYPE_WB 

1-bit

IMGHDR_TYPE_RGB332 

8-bit [r3g3b2]

IMGHDR_TYPE_ARGB4444 

16-bit [?4r4g4b4]

IMGHDR_TYPE_RGB565 

16-bit [r5g6b5]

IMGHDR_TYPE_ARGB8888 

32-bit [a8r8g8b8]

IMGHDR_TYPE_RLE_RGB332 

RLE 8-bit.

IMGHDR_TYPE_RLE_ARGB4444 

RLE 16-bit.

IMGHDR_TYPE_RLE_RGB565 

RLE 16-bit.

IMGHDR_TYPE_RLE_ARGB8888 

RLE 32-bit.

Definition at line 47 of file image.h.

◆ ThemeCacheImageID

ID of theme cache images.

Enumerator
TCI_HEADLINE_DEFAULT 
TCI_HEADLINE_FULLSCREEN 
TCI_BODY_DEFAULT 
TCI_BODY_TAB 
TCI_BOTTOM_DEFAULT 
TCI_BOTTOM_FULLSCREEN 
TCI_POPUP_OPTIONS 
TCI_POPUP_FEEDBACK 
TCI_SELECTION_1_LINE 
TCI_SELECTION_2_LINE 
TCI_SELECTION_3_LINE 
TCI_SELECTION_ICON_ONLY 
TCI_POPUP_SEARCH_FIELD 
TCI_POPUP_QUICK_ACCESS_FIELD 
TCI_PROGRESS_BAR 
TCI_TAB_SELECTED 
TCI_TAB_UNSELECTED 
TCI_STATUS_BAR_STANDARD 
TCI_STATUS_BAR_FULLSCREEN 
TCI_TOTAL 

Definition at line 90 of file image.h.

Function Documentation

◆ PNG_TOP()

PNGTOP_DESC * PNG_TOP ( void )

Get a pointer to the PNG list (PIT overrides).

Returns
pointer
Builtin on platforms:
ELKA, NSG, X75, SG

◆ GetPITaddr()

IMGHDR * GetPITaddr ( int picture)

Get an image from the PIT table (images in firmware).

Parameters
pictureimage number
Returns
pointer to the image

◆ GetImgHeight()

int GetImgHeight ( int picture)

Get the width of the image from the PIT table.

Parameters
pictureimage number
Returns
width

◆ GetImgWidth()

int GetImgWidth ( int picture)

Get the height of the image from the PIT table.

Parameters
pictureimage number
Returns
height

◆ CreateIMGHDRFromPngFile()

IMGHDR * CreateIMGHDRFromPngFile ( const char * path,
int type )

Load PNG image from the filesystem.

Parameters
pathpath ot the filename
typeunknown, set to 0
Builtin on platforms:
ELKA, NSG, X75, SG

◆ GetIMGHDRFromThemeCache()

IMGHDR * GetIMGHDRFromThemeCache ( int index)

Get an image from the phone theme.

Parameters
indexidnex of the image, see: ThemeCacheImageID
Returns
pointer to the image

◆ GetPicNByUnicodeSymbol()

int GetPicNByUnicodeSymbol ( int symbol)

Get image from U+E1XX "emoji".

Parameters
symbolunicode codepoint E1XX
Returns
number in PIT table

◆ CalcBitmapSize()

int CalcBitmapSize ( short w,
short h,
char type )

Calculate bitmap size by WxH and type.

Parameters
w,hsize of the image
typetype of the bitmap, see ImghdrBitmapType

◆ GetIMGHDRFromCanvasCache()

IMGHDR * GetIMGHDRFromCanvasCache ( char canvas_id)

Get an image by canvas_id from cache.

"Canvas" is a really meaning for standard UI background.

Parameters
canvas_idID of the "canvas"
Returns
pointer to the image

◆ GetCanvasBufferPicPtr()

IMGHDR * GetCanvasBufferPicPtr ( char canvas_id)

Get an image by canvas_id (low level).

"Canvas" is a really meaning for standard UI background.

Parameters
canvas_idID of the "canvas"
Returns
pointer to the image

◆ IsCanvasBufferSet()

int IsCanvasBufferSet ( char canvas_id)

Check if canvas exists for the given canvas_id.

Returns
1 or 0

◆ MMI_CanvasBuffer_FlushV()

void MMI_CanvasBuffer_FlushV ( char canvas_id)

Flush "canvas" in cache.

"Canvas" is a really meaning for standard UI background.

Parameters
canvas_idID of the "canvas"

◆ PIT_ClearCache()

void PIT_ClearCache ( void )

Clear the in‑memory PIT image cache.

Builtin on platforms:
ELKA, NSG, X75, SG

◆ PIT_SetImage()

void PIT_SetImage ( uint32_t picture,
const IMGHDR * img )

Override the default image for a given PIT slot.

Replaces the built‑in image at the specified index with a custom one.

Builtin on platforms:
ELKA, NSG, X75, SG
Parameters
pictureindex of the picture in the PIT.
imgpointer to the new image.

◆ PIT_ResetImage()

void PIT_ResetImage ( uint32_t picture)

Restore the original image for a given PIT slot.

Removes any override applied via PIT_SetImage and returns to the built‑in image.

Builtin on platforms:
ELKA, NSG, X75, SG
Parameters
pictureindex of the picture in the PIT.

◆ GetPITSize()

int GetPITSize ( )

Get the maximum count of PIT icons.

Returns
count

◆ GetLgpIcon()

int16_t GetLgpIcon ( int lgp_id)

Get image by LGP_ID.

Parameters
lgp_idid from the langpack
Returns
number in PIT table or -1 if error

◆ GetPitAdrBy0xE200Symbol()

IMGHDR * GetPitAdrBy0xE200Symbol ( int symbol)

Get image from U+E2XX dynamic image.

Parameters
symbolunicode codepoint E2XX
Returns
pointer to the image

◆ GetMaxDynIcon()

int GetMaxDynIcon ( void )

Get the maximum count of the dynamic icons.

Something like dynamic "emoji".

Returns
count

◆ IsDynIconBusy()

int IsDynIconBusy ( int picture)

Check if the specified slot of the dynamic icons is used.

Parameters
picturenumber in the slot
Returns
1 or 0

◆ SetDynIcon()

void SetDynIcon ( int picture,
IMGHDR * img,
char * bitmap )

Set the image to the slot of the dynamic images.

Parameters
picturenumber in the slot
imgpointer to the image header
bitmappointer to the image bitmap

◆ FreeDynIcon()

void FreeDynIcon ( int picture)

Release the slot of the dynamic icons.

Parameters
picturenumber in the slot