test 5 pls disregard
Joeish W
joeish80829 at yahoo.com
Sat Oct 5 13:33:22 UTC 2013
(defun create-trackbar-example (&optional (camera-index 0) (width *default-width*)
(height *default-height*))
"Creates a trackbar and attaches it to the specified window.
Move the slider to adjust the brightess of the camera output"
(with-capture (capture (create-camera-capture camera-index))
(let ((window-name "CREATE-TRACKBAR Example")
(contrast (cffi:foreign-alloc :int :initial-contents '(50))))
(set-capture-property capture +cap-prop-frame-width+ width)
(set-capture-property capture +cap-prop-frame-height+ height)
(named-window window-name)
(move-window window-name 600 175)
(do* ((frame (query-frame capture) (query-frame capture))
(dest (clone-image frame))
(scalar 0))
((plusp (wait-key *millis-per-frame*)) nil)
(format t "Trackbar level: ~a~%~%" (cffi:mem-ref contrast :int))
(create-trackbar "Brightness" window-name contrast 100 (change-contrast contrast window-name frame dest))
(setf scalar (scalar (- (cffi:mem-ref contrast :int 50))
(- (cffi:mem-ref contrast :int) 50)
(- (cffi:mem-ref contrast :int) 50)))
(add-s frame scalar dest)
(show-image window-name dest))
(destroy-window window-name))))
(defun create-trackbar-example (&optional (camera-index 0) (width *default-width*)
(height *default-height*))
"Creates a trackbar and attaches it to the specified window.
Move the slider to adjust the brightess of the camera output"
(with-capture (capture (create-camera-capture camera-index))
(let ((window-name "CREATE-TRACKBAR Example")
(contrast (cffi:foreign-alloc :int :initial-contents '(50))))
(set-capture-property capture +cap-prop-frame-width+ width)
(set-capture-property capture +cap-prop-frame-height+ height)
(named-window window-name)
(move-window window-name 600 175)
(do* ((frame (query-frame capture) (query-frame capture))
(dest (clone-image frame))
(scalar 0))
((plusp (wait-key *millis-per-frame*)) nil)
(format t "Trackbar level: ~a~%~%" (cffi:mem-ref contrast :int))
(create-trackbar "Brightness" window-name contrast 100 (change-contrast contrast window-name frame dest))
(setf scalar (scalar (- (cffi:mem-ref contrast :int 50))
(- (cffi:mem-ref contrast :int) 50)
(- (cffi:mem-ref contrast :int) 50)))
(add-s frame scalar dest)
(show-image window-name dest))
(destroy-window window-name))))
(defun create-trackbar-example (&optional (camera-index 0) (width *default-width*)
(height *default-height*))
"Creates a trackbar and attaches it to the specified window.
Move the slider to adjust the brightess of the camera output"
(with-capture (capture (create-camera-capture camera-index))
(let ((window-name "CREATE-TRACKBAR Example")
(contrast (cffi:foreign-alloc :int :initial-contents '(50))))
(set-capture-property capture +cap-prop-frame-width+ width)
(set-capture-property capture +cap-prop-frame-height+ height)
(named-window window-name)
(move-window window-name 600 175)
(do* ((frame (query-frame capture) (query-frame capture))
(dest (clone-image frame))
(scalar 0))
((plusp (wait-key *millis-per-frame*)) nil)
(format t "Trackbar level: ~a~%~%" (cffi:mem-ref contrast :int))
(create-trackbar "Brightness" window-name contrast 100 (change-contrast contrast window-name frame dest))
(setf scalar (scalar (- (cffi:mem-ref contrast :int 50))
(- (cffi:mem-ref contrast :int) 50)
(- (cffi:mem-ref contrast :int) 50)))
(add-s frame scalar dest)
(show-image window-name dest))
(destroy-window window-name))))
(defun create-trackbar-example (&optional (camera-index 0) (width *default-width*)
(height *default-height*))
"Creates a trackbar and attaches it to the specified window.
Move the slider to adjust the brightess of the camera output"
(with-capture (capture (create-camera-capture camera-index))
(let ((window-name "CREATE-TRACKBAR Example")
(contrast (cffi:foreign-alloc :int :initial-contents '(50))))
(set-capture-property capture +cap-prop-frame-width+ width)
(set-capture-property capture +cap-prop-frame-height+ height)
(named-window window-name)
(move-window window-name 600 175)
(do* ((frame (query-frame capture) (query-frame capture))
(dest (clone-image frame))
(scalar 0))
((plusp (wait-key *millis-per-frame*)) nil)
(format t "Trackbar level: ~a~%~%" (cffi:mem-ref contrast :int))
(create-trackbar "Brightness" window-name contrast 100 (change-contrast contrast window-name frame dest))
(setf scalar (scalar (- (cffi:mem-ref contrast :int 50))
(- (cffi:mem-ref contrast :int) 50)
(- (cffi:mem-ref contrast :int) 50)))
(add-s frame scalar dest)
(show-image window-name dest))
(destroy-window window-name))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20131005/4085a1f8/attachment.html>
More information about the cffi-devel
mailing list