Updated NeoBuffer object API (markdown)

Michael Miller
2016-04-17 14:13:47 -07:00
parent a6c7e349ca
commit 462a4308b5

@@ -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.