File: xv.l

package info (click to toggle)
euslisp 9.27%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 55,344 kB
  • sloc: ansic: 41,162; lisp: 3,339; makefile: 256; sh: 208; asm: 138; python: 53
file content (24 lines) | stat: -rw-r--r-- 778 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(defclass xvwindow :super sunview-frame
		   :slots (xvcanvas xvpanel mark))

(defmethod xvwindow 
 (:drawimage (img &optional wx wy (x 0)  (y 0))
    (send xvcanvas :drawimage img :x x :y y :width wx :height wy))
 (:init  (&key (parent nil) (title "xvwindow")
	       (x 0) (y 0) (size 200) (width size) (height size)
	  &allow-other-keys)
    (send-super :init parent :title title
		:x x  :y y  :width (+ width 4)  :height (+ 4 height))
    (setq xvcanvas (send self
    			 :create-subwindow sunview-canvas
			 :width width :height height))
    (send self :show t)
    self)
	)
 
(defun putimg (win img &aux subimg)
   (dotimes (i 256)
      (setq subimg  (subseq img (* i 256) (* (1+ i) 256)))
      (send win :drawimage subimg 256 1 0 i)
      (print i)  ; (read-char)
	))