Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_image_utils.h File Reference

Utilities for Ledger image files processing. More...

#include "nbgl_low_level_guard.h"
#include "nbgl_types.h"
Include dependency graph for nbgl_image_utils.h:

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)
 macro to get the width of the image file
#define GET_IMAGE_FILE_HEIGHT(image_file)
 macro to get the height of the image file
#define GET_IMAGE_FILE_BPP(image_file)
 macro to get the bpp of the image file
#define GET_IMAGE_FILE_COMPRESSION(image_file)
 macro to get the compression of the image file
#define GET_IMAGE_FILE_BUFFER_LEN(image_file)
 macro to get the buffer len of the image file
#define GET_IMAGE_FILE_BUFFER(image_file)
 macro to get the buffer of the image file

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 37 of file nbgl_image_utils.h.

◆ BUFFER_LEN_OFFSET

#define BUFFER_LEN_OFFSET   5

Buffer length offset in image file

Definition at line 43 of file nbgl_image_utils.h.

◆ BUFFER_OFFSET

#define BUFFER_OFFSET   8

Buffer offset in image file

Definition at line 49 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_BPP

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

macro to get the bpp of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 78 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_BUFFER

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

macro to get the buffer of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 98 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 90 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_COMPRESSION

#define GET_IMAGE_FILE_COMPRESSION ( image_file)
Value:
(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 84 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_HEIGHT

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

macro to get the height of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 71 of file nbgl_image_utils.h.

◆ GET_IMAGE_FILE_WIDTH

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

macro to get the width of the image file

Parameters
image_fileuint8_t* buffer representing the image file

Definition at line 64 of file nbgl_image_utils.h.

◆ HEIGHT_OFFSET

#define HEIGHT_OFFSET   2

Height offset in image file

Definition at line 32 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 54 of file nbgl_image_utils.h.

◆ WIDTH_OFFSET

#define WIDTH_OFFSET   0

Width offset in image file

Definition at line 27 of file nbgl_image_utils.h.