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

Add methods for reading individual RGB values from LED buffers #6333

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

SamCarlberg
Copy link
Member

Closes #6332

@SamCarlberg SamCarlberg requested a review from a team as a code owner February 1, 2024 05:15
@SamCarlberg SamCarlberg added the component: wpilibj WPILib Java label Feb 1, 2024
* indexed for-loop.
*/
@FunctionalInterface
public interface IndexedColorIterator {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name implies the existence of a non-indexed iterator, but since for-each iterators in the standard library don't include indexes I figured it would be helpful to make it obvious that the index number would also be passed to the function

@Starlight220
Copy link
Member

Looks good, just needs C++.

@ThadHouse
Copy link
Member

Looks good, just needs C++.

C++ can already read the individual RGB values. It doesn't need to be changed.

@SamCarlberg
Copy link
Member Author

The C++ API uses user-managed arrays of LEDData structs. If a user wants the value of a single channel, they can just read it from their array themselves.

@PeterJohnson PeterJohnson merged commit d4533a8 into wpilibsuite:main Feb 1, 2024
27 checks passed
@SamCarlberg SamCarlberg deleted the raw-led-buffer-reads branch February 4, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow RGB values to be read from AddressableLEDBuffers without allocating Color objects
4 participants