File tree Expand file tree Collapse file tree 1 file changed +0
-26
lines changed Expand file tree Collapse file tree 1 file changed +0
-26
lines changed Original file line number Diff line number Diff line change @@ -195,32 +195,6 @@ def to_board_bytes(self) -> bytes:
195195 flat = [int (x ) for x in scaled .flatten ().tolist ()]
196196 return bytes (flat )
197197
198- # TODO: move to app class
199- def to_board_hex (self ) -> list [str ]:
200- """Return a single frame as a list of four 32-bit hex words (C format for animations).
201-
202- Please note that it does NOT include any timing/interval word.
203- """
204- a = self .rescale_quantized_frame (scale_max = 255 )
205- height , width = a .shape
206-
207- # threshold to binary presence (non-zero pixels -> 1)
208- pixels = (a > 0 ).astype (int ).flatten ().tolist ()
209-
210- # pad to 128 bits (4 * 32)
211- if len (pixels ) > 128 :
212- raise ValueError ("internal error: pixel buffer too large" )
213- pixels += [0 ] * (128 - len (pixels ))
214-
215- words : list [str ] = []
216- for i in range (0 , 128 , 32 ):
217- w = 0
218- for j in range (32 ):
219- bit = int (pixels [i + j ]) & 1
220- w |= bit << (31 - j )
221- words .append (f"0x{ w :x} " )
222- return words
223-
224198 # -- validation helpers ----------------------------------------------
225199 def _validate (self ) -> None :
226200 """Validate the current Frame instance in-place (internal)."""
You can’t perform that action at this time.
0 commit comments