summaryrefslogtreecommitdiff
path: root/shared-module/displayio
AgeCommit message (Collapse)Author
2021-03-25move to displayio_area_union and away from _expandKevin Matocha
2021-03-22update logic for transform_xyKevin Matocha
2021-03-20Merge pull request #4432 from jepler/bitmap-dirty-improvementsJeff Epler
Bitmap dirty improvements
2021-03-19switch to > in displayio_area_canonKevin Matocha
2021-03-19Fix PWMOut non-error handling and never resetDan Halbert
2021-03-18Merge pull request #4429 from jepler/displayio-bitmap-memoryviewJeff Epler
displayio.Bitmap: Make memoryview()able
2021-03-18displayio: Move bitmap read-only checking to displayio_bitmap_set_dirty_areaJeff Epler
This is a modest code savings, but more importantly it reduces boilerplate in bitmap-modifying routines. Callers need only ensure they call displayio_bitmap_set_dirty_area in advance of the bitmap modifications they perform. (note that this assumes that no bitmap operation can enter background tasks. If an operation COULD enter background tasks, it MUST re-dirty the area it touches when it exits, simply by a fresh call to set_dirty_area with the same area as before)
2021-03-18displayio_bitmap_set_dirty_area: rewrite in terms of displayio_areaJeff Epler
.. simplifying code in the process. For instance, now fill_region uses area routines to order and constrain its coordinates. Happily, this change also frees a modest amount of code space.
2021-03-18displayio: area: add displayio_area_canonJeff Epler
This routine will be used to simplify code that deals with ranges of bitmap coordinates.
2021-03-18displayio: area: add displayo_area_copy_coords, displayio_area_emptyJeff Epler
.. and simplify the implmentation of displayio_area_union This _slightly_ changes the behavior of displayio_area_union: Formerly, if one of the areas was empty, its coordinates were still used in the min/max calculations. Now, if one of the areas is empty, the result gets the other area's coords In particular, taking the union of the empty area with coords (0,0,0,0) with the non-empty area (x1,y1,x2,y2) would give the area (0,0,x2,y2) before, and (x1,y1,x2,y2) after the change.
2021-03-17displayio.Bitmap: Make memoryview()ableJeff Epler
2021-03-16add is_transparent getter to displayio.PaletteKevin Matocha
2021-03-15run code formatting scriptmicroDev
2021-03-10add fill_region and draw_line to bitmaptoolsKevin Matocha
2021-03-07refactor displayio set_pixel for use in bitmap_toolsKevin Matocha
2021-03-04Be cognizant of null transform for .transpose_xyDan Halbert
2021-03-03use self->members in displayio_group_set()Dan Halbert
2021-03-02Merge pull request #4233 from pewpew-game/displayio-group-listScott Shawcroft
displayio: make Group use a python list internally
2021-02-27Separate out mp_obj_list_insert for use in display.GroupRadomir Dopieralski
Note that for some reason this makes the binary 500 bytes larger!
2021-02-27Remove max_size from displayio.GroupRadomir Dopieralski
Still accept it as an argument. Add deprecation note.
2021-02-27Remove unused typedef for group childrenRadomir Dopieralski
2021-02-27Separate mp_obj_list_pop so it can be used outside of objlist.cRadomir Dopieralski
2021-02-27Replace displaio.Group.children with a python listRadomir Dopieralski
This is a first go at it, done by naive replacing of all array operations with corresponding operations on the list. Note that there is a lot of unnecessary type conversions, here. Also, list_pop has been copied, because it's decalerd STATIC in py/objlist.h
2021-02-27displaio: don't store group children native objectRadomir Dopieralski
Since we want to expose the list of group's children to the user, we should only have the original objects in it, without any other additional data, and compute the native object as needed.
2021-02-26fix two off by one errorsKevin Matocha
2021-02-25Update for clean blitting into itselfKevin Matocha
2020-12-28update common_hal_reset_pin()microDev
2020-12-17OnDiskBitmap: Correct handling of "0 color palette" imagesJeff Epler
Microsoft documentation says: > If biCompression equals BI_RGB and the bitmap uses 8 bpp or less, the bitmap has a color table immediatelly following the BITMAPINFOHEADER structure. The color table consists of an array of RGBQUAD values. The size of the array is given by the biClrUsed member. If biClrUsed is zero, the array contains the maximum number of colors for the given bitdepth; that is, 2^biBitCount colors. Formerly, we treated 0 colors as "no image palette" during construction, but then during common_hal_displayio_ondiskbitmap_get_pixel indexed into the palette anyway. This could have unpredictable results. On a pygamer, it gave an image that was blue and black. On magtag, it gave a crash.
2020-12-16displayio: ColorConverter: fix logic errors about transparent pixelsJeff Epler
The transparent_color field was never initialized. I _think_ this means its value was always set to 0, or the blackest of blacks. Instead, initialize it to the sentinel value, newly given the name NO_TRANSPARENT_COLOR. This exposed a second problem: The test for whether there was an existing transparent color was wrong (backwards). I am guessing that this was not found due to the first bug; since the converter had a transparent color, the correct test would have led to always getting the error "Only one color can be transparent at a time". Closes #3723
2020-11-23Merge pull request #3718 from jepler/epd-rotationScott Shawcroft
EPaperDisplay: add rotation property
2020-11-18Fix Palette grayscale for EInk.Scott Shawcroft
It needs to do the bitmasking that was only added to ColorConverter in #3611
2020-11-18EPaperDisplay: add rotation propertyJeff Epler
untested, because I don't want to mess my magtag demo up :) but it builds
2020-11-13Add .busy property to EPaperDisplayScott Shawcroft
2020-11-13Add board.DISPLAY to MagTag. Fix luma computationScott Shawcroft
* Initialize the EPaper display on the MagTag at start. * Tweak the display send to take a const buffer. * Correct Luma math * Multiply the blue component, not add. * Add all of the components together before dividing. This reduces the impact of truncated division.
2020-11-09use full_change instead of movedfoamyguy
2020-11-08set moved true when unhiding tilegridfoamyguy
2020-10-26Add grayscale EInk supportScott Shawcroft
2020-10-16displayio: Remove trailing whitespaceJensen
2020-10-16Merge branch 'main' into color-converter-transparencyJensen Kuras
2020-10-16displayio: Add in opaque pixel option for futureJensen
2020-10-15displayio: further ensure just one start_terminal callJeff Epler
@cwalther determined that for boards with 2 displays (monster m4sk), start_terminal would be called for each one, leaking supervisor heap entries. Determine, by comparing addresses, whether the display being acted on is the first display (number zero) and do (or do not) call start_terminal. stop_terminal can safely be called multiple times, so there's no need to guard against calling it more than once. Slight behavioral change: The terminal size would follow the displays[0] size, not the displays[1] size
2020-10-14Merge branch 'color-converter-transparency' of ↵Jensen
github.com:jensechu/circuitpython into color-converter-transparency
2020-10-14displayio: ColorConverter handle if opaque color is blackJensen
2020-10-12Merge branch 'main' into color-converter-transparencyJensen Kuras
2020-10-12displayio: Add make_transparent to ColorConverterJensen
2020-10-12displayio: Add make_transparent and make_opaque to ColorConvertorJensen
2020-10-12displayio: Pass transparent_color to ColorConverterJensen
Signed-off-by: Jensen <jensechu@gmail.com>
2020-10-11displayio, framebufferio: Remove spurious call to supervisor_start_terminalJeff Epler
A call to supervisor_start_terminal remained in common_hal_displayio_display_construct and was copied to other display _construct functions, even though it was also being done in displayio_display_core_construct when that was factored out. Originally, this was harmless, except it created an extra allocation. When investigating #3482, I found that this bug became harmful, especially for displays that were created in Python code, because it caused a supervisor allocation to leak. I believe that it is safe to merge #3482 after this PR is merged.
2020-10-02Merge pull request #3507 from jepler/issue3506-matrixportal-crashLimor "Ladyada" Fried
displayio: Fix matrixportal crash
2020-10-02displayio: Fix matrixportal crashJeff Epler
An RGBMatrix has no bus and no bus_free method. It is always possible to refresh the display. This was not a problem before, but the fix I suggested (#3449) added a call to core_bus_free when a FramebufferDisplay was being refreshed. This was not caught during testing. This is a band-aid fix and it brings to light a second problem in which a SharpDisplay + FrameBuffer will not have a 'bus' object, and yet does operate using a shared SPI bus. This kind of display will need a "bus-free" like function to be added, or it can have problems like #3309.