Inner representation of a board #99
Replies: 4 comments
-
Would you mind elaborating slightly on the difference between A and B? Do you mean bitmap drawing somehow replacing or bypassing the HTML Canvas API? Also, what would be the principle of D? Perhaps a a vector-based internal representation of the objects coupled with a raster renderer (and possibly some anti-aliasing/interpolation step in between)? Thanks as ever. |
Beta Was this translation helpful? Give feedback.
-
A. The current implementation is a huge object. The implementation is naive, simple. The implementation is ok but Cons1 is not nice (Cons2 too but less important). Solution B is a technical solution for Cons1. Instead of having the full bitmap in memory, the bitmap is divided in tiles. A first solution is to have a element per tile. I guess drawing on a smaller canvas is quicker, etc. Another optimisation is: when a tile is not visible, the tile is stored in a compressed form. Only visible tiles are "active". Well, the "virtual canvas" is potentially infinite, only visible tiles are active, the others are stored. That solution is used in the bitmap software MyPaint that provides an infinite "virtual" canvas. Yes, you perfectly understood solution D! It is a dedicated internal representation of objects (line, erased line, circle, image, etc.). There are already existing libraries for that. Solution D has a drawback: the implementation is difficult to do, or Tableaunoir may depend on a library that may be deprecated in the future. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the concise explanation! I'd vote against Option C, for reasons that we've discussed in another thread (chiefly linked to the eraser). Between A, B, and D — hard to tell. In your own experience, how much load (numbers of users, tableaux, objects) is the current implementation able to withstand before a noticeable performance degradation? Option D would lead to a future-proof infrastructure, but it does sound like a complex undertaking. Option B would involve less time for you… but would still be a solution with inherent limitations, therefore perhaps not the best investment of your time unless the current system is severely performance-limited. (Hence my question above.) |
Beta Was this translation helpful? Give feedback.
-
Actually, option D is currently being implemented! Some users, including me, experienced some slowdown with ~ 4 boards! I now changed the undo/redo implementation a bit. Undo/redo may be slower now, but the drawing (the normal use!) is faster. |
Beta Was this translation helpful? Give feedback.
-
Current inner representation
The rest of the discussion is about layer 3 (canvas), that has some pro and cons.
Pro and cons of the canvas layer
Pro:
Cons:
Vote for your favorite future directions for solving some of the Cons.
A. Leave Tableaunoir in the current state. Cons1, Cons2, Cons3 are not a problem for me.
B. Tableaunoir may become a "raster" (bitmap) board. Pro1, Pro2, Pro3, Pro4 for free! Cons1. could be solved by using the notion of an infinite board like in MyPaint. The big canvas is a collection of tiles.
Cons2 will never be completely solved. Small improvements could be done but that is it.
C. Tableaunoir may become SVG only. The eraser will not be natural anymore. No brush/spray effects. But Cons1 and Cons2 will be solved easily. Pro2 can be adapted.
D. We could use an inner object model. If correctly implemented, it will solve all the Cons, but it is tricky and time-consuming to implement! The main issue with that direction is: is it worth?
Beta Was this translation helpful? Give feedback.
All reactions