The Lambda Lab
/
projects
/
sixel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3bfe83
)
Address some flycheck suggestions.
author
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 21 May 2019 09:37:56 +0000
(11:37 +0200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Tue, 21 May 2019 09:37:56 +0000
(11:37 +0200)
sixel.el
patch
|
blob
|
history
diff --git
a/sixel.el
b/sixel.el
index
053739d
..
775bb58
100644
(file)
--- a/
sixel.el
+++ b/
sixel.el
@@
-5,7
+5,7
@@
;; Author: Tim Vaughan <tgvaughan@gmail.com>
;; Created: 19 May 2019
;; Version: 1.0.0
;; Author: Tim Vaughan <tgvaughan@gmail.com>
;; Created: 19 May 2019
;; Version: 1.0.0
-;; Keywords:
+;; Keywords:
;; Homepage: https://github.com/tgvaughan/sixel
;; Package-Requires: ((emacs "25"))
;; Homepage: https://github.com/tgvaughan/sixel
;; Package-Requires: ((emacs "25"))
@@
-115,23
+115,22
@@
Returns a sixel image object."
sixel-image)
(defun sixel-image-colour-map (sixel-image)
sixel-image)
(defun sixel-image-colour-map (sixel-image)
- "Extract colour map from SIXEL-
DATA
."
+ "Extract colour map from SIXEL-
IMAGE
."
(car sixel-image))
(defun sixel-image-sixels (sixel-image)
(car sixel-image))
(defun sixel-image-sixels (sixel-image)
- "Extract sixels from SIXEL-
DATA
."
+ "Extract sixels from SIXEL-
IMAGE
."
(cdr sixel-image))
(defun sixel-image-dims (sixel-image)
(cdr sixel-image))
(defun sixel-image-dims (sixel-image)
- "Compute
s image width from SIXEL-DATA. Returns
pair (width . height)."
+ "Compute
image width from SIXEL-IMAGE. Return
pair (width . height)."
(let ((sixels (sixel-image-sixels sixel-image)))
(cons
(apply #'max (mapcar (lambda (row) (length row)) sixels))
(* 6 (length sixels)))))
(defun sixel-image-to-xpm-values (sixel-image)
(let ((sixels (sixel-image-sixels sixel-image)))
(cons
(apply #'max (mapcar (lambda (row) (length row)) sixels))
(* 6 (length sixels)))))
(defun sixel-image-to-xpm-values (sixel-image)
- "Produce string representing parameter values component of XPM
-representation of SIXEL-IMAGE."
+ "Produce parameter values component of XPM representation of SIXEL-IMAGE."
(let* ((dims (sixel-image-dims sixel-image))
(colour-map (sixel-image-colour-map sixel-image))
(n-colours (1+ (length colour-map))))
(let* ((dims (sixel-image-dims sixel-image))
(colour-map (sixel-image-colour-map sixel-image))
(n-colours (1+ (length colour-map))))
@@
-141,8
+140,7
@@
representation of SIXEL-IMAGE."
(number-to-string n-colours) " 2\"")))
(defun sixel-image-to-xpm-colours (sixel-image)
(number-to-string n-colours) " 2\"")))
(defun sixel-image-to-xpm-colours (sixel-image)
- "Produce string representing colour definitions component of XPM
-representation of SIXEL-IMAGE."
+ "Produce colour definitions component of XPM representation of SIXEL-IMAGE."
(let ((colour-map (sixel-image-colour-map sixel-image)))
(concat
(string-join
(let ((colour-map (sixel-image-colour-map sixel-image)))
(concat
(string-join
@@
-162,8
+160,7
@@
representation of SIXEL-IMAGE."
"\"-- c #000000\"")))
(defun sixel-image-to-xpm-pixels (sixel-image)
"\"-- c #000000\"")))
(defun sixel-image-to-xpm-pixels (sixel-image)
- "Produce string representating pixels component of XPM representation
-of SIXEL-IMAGE."
+ "Produce pixels component of XPM representation of SIXEL-IMAGE."
(concat
"\""
(string-join
(concat
"\""
(string-join
@@
-184,7
+181,7
@@
of SIXEL-IMAGE."
"\""))
(defun sixel-to-xpm (string)
"\""))
(defun sixel-to-xpm (string)
- "Return
s
an XPM image representation of the SIXEL graphic encoded in STRING."
+ "Return an XPM image representation of the SIXEL graphic encoded in STRING."
(let* ((param-string (sixel-get-params string))
(data-string (sixel-get-data string))
(sixel-image (sixel-pad-rows (sixel-process-data data-string))))
(let* ((param-string (sixel-get-params string))
(data-string (sixel-get-data string))
(sixel-image (sixel-pad-rows (sixel-process-data data-string))))
@@
-195,6
+192,6
@@
of SIXEL-IMAGE."
(sixel-image-to-xpm-values sixel-image) ",\n"
(sixel-image-to-xpm-colours sixel-image) ",\n"
(sixel-image-to-xpm-pixels sixel-image) "};")
(sixel-image-to-xpm-values sixel-image) ",\n"
(sixel-image-to-xpm-colours sixel-image) ",\n"
(sixel-image-to-xpm-pixels sixel-image) "};")
- (error "Incorrecly formatted sixel string
.
"))))
+ (error "Incorrecly formatted sixel string"))))
-;; sixel.el ends here
+;;
;
sixel.el ends here