mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-06 12:24:27 +02:00
Updated NeoBuffer object API (markdown)
@@ -59,11 +59,11 @@ This will render all of this image to the destBuffer at given location. This is
|
||||
destBuffer - Another NeoBuffer or NeoPixelBus.
|
||||
xDest - the upper left location in the destination to render to
|
||||
yDest - the upper left location in the destination to render to
|
||||
layoutMap - a layoutMap callback that implements the destinations mapping routine (see Matrix Panel support)
|
||||
layoutMap - a layoutMap callback that implements the destinations mapping routine (see below)
|
||||
|
||||
## Callbacks
|
||||
### uint16_t LayoutMapCallback(int16_t x, int16_t y)
|
||||
As the consumer of certain methods, you will need to implement this and pass it into those methods. You are expected to translate the x,y location of the destination to a linear index value. If you have implemented NeoTopology, NeoTiles, or NeoMosaic; you can just call the `MapProbe()` method on them and return what they provide.
|
||||
As the consumer of certain methods, you will need to implement this and pass it into those methods. You are expected to translate the x,y location of the destination to a linear index value. If you have implemented `NeoTopology`, `NeoTiles`, or `NeoMosaic`; you can just call the `MapProbe()` method on them and return what they provide.
|
||||
```
|
||||
NeoTopology<RowMajorLayout> topo(16,16); // 16x16 matrix panel
|
||||
|
||||
@@ -72,4 +72,4 @@ uint16_t MyLayoutMap(int16_t x, int16_t y)
|
||||
return topo.MapProbe(x, y);
|
||||
}
|
||||
```
|
||||
If you implement your own, make sure to handle out of range values beyond your edges including negative values and return PixelIndex_OutOfBounds for these cases.
|
||||
If you implement your own, make sure to handle out of range values beyond your edges including negative values and return `PixelIndex_OutOfBounds` for these cases.
|
Reference in New Issue
Block a user