Posted on 2024-02-27 10:10 lisp
last in the series of guru narrations by kalman reti on genera use. he rehashes a lot of subjects he previously covered, but the core of video is loading an image and then manipulating it through indirect arrays
https://www.youtube.com/watch?v=o4-YnLpLgtk
(si:login-to-sys-host) (setq fs::*remember-passwords* t) (defun kr-prompt (stream ignore) (prog1 (if *use-date-prompt* (format stream "~\\datime\\ ~A command: " neti:*local-host*) (format stream "Command: ")) (let ((window *terminal-io*)) (let* ((pos (setq *current-position* (cons window (multiple-value-list (send window :viewport-position))))) (lastpos *last-position*) (q-reg #\z)) (unless (equalp pos lastpos) (setf (gethash #\X cp::*POSITION-Q-REGS*)(gethash #\Y cp::*POSITION-Q-REGS*)) (setf (gethash #\Y cp::*POSITION-Q-REGS*) (gethash Q-REG cp::*POSITION-Q-REGS*)) (setf (gethash Q-REG cp::*POSITION-Q-REGS*) lastpos)) (setq *last-position* *current-position*))))) (defun gp () (terpri) (terpri) (scl::present (list 'a "B" 123) 'sys::expression) (terpri) (dw::with-output-as-presentation (:type 'string :object "circle") (graphics::with-room-for-graphics (nil 80) (graphics::draw-circle 40 40 20 :filled nil)))) (defvar part) (defun part () (let ((imd (scl::send (images::find-image-named :wallpaper-402118) :data-array))) (setq part (color::make-image 'color::32b-image :name "part" :width 200 :height 200 :daata-array (si:make-raster-array 200 200 :type 'si:art-fixnum :displaced-to imd :displaced-conformally t :displaced-index-offset (si:array-row-major-index imd 300 560)))))) (defun redline (&optional (pixel #x0000ff)) (loop with array = (scl::send (images::find-image-named "part") :data-array) for i below 200 do (setf (si:raster-aref array i i) pixel))) Help Commands looks like he's using libjpeg-turbo, but probably some older version for C compatibility? images:read-images-from-file-in-format→fcl::jpeg-image-from-file→read-jfif-to-image→read-jpeg→read-jpeg-stream→c-sys:execute→read_jfif_to_iman (doesn't exist elsewhere)→read_JPEG_file C-x e Set Trap On Exit Show Source Code foo Function-Refresh (doesn't work on his machine without fixing keyboard, not sure how to do on mine)
Post a comment