Embedded SDK
Embedded SDK
Macros
nbgl_image_utils.h File Reference

Utilities for Ledger image files processing. More...

#include "nbgl_types.h"
Include dependency graph for nbgl_image_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIDTH_OFFSET   0
 
#define HEIGHT_OFFSET   2
 
#define BPP_COMPRESS_OFFSET   4
 
#define BUFFER_LEN_OFFSET   5
 
#define BUFFER_OFFSET   8
 
#define IMAGE_FILE_HEADER_SIZE   8
 
#define GET_IMAGE_FILE_WIDTH(image_file)    (image_file[WIDTH_OFFSET] | (image_file[WIDTH_OFFSET + 1] << 8))
 macro to get the width of the image file More...
 
#define GET_IMAGE_FILE_HEIGHT(image_file)    (image_file[HEIGHT_OFFSET] | (image_file[HEIGHT_OFFSET + 1] << 8))
 macro to get the height of the image file More...
 
#define GET_IMAGE_FILE_BPP(image_file)   (image_file[BPP_COMPRESS_OFFSET] >> 4)
 macro to get the bpp of the image file More...
 
#define GET_IMAGE_FILE_COMPRESSION(image_file)   (image_file[BPP_COMPRESS_OFFSET] & 0xF)
 macro to get the compression of the image file More...
 
#define GET_IMAGE_FILE_BUFFER_LEN(image_file)
 macro to get the buffer len of the image file More...
 
#define GET_IMAGE_FILE_BUFFER(image_file)   (&image_file[BUFFER_OFFSET])
 macro to get the buffer of the image file More...
 

Detailed Description

Utilities for Ledger image files processing.

Definition in file nbgl_image_utils.h.

Macro Definition Documentation

◆ BPP_COMPRESS_OFFSET

#define BPP_COMPRESS_OFFSET   4

BPP & Compression offset in image file

Definition at line 35 of file nbgl_image_utils.h.

◆ BUFFER_LEN_OFFSET

#define BUFFER_LEN_OFFSET   5

Buffer length offset in image file

Definition at line 41 of file nbgl_image_utils.h.

◆ BUFFER_OFFSET

#define BUFFER_OFFSET   8

Buffer offset in image file

Definition at line 47 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_BPP

#define GET_IMAGE_FILE_BPP (   image_file)    (image_file[BPP_COMPRESS_OFFSET] >> 4)

macro to get the bpp of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 76 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_BUFFER

#define GET_IMAGE_FILE_BUFFER (   image_file)    (&image_file[BUFFER_OFFSET])

macro to get the buffer of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 96 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_BUFFER_LEN

#define GET_IMAGE_FILE_BUFFER_LEN (   image_file)
Value:
(image_file[BUFFER_LEN_OFFSET] | (image_file[BUFFER_LEN_OFFSET + 1] << 8) \
| (image_file[BUFFER_LEN_OFFSET + 2] << 16))
#define BUFFER_LEN_OFFSET

macro to get the buffer len of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 88 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_COMPRESSION

#define GET_IMAGE_FILE_COMPRESSION (   image_file)    (image_file[BPP_COMPRESS_OFFSET] & 0xF)

macro to get the compression of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 82 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_HEIGHT

#define GET_IMAGE_FILE_HEIGHT (   image_file)     (image_file[HEIGHT_OFFSET] | (image_file[HEIGHT_OFFSET + 1] << 8))

macro to get the height of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 69 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_WIDTH

#define GET_IMAGE_FILE_WIDTH (   image_file)     (image_file[WIDTH_OFFSET] | (image_file[WIDTH_OFFSET + 1] << 8))

macro to get the width of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 62 of file nbgl_image_utils.h.

◆ HEIGHT_OFFSET

#define HEIGHT_OFFSET   2

Height offset in image file

Definition at line 30 of file nbgl_image_utils.h.

◆ IMAGE_FILE_HEADER_SIZE

#define IMAGE_FILE_HEADER_SIZE   8

Size in bytes of an image file header

Definition at line 52 of file nbgl_image_utils.h.

◆ WIDTH_OFFSET

#define WIDTH_OFFSET   0

Width offset in image file

Definition at line 25 of file nbgl_image_utils.h.