diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-09-07 14:30:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-07 14:30:30 -0400 |
| commit | 449756ef2756a5508d82fa7830d3a83eb7f1ffa9 (patch) | |
| tree | 2a6c11276c1bccc43d6b9482bf474813b324d5ba /shared-module/displayio/Bitmap.h | |
| parent | 23b23dd2b8e3a9a401e6ba8d60728adebe51c840 (diff) | |
| parent | 86288f14f1312c6b65ac7f268a3ecf093b0aaed9 (diff) | |
Merge pull request #1152 from tannewt/hallowing
Introduce displayio to render graphics to displays.
Diffstat (limited to 'shared-module/displayio/Bitmap.h')
| -rw-r--r-- | shared-module/displayio/Bitmap.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/shared-module/displayio/Bitmap.h b/shared-module/displayio/Bitmap.h new file mode 100644 index 000000000..781a4d12a --- /dev/null +++ b/shared-module/displayio/Bitmap.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_BITMAP_H +#define MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_BITMAP_H + +#include <stdbool.h> +#include <stdint.h> + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint16_t width; + uint16_t height; + uint32_t* data; + uint16_t stride; // words + uint8_t bits_per_value; + uint8_t x_shift; + uint8_t x_mask; + uint16_t bitmask; +} displayio_bitmap_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_BITMAP_H |
