Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More case tweaks.

  • Loading branch information...
commit 4669eb4e7e6d30345062abc5bf1292d54aff9929 1 parent 3bf6fb8
mon-key authored
8 tiff4cl-floats.lisp
View
@@ -95,11 +95,11 @@
significand-length)))))))
-(make-encoder encode-IEEE-float 8 23)
-(make-decoder decode-IEEE-float 8 23)
+(make-encoder encode-ieee-float 8 23)
+(make-decoder decode-ieee-float 8 23)
-(make-encoder encode-IEEE-double 11 52)
-(make-decoder decode-IEEE-double 11 52)
+(make-encoder encode-ieee-double 11 52)
+(make-decoder decode-ieee-double 11 52)
(make-encoder encode-IEEE-quad 15 112)
(make-decoder decode-IEEE-quad 15 112)
46 tiff4cl-specials.lisp
View
@@ -62,7 +62,7 @@ of: a numeric id, a keyword id, and a length in bytes.")
(259 :compression ;; data compression technique
((1 nil) ;; no compression
- (2 :CCITT-1d) ;; CCITT modified Huffman RLE
+ (2 :ccitt-1d) ;; CCITT modified Huffman RLE
(3 :fax-group3) ;; CCITT Group 3 fax encoding / CCITT T.4 (TIFF 6 name)
(4 :fax-group4) ;; CCITT Group 4 fax encoding / CCITT T.6 (TIFF 6 name)
(5 :lzw) ;; Lempel-Ziv & Welch
@@ -75,20 +75,20 @@ of: a numeric id, a keyword id, and a length in bytes.")
(32809 :thunderscan) ;; ThunderScan RLE
(32773 :pack-bits) ;; Macintosh RLE
;;
- (32895 :it8ctpad) ;; IT8 CT w/padding
- (32896 :it8lw) ;; IT8 Linework RLE
- (32897 :it8mp) ;; IT8 Monochrome picture
- (32898 :it8bl) ;; IT8 Binary line art
+ (32895 :it8-ct-pad) ;; IT8 CT w/padding
+ (32896 :it8-linework-rle) ;; IT8 Linework RLE
+ (32897 :it8-monochrome) ;; IT8 Monochrome picture
+ (32898 :it8-binary-line-art) ;; IT8 Binary line art
;;
(32908 :PIXARFILM) ;; Pixar companded 10bit LZW
(32909 :PIXARLOG) ;; Pixar companded 11bit ZIP
(32946 :DEFLATE) ;; Deflate compression
- (32947 :DCS) ;; Kodak DCS encoding
- (34661 :JBIG) ;; ISO JBIG
- (34676 :SGI-LOG) ;; SGI Log Luminance RLE
- (34677 :SGI-LOG24) ;; SGI Log 24-bit packed
- (34712 :JP2000))) ;; Leadtools JPEG2000
+ (32947 :dcs) ;; Kodak DCS encoding
+ (34661 :jbig) ;; ISO JBIG
+ (34676 :sgi-log) ;; SGI Log Luminance RLE
+ (34677 :sgi-log24) ;; SGI Log 24-bit packed
+ (34712 :jp2000))) ;; Leadtools JPEG2000
(262 :photometric-interpretation
((0 :white-is-zero)
@@ -175,7 +175,7 @@ of: a numeric id, a keyword id, and a length in bytes.")
(297 :page-number) ;; page numbers of multi-page :NOTE this is returned as an array.
- (300 :COLOR-RESPONSE-UNIT ;; color curve accuracy per unit
+ (300 :color-response-unit ;; color curve accuracy per unit
((1 :tenths)
(2 :hundredths)
(3 :thousandths)
@@ -248,14 +248,14 @@ of: a numeric id, a keyword id, and a length in bytes.")
((1 :baseline) ;; !baseline sequential
(14 :lossless))) ;; !Huffman coded lossless
- (513 :JPEG-interchange-format)
- (514 :JPEG-interchange-format-length)
- (515 :JPEG-restart-interval)
- (517 :JPEG-lossless-predictors)
- (518 :JPEG-point-transforms)
- (519 :JPEG-q-tables)
- (520 :JPEG-dc-tables)
- (521 :JPEG-ac-tables)
+ (513 :jpeg-interchange-format)
+ (514 :jpeg-interchange-format-length)
+ (515 :jpeg-restart-interval)
+ (517 :jpeg-lossless-predictors)
+ (518 :jpeg-point-transforms)
+ (519 :jpeg-q-tables)
+ (520 :jpeg-dc-tables)
+ (521 :jpeg-ac-tables)
(529 :y-cb-cr-coefficients)
(530 :y-cb-cr-sub-sampling)
(531 :y-cb-cr-positioning
@@ -336,7 +336,7 @@ of: a numeric id, a keyword id, and a length in bytes.")
(34929 :fedex-edr) ;; tag 34929 is a private tag registered to FedEx with unknown use
(37724 :image-source-data) ;; Photoshop extension
- (50341 :print-IM) ;; Exif extension
+ (50341 :print-im) ;; Exif extension
;; Adobe Digital Negative (DNG) format tags
(50706 :dng-version) ;; dNG version number
@@ -392,7 +392,7 @@ of: a numeric id, a keyword id, and a length in bytes.")
;; tags 34665, 34853 and 40965 are documented in EXIF specification
(34665 :exif-ifd) ;; `interpret-tag-value' Exif extension
(33434 :exposure-time)
- (33437 :F-number)
+ (33437 :f-number)
(34850 :exposure-program
((0 nil)
(1 :manual)
@@ -407,8 +407,8 @@ of: a numeric id, a keyword id, and a length in bytes.")
(34853 :gps-ifd) ;; `interpret-tag-value' Exif extension
- (34855 :ISO-speed-ratings)
- (34856 :OECF) ;; Optoelectric conversion factor
+ (34855 :iso-speed-ratings)
+ (34856 :oecf) ;; Optoelectric conversion factor
(36864 :exif-version)
(36867 :date-time-original) ;; Date and time of original data generation
(36868 :date-time-digitized) ;; Date and time of digital data generation
60 tiff4cl-tiff.lisp
View
@@ -42,11 +42,11 @@
(defgeneric decode-integer (tiff buffer &key start end))
-(defmethod decode-integer ((tiff TIFF-little-endian-stream) buffer &key (start 0) end)
+(defmethod decode-integer ((tiff tiff-little-endian-stream) buffer &key (start 0) end)
(decode-integer-le buffer
:start start
:end end))
-(defmethod decode-integer ((tiff TIFF-big-endian-stream) buffer &key (start 0) end)
+(defmethod decode-integer ((tiff tiff-big-endian-stream) buffer &key (start 0) end)
(decode-integer-be buffer
:start start
:end end))
@@ -182,12 +182,12 @@
(+ (* pos item-size) (/ item-size 2))
(* (1+ pos) item-size)))))
(:float
- (ieee-754:decode-ieee-float
+ (decode-ieee-float ;; ieee-754:decode-ieee-float
(parse-int buffer
(* pos item-size)
(* (1+ pos) item-size))))
(:double
- (ieee-754:decode-ieee-double
+ (decode-ieee-double ;; ieee-754:decode-ieee-double
(parse-int buffer
(* pos item-size)
(* (1+ pos) item-size))))))
@@ -263,7 +263,7 @@
(read-32bit tiff))
(defun read-tag-data (tiff)
- (read-bytes (TIFF-stream tiff) 4))
+ (read-bytes (tiff-stream tiff) 4))
(defun parse-tag (tiff)
(let* ((id (read-tag-id tiff))
@@ -272,73 +272,73 @@
(data (read-tag-data tiff)))
(list id type n data)))
-(defun parse-IFD (tiff &optional position)
+(defun parse-ifd (tiff &optional position)
(when position
- (TIFF-position tiff position))
+ (tiff-position tiff position))
;; First read the tags data and then create the objects, because
;; get-tag-value can seek through the file to fetch the data values,
;; thus disrupting the sequential read we do here.
(let* ((tags (loop
- for i from 0 below (read-IFD-tags-number tiff)
+ for i from 0 below (read-ifd-tags-number tiff)
collect (parse-tag tiff)))
- (next-ifd (read-IFD-pointer tiff))
+ (next-ifd (read-ifd-pointer tiff))
(tag-objects (mapcar #'(lambda (tag)
(destructuring-bind (id type count data) tag
(let ((value (get-tag-value tiff type count data)))
- (make-instance 'TIFF-tag
+ (make-instance 'tiff-tag
:id id
:type type
:value (interpret-tag-value tiff id value)))))
tags)))
(make-instance 'TIFF-IFD :tags tag-objects :next next-ifd)))
-(defun parse-TIFF-stream (stream &optional end)
+(defun parse-tiff-stream (stream &optional end)
(let* ((start (file-position stream))
(endianness (parse-endianness stream))
(tiff (make-instance (if (eq endianness :little-endian)
- 'TIFF-little-endian-stream
- 'TIFF-big-endian-stream)
+ 'tiff-little-endian-stream
+ 'tiff-big-endian-stream)
:start start
:end end
:stream stream))
(version (parse-file-format-version tiff)))
- (unless (= version +TIFF-version+)
+ (unless (= version +tiff-version+)
(error 'wrong-version :version version))
(let ((ifds '())
- (address (read-IFD-pointer tiff)))
+ (address (read-ifd-pointer tiff)))
(loop
(when (zerop address)
(return))
- (let ((ifd (parse-IFD tiff address)))
+ (let ((ifd (parse-ifd tiff address)))
(push ifd ifds)
(setf address (ifd-next ifd))))
ifds)))
-(defun parse-TIFF (file &key start end)
+(defun parse-tiff (file &key start end)
(if (streamp file)
(progn
(when start
(file-position file start))
- (parse-TIFF-stream file end))
+ (parse-tiff-stream file end))
(with-open-file (stream file)
(when start
(file-position stream start))
- (parse-TIFF-stream stream end))))
+ (parse-tiff-stream stream end))))
-(defun map-IFD-tags (function ifd)
+(defun map-ifd-tags (function ifd)
(dolist (tag (ifd-tags ifd))
(let ((value (tag-value tag)))
(if (typep value 'tiff-ifd)
- (map-IFD-tags function value)
+ (map-ifd-tags function value)
(funcall function tag)))))
-(defun map-TIFF-tags (function ifds)
+(defun map-tiff-tags (function ifds)
(dolist (ifd ifds)
- (map-IFD-tags function ifd)))
+ (map-ifd-tags function ifd)))
-(defun TIFF-extract-tags (ifds tag-ids)
+(defun tiff-extract-tags (ifds tag-ids)
(let ((result '()))
- (map-TIFF-tags #'(lambda (tag)
+ (map-tiff-tags #'(lambda (tag)
(when (or (eq tag-ids t)
(find (tag-id tag) tag-ids))
(push (cons (tag-id tag) (tag-value tag))
@@ -346,17 +346,17 @@
ifds)
result))
-(defun print-TIFF-tags (ifds &optional stream)
+(defun print-tiff-tags (ifds &optional stream)
(unless stream
(setf stream *standard-output*))
- (labels ((print-IFD (ifd indent)
+ (labels ((print-ifd (ifd indent)
(loop
for tag in (ifd-tags ifd)
for value = (tag-value tag)
- if (typep value 'TIFF-IFD)
+ if (typep value 'tiff-ifd)
do
(format stream "~vT~A:~%" indent (tag-id tag))
- (print-IFD value (+ 2 indent))
+ (print-ifd value (+ 2 indent))
else do
(format stream "~vT~A = ~S~%" indent (tag-id tag) value))))
(loop
@@ -364,7 +364,7 @@
for i from 0
do
(format stream "~&IFD ~A:~%" i)
- (print-IFD ifd 2))))
+ (print-ifd ifd 2))))
;;; ==============================
;;; EOF
2  tiff4cl-util.lisp
View
@@ -43,7 +43,7 @@
(defun read-16bit-be (stream)
(decode-integer-be (read-bytes stream 2)))
-(defun read-16bit-LE (stream)
+(defun read-16bit-le (stream)
(decode-integer-le (read-bytes stream 2)))
(defun read-32bit-be (stream)
Please sign in to comment.
Something went wrong with that request. Please try again.