home *** CD-ROM | disk | FTP | other *** search
- (in-package :oou)
- (oou-provide :RO-vd)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; RO-vd.Lisp
- ;;
- ;; Copyright ⌐ 1990 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; class on which RasterOps video digitizer objects are based
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies
- :video-digitizer
- :+Devices
- :GDevice-u
- )
-
- (export '(
- ))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (eval-when (:compile-toplevel :load-toplevel :execute)
-
- (defrecord (ROCsParam :pointer)
- ;;ROCsParam records are passed into Control calls to the RasterOps
- ;;driver. This argument is a pointer to a 22 block of memory which
- ;;corresponds to the csParam field of a ParamBlockRec which is
- ;;defined as: array[0..10] of integer. The use of these 22 bytes
- ;;varies, depending on the csCode.
- (variant
- ((csParam (array :integer 11)))
- ((ptr pointer))))
-
- (defconstant CB364-board-id #x028A)
- (defconstant RO24STV-board-id #x03A5)
- (defconstant RO24XLTV-board-id #x03C9)
- (defconstant ROMT-board-id #x0406 "RasterOps MediaTime")
-
- (defconstant RO-error-code-alist
- '((-9000 . "The requested RasterOps board is not present.")
- (-8999 . "XCMD has wrong number of parameters.")
- (-8998 . "Not a RasterOps real-time video board.")
- (-8997 . "Board order parameter not in range (1-6).")
- (-8996 . "No driver loaded.")
- (-8995 . "Video board not in 8-bit mode.")
- (-8994 . "Requested 'clut' resource not found.")
- (-8993 . "Cancelled by user.")
- (-8992 . "Failed recording PICT to Clipboard.")
- (-8991 . "Rectangle not on RasterOps screen.")
- (-8990 . "Recording pixel depth not 0,1,2,4,8,16, or 32.")
- (-8989 . "32-Bit QuickDraw is not installed.")
- (-8988 . "Out of memory.")
- (-8987 . "No such video source.")
- (-8986 . "Bad recording rectangle.")
- (-8985 . "Not a RasterOps video function.")
- (-8984 . "No HyperCard document window found.")
- (-8043 . "Get digitize LUT pointer NIL.")
- (-8042 . "DMSD register out of range.")
- (-8041 . "Color value out of range.")
- (-8040 . "Color key mask rectangle out of range.")
- (-8039 . "Aperture out of range.")
- (-8038 . "Coring out of range.")
- (-8037 . "Bandpass type out of range.")
- (-8036 . "Vertical noise reduction mode out of range.")
- (-8035 . "LUMA delay compensation out of range.")
- (-8034 . "AGC response out of range.")
- (-8033 . "Load digitze LUT pointer NIL.")
- (-8032 . "DMSD register or data out of range.")
- (-8031 . "Board not available.")
- (-8030 . "Input type not valid.")
- (-8022 . "Color table handle too small or NIL.")
- (-8021 . "Board already reserved.")
- (-8020 . "Byte offset not in range.")
- (-8019 . "Board bit depth is less than 8 bits per pixel.")
- (-8018 . "Timed out with WaitTillDone.")
- (-8017 . "NuBus delay not in range.")
- (-8016 . "Top position must be even.")
- (-8015 . "Screen position not in frame buffer.")
- (-8014 . "Control flag not in range.")
- (-8013 . "Source video top and bottom positions must be even.")
- (-8012 . "Vertical size must be even.")
- (-8011 . "Vertical size not in range.")
- (-8010 . "Horizontal size not in range.")
- (-8009 . "Source video rectangle out of range.")
- (-8008 . "Black level not in range.")
- (-8007 . "White level not in range.")
- (-8006 . "Contrast not in range.")
- (-8005 . "Brightness not in range.")
- (-8004 . "Saturation not in range.")
- (-8003 . "Hue not in range.")
- (-8002 . "Pan position out of range.")
- (-8001 . "Zoom factor not 1,2,4, or 8.")
- (-18 . "Driver status error.")
- (-17 . "Driver control error."))
- )
-
- )
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defclass RO-vd (video-digitizer)
- ((board-id :initarg :board-id
- :reader board-id)
- (drvr-refnum :reader drvr-refnum)
- (frame-topLeft :reader frame-topLeft)
- (alternate-PLL :initarg :alternate-PLL
- :accessor alternate-PLL)
- (h-flip :initarg :h-flip
- :accessor h-flip)
- (v-flip :initarg :v-flip
- :accessor v-flip)
- (reverse-fields :initarg :reverse-fields
- :accessor reverse-fields)
- (digitizing-speed :initarg :digitizing-speed
- :accessor digitizing-speed)
- (control-flag :initarg :control-flag
- :accessor control-flag))
- (:default-initargs
- :alternate-PLL t
- :h-flip nil
- :v-flip nil
- :reverse-fields nil
- :digitizing-speed :full
- :control-flag :both
- ))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; RasterOps coordinate conversion functions
- ;; RasterOps boards use frame coordinates where #@(0 0) is the topLeft
- ;; of the RasterOps driven screen.
-
-
- (defmethod ROvd-global-frame-corners ((vd RO-vd))
- ;returns the topLeft and botRight of the RasterOps driven screen
- (with-macptrs ((gd (ROvd-get-GDevice vd)))
- (values (href gd :GDevice.gdRect.topLeft)
- (href gd :GDevice.gdRect.botRight))))
-
- (defmethod ROvd-local-to-frame ((vd RO-vd) h &optional v)
- (rlet ((pt :point))
- (%put-point pt (make-point h v))
- (#_LocalToGlobal pt)
- (subtract-points (%get-point pt) (frame-topLeft vd))))
-
- (defmethod ROvd-frame-to-local ((vd RO-vd) h &optional v)
- (add-points (make-point h v) (frame-topLeft vd))
- (rlet ((pt :point ))
- (#_GlobalToLocal pt)
- (%get-point pt)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defmethod vd-error-code-alist ((vd RO-vd))
- (declare (ignore vd))
- RO-error-code-alist)
-
- (defmethod vd-init :after ((vd RO-vd))
- (setf (slot-value vd 'frame-topLeft) (ROvd-global-frame-corners vd)))
-
- ;;vd-dispose
-
- (defmethod vd-GDevice ((vd RO-vd))
- (ROvd-get-GDevice vd))
-
- (defmethod vd-max-src-rect-corners ((vd RO-vd))
- (ROvd-get-max-source-rect vd))
-
- (defmethod vd-digitizing-p ((vd RO-vd))
- (and (call-next-method) (ROvd-continuous-p vd)))
-
- (defmethod vd-start-digitizing :after ((vd RO-vd))
- (ROvd-set-continuous vd t))
-
- (defmethod vd-stop-digitizing :after ((vd RO-vd))
- (ROvd-set-continuous vd nil))
-
- (defmethod vd-grab-one-frame :after ((vd RO-vd))
- (ROvd-one-shot vd))
-
- (defmethod vd-install-settings :after ((vd RO-vd))
- (ROvd-set-alternate-PLL vd (alternate-PLL vd))
- (ROvd-set-horizontal-flip vd (h-flip vd))
- (ROvd-set-vertical-flip vd (v-flip vd))
- (ROvd-set-reverse-fields vd (reverse-fields vd))
- (ROvd-set-speed vd (digitizing-speed vd))
- (ROvd-set-control-flag vd (control-flag vd)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; set functions for video control values
-
- ;;vd-set-src-rect
- ;;RasterOps boards don't support a distinct a source & digitizer rect
-
- (defmethod vd-set-dig-rect ((vd RO-vd) topLeft botRight)
- (ROvd-set-video-source-rect vd topLeft botRight))
-
- (defmethod vd-set-dest-rect ((vd RO-vd) topLeft botRight)
- (ROvd-set-video-destination-rect vd topLeft botRight))
-
- (defmethod vd-set-input-format ((vd RO-vd) format)
- (ROvd-set-video-source vd format)
- format)
-
- (defmethod vd-get-input-format ((vd RO-vd))
- (ROvd-get-current-video-source vd))
-
-
- ;;vd-set-input-standard - 24STV only
- ;;vd-get-input-standard - 24STV only
-
- ;;vd-set-contrast - 364 only
- ;;vd-get-contrast - 364 only
- ;;vd-set-hue - model specific value range
- ;;vd-get-hue - model specific value range
- ;;vd-set-saturation - model specific value range
- ;;vd-get-saturation - model specific value range
-
- (defmethod vd-install-settings :before ((vd RO-vd))
- (ROvd-reset vd))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;RO specific settings
-
- (defmethod (setf alternate-PLL) :after (on-p (vd RO-vd))
- (when (vd-digitizing-p vd)
- (ROvd-set-alternate-PLL vd on-p)))
-
- (defmethod (setf vertical-flip) :after (flip-p (vd RO-vd))
- (when (vd-digitizing-p vd)
- (ROvd-set-vertical-flip vd flip-p)))
-
- (defmethod (setf horizontal-flip) :after (flip-p (vd RO-vd))
- (when (vd-digitizing-p vd)
- (ROvd-set-horizontal-flip vd flip-p)))
-
- (defmethod (setf reverse-fields) :after (on-p (vd RO-vd))
- (when (vd-digitizing-p vd)
- (ROvd-set-reverse-fields vd on-p)))
-
- (defmethod (setf digitizing-speed) :after (speed (vd RO-vd))
- (when (vd-digitizing-p vd)
- (ROvd-set-speed vd speed)))
-
- (defmethod (setf control-flag) :after (flag (vd RO-vd))
- (when (vd-digitizing-p vd)
- (ROvd-set-control-flag vd flag)))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; RasterOps functions
-
- (defun ROvd-get-GDevice-list (board-id)
- (flet ((find-gd (slot)
- (flet ((find-it (gd)
- (with-macptrs ((aDCE (#~GetDCtlEntry (href gd :GDevice.gdRefNum))))
- (when (= slot (href aDCE :AuxDCE.dCtlSlot))
- (return-from find-gd gd)))))
- (declare (dynamic-extent #'find-it))
- (mapc-GDevices #'find-it))))
- (declare (dynamic-extent #'find-gd))
- (rlet ((spb :SpBlock))
- (let (gd-list)
- (dotimes (slot 16 (nreverse gd-list))
- (pset spb :SpBlock.spSlot slot)
- (pset spb :SpBlock.spId 0)
- (pset spb :SpBlock.spExtDev 0)
- (unless (zerop (#_SNextSRsrc spb)) (return gd-list))
- (let ((gd (find-gd slot)))
- (when gd
- (pset spb :SpBlock.spID #$BoardId)
- (when (and (zerop (#_SReadWord spb))
- (= board-id (#_LoWord (pref spb :SpBlock.spResult))))
- (setf gd-list (cons gd gd-list))))))))))
-
- (defmethod ROvd-get-GDevice ((vd RO-vd))
- (elt (ROvd-get-GDevice-list (board-id vd)) (1- (card-num vd))))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;Control calls
-
-
- (defmethod ROvd-set-alternate-PLL ((vd RO-vd) on-p)
- ;enable/disable the use of an alternate Phase Lock Loop component
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (if on-p 1 0)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9034 csParamPtr))))
-
-
-
- (defmethod ROvd-set-continuous ((vd RO-vd) on-p &optional (wait-p nil))
- ;starts continuous digitizing & display
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (if on-p 1 0)
- (:csParam 1) (if (and (not on-p) wait-p) 1 0)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9025 csParamPtr))))
-
-
- (defmethod ROvd-erase-frame-buffer ((vd RO-vd) red-byte blue-byte green-byte)
- ;erase the entire frame buffer to the specified color value
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (logior (ash (logand #xFF red-byte) 16)
- (ash (logand #xFF green-byte) 8)
- (logand #xFF blue-byte))))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9000 csParamPtr))))
-
-
- (defmethod ROvd-set-horizontal-flip ((vd RO-vd) flipped-p)
- ;sets the horizontal orientation of the next digitized image
- (unless (eq (ROvd-flipped-horizontally-p vd) flipped-p)
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9028 csParamPtr)))))
-
-
- (defmethod ROvd-set-vertical-flip ((vd RO-vd) flipped-p)
- ;sets the vertical orientation of the next digitized image
- (unless (eq (ROvd-flipped-vertically-p vd) flipped-p)
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9029 csParamPtr)))))
-
-
- (defmethod ROvd-set-hue ((vd RO-vd) value)
- ;value in [0-63 for 364] or [0-255 for 24STV]
- ;controls the hue of the digitized video image
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) value))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9006 csParamPtr))))
-
-
- (defmethod ROvd-set-NuBus-delay ((vd RO-vd) delay)
- ;delay = [0-255]
- ;controls how long the NuBus is held off before QuickDraw can write to the
- ;frame buffer while live video is being digitized
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) delay))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9016 csParamPtr))))
-
-
- (defmethod ROvd-one-shot ((vd RO-vd) &optional (wait-p t))
- ;causes the hardware to digitize & display a single frame or field
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (if wait-p 1 0)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9026 csParamPtr))))
-
-
- (defmethod ROvd-set-pan-position ((vd RO-vd) point &optional (sync-p t))
- ;sets the pan position of the screen display
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (point-h point)
- (:csParam 1) (point-v point)
- (:csParam 2) (if sync-p 1 0)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9002 csParamPtr))))
-
-
- (defmethod ROvd-set-reserve ((vd RO-vd) on-p)
- ;reserve/un-reserve the digitizing board (to lock out other applications)
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (if on-p 1 0)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9033 csParamPtr))))
-
-
- (defmethod ROvd-reset ((vd RO-vd))
- ;resets the digitizing board to its power-up settings
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9027 csParamPtr))))
-
-
- (defmethod ROvd-set-reverse-fields ((vd RO-vd) on-p)
- ;enabling reverse-field may remove scanline incoherence errors on video images
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (if on-p 1 0)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9035 csParamPtr))))
-
-
- (defmethod ROvd-set-saturation ((vd RO-vd) value)
- ; value = [0-63/364] or [0-255/24STV]
- ;controls the saturation of the digitized video image
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) value))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9007 csParamPtr))))
-
-
- (defmethod ROvd-set-speed ((vd RO-vd) new-speed)
- ; new-speed = :full or :half
- ;controls digitizing speed (30 fps)/half(15 fps)
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (ecase new-speed
- (:full 1)
- (:half 0))))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9024 csParamPtr))))
-
- (defmethod ROvd-set-video-destination-position ((vd RO-vd) h &optional v)
- ;sets the top-left position for the live video image
- (let ((point (ROvd-local-to-frame vd h v)))
- (unless (evenp (point-v point))
- (setf point (add-points point #@(0 1))))
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (point-v point)
- (:csParam 1) (point-h point)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9015 csParamPtr)))))
-
-
- (defmethod ROvd-set-video-source-rect ((vd RO-vd) topLeft botRight)
- ;sets the source rectangle to digitize
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9012 csParamPtr))
- (pset csParamPtr (:ROCsParam.csParam 0) (point-v topLeft))
- (pset csParamPtr (:ROCsParam.csParam 1) (point-h topLeft))
- (pset csParamPtr (:ROCsParam.csParam 2) (point-v botRight))
- (pset csParamPtr (:ROCsParam.csParam 3) (point-h botRight))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9012 csParamPtr))))
-
-
- (defmethod ROvd-set-control-flag ((vd RO-vd) new-control-flag)
- ; new-control-flag = :both, :odd, or :even
- ;sets the control flag. Allowed flag values:
- ; :both - use both fields starting with even
- ; :odd - use odd field for half-size or less
- ; :even - use even field for half-size or less
- ; :both-dls - both fields & double line skipping for half-size or less
- ; :odd-sls - use both fields and single line skipping
- ; :even-sls - use both fields and single line skipping
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9012 csParamPtr))
- (pset csParamPtr (:ROCsParam.csParam 6) (ecase new-control-flag
- (:both 0)
- (:odd 1)
- (:even 2)
- (:both-dls 4)
- (:odd-sls 5)
- (:even-sls 6)))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9012 csParamPtr))))
-
-
- (defmethod ROvd-set-video-destination-size ((vd RO-vd) h &optional v)
- ; destSize: h = [0-652], v = [0-510]
- ;sets the display image size
- (let ((destSize (make-point h v)))
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9012 csParamPtr))
- (pset csParamPtr (:ROCsParam.csParam 4) (point-h destSize))
- (pset csParamPtr (:ROCsParam.csParam 5) (point-v destSize))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9012 csParamPtr)))))
-
-
- (defmethod ROvd-set-video-destination-rect ((vd RO-vd) topLeft botRight)
- ;sets the destination rectangle of the digitized image
- (ROvd-set-video-destination-position vd topLeft)
- (ROvd-set-video-destination-size vd (subtract-points botRight topLeft)))
-
-
- (defmethod ROvd-set-video-source ((vd RO-vd) source)
- ; source = :composite or :s-video
- ;sets the ColorBoard 364 hardware to use the composite/s-video connector for input
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (ecase source
- (:composite 0)
- (:s-video 1))))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9005 csParamPtr))))
-
-
- (defmethod ROvd-set-zoom ((vd RO-vd) zoom-factor)
- ; zoom-factor = 1, 2, 4, or 8
- ;set the hardware zoom factor to 1x, 2x, 4x, or 8x
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) zoom-factor))
- (vd-nz-error-check vd (#~Control (drvr-refnum vd) 9001 csParamPtr))))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;Status calls
-
-
- (defmethod ROvd-active-p ((vd RO-vd) &optional (wait-p t))
- ;returns in whether the ColorBoard 364 is currently digitizing a frame or field.
- ; nil - not active
- ; :one-shot - active doing OneShot
- ; :continuous - active doing continuous digitizing
- (rlet ((csParamPtr :ROCsParam
- (:csParam 0) (if wait-p 1 0)))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9026 csParamPtr))
- (ecase (pref csParamPtr (:ROCsParam.csParam 0))
- (0 nil)
- (1 :one-shot)
- (2 :continuous))))
-
-
- (defmethod ROvd-alternate-pll-p ((vd RO-vd))
- ;returns t if alternate Phase Lock Loop components are in use
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9034 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-get-current-video-source ((vd RO-vd))
- ;returns which connector is the current video source (:composite / :s-video)
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9005 csParamPtr))
- (ecase (pref csParamPtr (:ROCsParam.csParam 1))
- (0 :composite)
- (1 :s-video))))
-
-
- (defmethod ROvd-get-available-video-sources ((vd RO-vd))
- ;returns a list of which connectors have active video source
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9005 csParamPtr))
- (ecase (pref csParamPtr (:ROCsParam.csParam 0))
- (0 nil)
- (1 '(:composite))
- (2 '(:s-video))
- (3 '(:composite :s-video)))))
-
-
- (defmethod ROvd-continuous-p ((vd RO-vd))
- ;returns t if continuous digitizing is on
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9025 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-get-video-destination-rect ((vd RO-vd))
- ;returns two values, the topLeft and botRight, of the digitized image Rect (view window coords)
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9029 csParamPtr))
- (values
- (ROvd-frame-to-local vd
- (pref csParamPtr (:ROCsParam.csParam 1))
- (pref csParamPtr (:ROCsParam.csParam 0)))
- (ROvd-frame-to-local vd
- (pref csParamPtr (:ROCsParam.csParam 3))
- (pref csParamPtr (:ROCsParam.csParam 2))))))
-
-
- (defmethod ROvd-flipped-horizontally-p ((vd RO-vd))
- ;returns t if pixels are being written in right-to-left order
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9017 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-flipped-vertically-p ((vd RO-vd))
- ;returns t if scan lines are being written in bottom-to-top order
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9018 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-genlocked-p ((vd RO-vd))
- ;returns t if an external source is being used to sync
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9004 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-get-hue ((vd RO-vd))
- ;returns the hue[0-63 for 364] or [0-255 for 24STV]
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9006 csParamPtr))
- (pref csParamPtr (:ROCsParam.csParam 0))))
-
-
- (defmethod ROvd-interlaced-p ((vd RO-vd))
- ;returns t if an interlaced video signal is being generated
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9003 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-get-max-source-rect ((vd RO-vd))
- ;returns two values, the topLeft and botRight, of the limit rectangle of source that can be digitized
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9028 csParamPtr))
- (values
- (make-point (pref csParamPtr (:ROCsParam.csParam 1))
- (pref csParamPtr (:ROCsParam.csParam 0)))
- (make-point (pref csParamPtr (:ROCsParam.csParam 3))
- (pref csParamPtr (:ROCsParam.csParam 2))))))
-
-
- (defmethod ROvd-get-NuBus-delay ((vd RO-vd))
- ;returns the current NuBus delay value
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9016 csParamPtr))
- (pref csParamPtr (:ROCsParam.csParam 0))))
-
-
- (defmethod ROvd-get-pan-position ((vd RO-vd))
- ;returns the pan position (a point) of the screen display
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9002 csParamPtr))
- (make-point (pref csParamPtr (:ROCsParam.csParam 0))
- (pref csParamPtr (:ROCsParam.csParam 1)))))
-
-
- (defmethod ROvd-reverse-fields-p ((vd RO-vd))
- ;returns t if the board is in reverse-field mode
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9035 csParamPtr))
- (= 1 (pref csParamPtr (:ROCsParam.csParam 0)))))
-
-
- (defmethod ROvd-get-saturation ((vd RO-vd))
- ;returns the saturation [0-63 for 364] or [0-255 for 24STV]
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9007 csParamPtr))
- (pref csParamPtr (:ROCsParam.csParam 0))))
-
-
- (defmethod ROvd-get-speed ((vd RO-vd))
- ;returns digitizing speed[:full(30 fps),:half(15 fps)]
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9024 csParamPtr))
- (ecase (pref csParamPtr (:ROCsParam.csParam 0))
- (0 :half)
- (1 :full))))
-
-
- (defmethod ROvd-get-video-source-rect ((vd RO-vd))
- ;returns two values, the topLeft and botRight, of the digitized image source rectangle
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9012 csParamPtr))
- (values
- (make-point (pref csParamPtr (:ROCsParam.csParam 1))
- (pref csParamPtr (:ROCsParam.csParam 0)))
- (make-point (pref csParamPtr (:ROCsParam.csParam 3))
- (pref csParamPtr (:ROCsParam.csParam 2))))))
-
-
- (defmethod ROvd-get-destination-size ((vd RO-vd))
- ;returns size of the digitized image as a point
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9012 csParamPtr))
- (make-point (pref csParamPtr (:ROCsParam.csParam 4))
- (pref csParamPtr (:ROCsParam.csParam 5)))))
-
-
- (defmethod ROvd-get-control-flag ((vd RO-vd))
- ;returns the control flag value
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9012 csParamPtr))
- (ecase (pref csParamPtr (:ROCsParam.csParam 6))
- (0 :both)
- (1 :odd)
- (2 :even)
- (4 :both-dls)
- (5 :odd-sls)
- (6 :even-sls))))
-
-
- (defmethod ROvd-get-zoom ((vd RO-vd))
- ;returns the zoom factor[1x,2x,4x,8x]
- (rlet ((csParamPtr :ROCsParam))
- (vd-nz-error-check vd (#~Status (drvr-refnum vd) 9001 csParamPtr))
- (pref csParamPtr (:ROCsParam.csParam 0))))
-