astra_readX   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/orbbec_test.xtm

Implementation

(bind-func astra_readX
  (lambda (astra:AstraCtx* mlres:i8* vid:ocv_VideoWriter* timeout)
    (let ((res:i32 (astra_update))
           (reader (astra_reader astra))
           (frame:astra_reader_frame_t (salloc))
           (colorFrame:astra_colorframe_t (salloc))
           (colorBodyFrame:astra_colorizedbodyframe_t (salloc))
           (handFrame:astra_handframe_t (salloc))
           (hands:astra_handpoint_X* (alloc 20)) ; (alloc (* 1024 768))))
           (hand:astra_handpoint_X* null)
           (numhands:i32 0) (i:i32 0)
           (res2 (astra_reader_open_frame reader timeout (ref frame))))
      ; (printf "reader %p\n" reader)
      ; (println "astra update" res)
      ; (println "open frame " res2)
      (if (= res2 ASTRA_STATUS_SUCCESS)
          (begin
            (set! res (astra_frame_get_handframe frame (ref handFrame)))
            (set! numhands (get_hand_data handFrame hands #f))
            ; (set! res (astra_frame_get_colorframe frame (ref colorFrame)))
            ; (println "color" res)
            (set! res (astra_frame_get_colorizedbodyframe frame (ref colorBodyFrame)))
            ;; (println "colorbody" res)
            (draw_color_body_frame_with_hands colorBodyFrame hands numhands mlres vid #f)
            ;; (println "out of color!")
            (ocv_waitKey 1)
            (set! res (astra_reader_close_frame (ref frame)))
            void)
          (begin
            (ocv_waitKey 1)
            (println "Fail!" res2)))
      void)))


Back to Index

Similar Entries