<commit_before>/**
 * @file lv_draw_img.h
 *
 */

#ifndef LV_DRAW_IMG_H
#define LV_DRAW_IMG_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "lv_draw.h"
#include "../lv_core/lv_obj.h"

/*********************
 *      DEFINES
 *********************/
#define LV_IMG_DECODER_OPEN_FAIL    ((void*)(-1))

/**********************
 *      TYPEDEFS
 **********************/
struct _lv_img_t;

typedef struct {

	/* The first 8 bit is very important to distinguish the different source types.
	 * For more info see `lv_img_get_src_type()` in lv_img.c */
	uint32_t cf           :5;    /* Color format: See `lv_img_color_format_t`*/
	uint32_t always_zero  :3;    /*It the upper bits of the first byte. Always zero to look like a non-printable character*/

	uint32_t reserved     :2;   /*Reserved to be used later*/

	uint32_t w:11;              /*Width of the image map*/
	uint32_t h:11;              /*Height of the image map*/
}lv_img_header_t;


typedef enum {
	LV_IMG_COMPRESSION_NONE,
	LV_IMG_COMPRESSION_RLE,			/*Run length encoded*/
	LV_IMG_COMPRESSION_RESERVED1,
	LV_IMG_COMPRESSION_RESERVED2
}lv_img_compression_t;

typedef enum {
    LV_IMG_FORMAT_UNKOWN = 0,

	LV_IMG_FORMAT_RAW,          		/*Contains the file as it is. Needs custom decoder function*/
    LV_IMG_FORMAT_RAW_ALPHA,            /*Contains the file as it is. The image has alpha. Needs custom decoder function*/
    LV_IMG_FORMAT_RAW_CHROMA_KEYED,     /*Contains the file as it is. The image is chroma keyed. Needs custom decoder function*/

	LV_IMG_FORMAT_TRUE_COLOR,			/*Color format and depth should match with LV_COLOR settings*/
	LV_IMG_FORMAT_TRUE_COLOR_ALPHA,		/*Same as `LV_IMG_FORMAT_TRUE_COLOR` but every pixel has an alpha byte*/
	LV_IMG_FORMAT_TRUE_COLOR_CHROMA_KEYED,	/*Same as `LV_IMG_FORMAT_TRUE_COLOR` but LV_COLOR_TRANSP pixels will be transparent*/

	LV_IMG_FORMAT_INDEXED_1BIT,			/*Can have 2 different colors in a palette (always chroma keyed)*/
	LV_IMG_FORMAT_INDEXED_2BIT,			/*Can have 4 different colors in a palette (always chroma keyed)*/
	LV_IMG_FORMAT_INDEXED_4BIT,			/*Can have 16 different colors in a palette (always chroma keyed)*/
	LV_IMG_FORMAT_INDEXED_8BIT,			/*Can have 256 different colors in a palette (always chroma keyed)*/

	LV_IMG_FORMAT_ALPHA_1BIT, 			/*Can have one color and it can be drawn or not*/
	LV_IMG_FORMAT_ALPHA_2BIT, 			/*Can have one color but 4 different alpha value*/
	LV_IMG_FORMAT_ALPHA_4BIT, 			/*Can have one color but 16 different alpha value*/
	LV_IMG_FORMAT_ALPHA_8BIT, 			/*Can have one color but 256 different alpha value*/
} lv_img_color_format_t;

/* Image header it is compatible with
 * the result image converter utility*/
typedef struct
{
	lv_img_header_t header;
    const uint8_t * data;<commit_msg>lv_img_dsc_t: add data_size filed<commit_after>/**
 * @file lv_draw_img.h
 *
 */

#ifndef LV_DRAW_IMG_H
#define LV_DRAW_IMG_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "lv_draw.h"
#include "../lv_core/lv_obj.h"

/*********************
 *      DEFINES
 *********************/
#define LV_IMG_DECODER_OPEN_FAIL    ((void*)(-1))

/**********************
 *      TYPEDEFS
 **********************/
struct _lv_img_t;

typedef struct {

	/* The first 8 bit is very important to distinguish the different source types.
	 * For more info see `lv_img_get_src_type()` in lv_img.c */
	uint32_t cf           :5;    /* Color format: See `lv_img_color_format_t`*/
	uint32_t always_zero  :3;    /*It the upper bits of the first byte. Always zero to look like a non-printable character*/

	uint32_t reserved     :2;   /*Reserved to be used later*/

	uint32_t w:11;              /*Width of the image map*/
	uint32_t h:11;              /*Height of the image map*/
}lv_img_header_t;


typedef enum {
	LV_IMG_COMPRESSION_NONE,
	LV_IMG_COMPRESSION_RLE,			/*Run length encoded*/
	LV_IMG_COMPRESSION_RESERVED1,
	LV_IMG_COMPRESSION_RESERVED2
}lv_img_compression_t;

typedef enum {
    LV_IMG_FORMAT_UNKOWN = 0,

	LV_IMG_FORMAT_RAW,          		/*Contains the file as it is. Needs custom decoder function*/
    LV_IMG_FORMAT_RAW_ALPHA,            /*Contains the file as it is. The image has alpha. Needs custom decoder function*/
    LV_IMG_FORMAT_RAW_CHROMA_KEYED,     /*Contains the file as it is. The image is chroma keyed. Needs custom decoder function*/

	LV_IMG_FORMAT_TRUE_COLOR,			/*Color format and depth should match with LV_COLOR settings*/
	LV_IMG_FORMAT_TRUE_COLOR_ALPHA,		/*Same as `LV_IMG_FORMAT_TRUE_COLOR` but every pixel has an alpha byte*/
	LV_IMG_FORMAT_TRUE_COLOR_CHROMA_KEYED,	/*Same as `LV_IMG_FORMAT_TRUE_COLOR` but LV_COLOR_TRANSP pixels will be transparent*/

	LV_IMG_FORMAT_INDEXED_1BIT,			/*Can have 2 different colors in a palette (always chroma keyed)*/
	LV_IMG_FORMAT_INDEXED_2BIT,			/*Can have 4 different colors in a palette (always chroma keyed)*/
	LV_IMG_FORMAT_INDEXED_4BIT,			/*Can have 16 different colors in a palette (always chroma keyed)*/
	LV_IMG_FORMAT_INDEXED_8BIT,			/*Can have 256 different colors in a palette (always chroma keyed)*/

	LV_IMG_FORMAT_ALPHA_1BIT, 			/*Can have one color and it can be drawn or not*/
	LV_IMG_FORMAT_ALPHA_2BIT, 			/*Can have one color but 4 different alpha value*/
	LV_IMG_FORMAT_ALPHA_4BIT, 			/*Can have one color but 16 different alpha value*/
	LV_IMG_FORMAT_ALPHA_8BIT, 			/*Can have one color but 256 different alpha value*/
} lv_img_color_format_t;

/* Image header it is compatible with
 * the result image converter utility*/
typedef struct
{
	lv_img_header_t header;
	uint32_t data_size;
    const uint8_t * data;
{'fraction_non_alphanumeric': 0.12006375066406942, 'fraction_numerical': 0.015937666017354347, 'mean_word_length': 3.9155787641427326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1032663', 'n_tokens_mistral': 2175, 'n_tokens_neox': 1982, 'n_words': 586}