;用上一个保留函数 syz-read-list
;改成这样后是7.784秒,改前是10.3秒
(defun c:tt (/ pt r x lst x1 x2 r g b c lc strc )
(setq f (open "c:/00/tt.txt" "R"))
(setq f1 (open "c:/00/tt6.txt" "w"))
(setq list1 nil)
(while (setq s (read-line f))
(setq k (read s))
(setq
r (caddr k)
g (cadddr k)
b (car (cddddr k))
c (lm:rgb->true r g b)
)
(setq list1 (cons c list1 ))
)
(setq list1 (reverse list1))
(setq strc (vl-prin1-to-string list1))
(write-line strc f1)
(close f1)
(close f)
(setq f (open "c:/00/tt6.txt" "R"))
(setq t0 (getvar "TDUSRTIMER"))
(load "c:/00/syz-read-list.fas")
(setq lc (syz-read-list f))
(setq x 0 y 0)
(while (True ( r g b )
(+
(lsh r 16)
(lsh g 8)
b
)
)
;(vlisp-compile 'st "c:/00/tt.lsp")
;改成一张大表,节省了读文件时间,总的反而慢了
;改成这样后是8.386秒,改前是10.3秒
(defun c:tt (/ pt r x lst x1 x2 r g b c lc strc )
(setq f (open "c:/00/tt.txt" "R"))
(setq f1 (open "c:/00/tt6.txt" "w"))
(setq list1 nil)
(while (setq s (read-line f))
(setq k (read s))
(setq
r (caddr k)
g (cadddr k)
b (car (cddddr k))
c (lm:rgb->true r g b)
)
(setq list1 (cons c list1 ))
)
(setq list1 (reverse list1))
(setq strc (vl-prin1-to-string list1))
(write-line strc f1)
(close f1)
(close f)
(setq f (open "c:/00/tt6.txt" "R"))
(setq t0 (getvar "TDUSRTIMER"))
(setq s (read-line f))
(setq lc (read s))
(setq x 0 y 0)
(while (True ( r g b )
(+
(lsh r 16)
(lsh g 8)
b
)
)
;(vlisp-compile 'st "c:/00/tt.lsp") tt6.lsp
;先处理一下像素数据文件,省去计算过程
;改成这样后是8.157秒,改前是10.3秒
(defun c:tt (/ pt r x lst x1 x2 r g b c lc strc )
(setq f (open "c:/00/tt.txt" "R"))
(setq f1 (open "c:/00/tt4.txt" "w"))
(while (setq s (read-line f))
(setq k (read s))
(setq
r (caddr k)
g (cadddr k)
b (car (cddddr k))
c (lm:rgb->true r g b)
)
(setq strc (vl-prin1-to-string c))
(write-line strc f1)
)
(close f1)
(close f)
(setq f (open "c:/00/tt4.txt" "R"))
(setq t0 (getvar "TDUSRTIMER"))
(setq x 0 y 0)
(while (True ( r g b )
(+
(lsh r 16)
(lsh g 8)
b
)
)
;(vlisp-compile 'st "c:/00/tt.lsp")