diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-09-10 22:00:21 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-09-12 15:25:59 -0700 |
| commit | f21cf15c384756ae462fdffded79c4bda8afcc28 (patch) | |
| tree | 249eb50cd46c11e163083cba74ebb7a819ed8f55 /shared-module/displayio/OnDiskBitmap.h | |
| parent | 9ace50a18ad4baa431c406fd6dc509f9fee92c4c (diff) | |
Add OnDiskBitmap which loads pixel data straight from disk.
Also, renamed Sprite's palette to pixel_shader so it can be
anything that produces colors based on values (including color values).
Added a ColorConverter that converts RGB888 (found in bitmaps) to
RGB565 for the display.
Fixes #1182
Diffstat (limited to 'shared-module/displayio/OnDiskBitmap.h')
| -rw-r--r-- | shared-module/displayio/OnDiskBitmap.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/shared-module/displayio/OnDiskBitmap.h b/shared-module/displayio/OnDiskBitmap.h new file mode 100644 index 000000000..31d6c9550 --- /dev/null +++ b/shared-module/displayio/OnDiskBitmap.h @@ -0,0 +1,47 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_ONDISKBITMAP_H +#define MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_ONDISKBITMAP_H + +#include <stdbool.h> +#include <stdint.h> + +#include "py/obj.h" + +#include "extmod/vfs_fat.h" + +typedef struct { + mp_obj_base_t base; + uint16_t width; + uint16_t height; + uint16_t data_offset; + uint16_t stride; + pyb_file_obj_t* file; + uint8_t bytes_per_pixel; +} displayio_ondiskbitmap_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_ONDISKBITMAP_H |
