Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image effect (GIF support) #3835

Open
wants to merge 10 commits into
base: 0_15
Choose a base branch
from
Open

Image effect (GIF support) #3835

wants to merge 10 commits into from

Conversation

Aircoookie
Copy link
Owner

A very versatile advanced effect mode for displaying .gif images (could be extended to other filetypes like .bmp or .fseq in the future) on matrices and 1D strips.

  • full animation and static image support
  • upload GIF to LittleFS (/edit) and set the filename as the segment name
  • speed is adjustable

Limitations

  • the effect can only be used on one segment at a time
  • no image is displayed during effect transitions
  • As 23kB RAM are required while the effect is running, this is ESP32 only
  • each animation frame only redraws the pixels that are actually updated. This can lead to uneven brightness if ABL kicks in. I highly recommend enabling global buffer to solve this :)

@Aircoookie Aircoookie marked this pull request as ready for review March 20, 2024 07:40
@blazoncek
Copy link
Collaborator

Now we will really need to start working on SD card support. 😄

@blazoncek
Copy link
Collaborator

blazoncek commented Mar 20, 2024

Is the removal of mqtt.cpp intentional or accidental?
Eh! Disregard. I see that entire file was changed. Probably CRLF.

@constant-flow
Copy link
Contributor

Now we will really need to start working on SD card support. 😄

SD support is already implemented and merged as usermod

@blazoncek blazoncek linked an issue Mar 24, 2024 that may be closed by this pull request
@blazoncek
Copy link
Collaborator

Finally had a bit of time to go through the code. Sorry for the delay.

There are a few of Serial.print() still present but that's minor.
I am a bit intrigued by the addition of endImagePlayback(this); into resetIfRequired(). That is something we need to add to Segment handling in general as the effect functions never receive any notification that they will no longer run and cannot clean-up anything. Everything now relies on deallocateData() which is a bit of shame really.
I would also move the content of renderImageToSegment() into mode_image() as it is more "tightly" connected to actual Segments. Perhaps the entire image_loader.cpp could be encapsulated within a class inside mode_image() in a similar way as 1D expansion is done.

@Aircoookie
Copy link
Owner Author

Thanks!
Yeah, I don't like endImagePlayback() in resetIfRequired() either. It would probably be a good idea to add some callback for cleanup when effect is changed. To avoid requiring an extra 4 bytes for the pointer in each segment, this could also just call the mode function with a bool parameter cleanup though.
Regarding image_loader.cpp, I would keep it this way. FX.cpp is already over 8k lines and putting functionality into separate files when it makes sense eases maintainability imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gif support
3 participants