Repository navigation
Expand file tree
/
Copy pathOnDiskBitmap.h
More file actions
54 lines (49 loc) · 1.53 KB
/
Copy pathOnDiskBitmap.h
File metadata and controls
54 lines (49 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "py/obj.h"
typedef struct {
mp_obj_base_t base;
uint16_t width;
uint16_t height;
uint16_t data_offset;
uint16_t stride;
uint32_t r_bitmask;
uint32_t g_bitmask;
uint32_t b_bitmask;
mp_obj_t file;
union {
mp_obj_base_t *pixel_shader_base;
struct displayio_palette *palette;
struct displayio_colorconverter *colorconverter;
};
bool bitfield_compressed;
uint8_t bits_per_pixel;
// The last bytes read from the file. Pixels are read along rows, so most reads hit it.
uint8_t cache_len;
#if CIRCUITPY_STORAGE_MAP_FILE
// Flash runs the pixels are read from instead of the cache; 0 = read through the cache.
uint8_t map_count;
// 8-bit file with every row inside one run, so TileGrid can read whole rows.
bool rows_mapped;
#endif
uint32_t cache_start;
union {
uint8_t cache[64];
#if CIRCUITPY_STORAGE_MAP_FILE
struct {
const uint8_t *addr;
uint32_t len;
} map[8];
#endif
};
} displayio_ondiskbitmap_t;
#if CIRCUITPY_STORAGE_MAP_FILE
// Row y of an 8-bit file in flash, or NULL if it spans two runs or the file isn't mapped.
const uint8_t *displayio_ondiskbitmap_row(displayio_ondiskbitmap_t *self, int16_t y);
#endif