This is the png Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:16:31 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
png
Read and write PNG (Portable Network Graphics) files.
cffi-grovel
(system).
cffi
(system).
png-package.lisp
(file).
compat.lisp
(file).
libpng.lisp
(file).
grovel.lisp
(file).
wrappers.lisp
(file).
image.lisp
(file).
bmp.lisp
(file).
pnm.lisp
(file).
ops.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
png/png.asd
png/png-package.lisp
png/compat.lisp
png/libpng.lisp
png/grovel.lisp
png/wrappers.lisp
png/image.lisp
png/bmp.lisp
png/pnm.lisp
png/ops.lisp
png/png-package.lisp
image.lisp
(file).
png
(system).
png
.
png/compat.lisp
png-package.lisp
(file).
png
(system).
array-storage-vector
(function).
with-pointer-to-array-data
(macro).
png/libpng.lisp
grovel.lisp
(file).
compat.lisp
(file).
png-package.lisp
(file).
wrappers.lisp
(file).
png
(system).
decode
(function).
decode-file
(function).
encode
(function).
encode-file
(function).
*buffer*
(special variable).
*stream*
(special variable).
+png-libpng-ver-string+
(special variable).
bytes-per-pixel
(function).
ensure-buffer-sufficient
(function).
get-ihdr
(function).
grayp
(function).
memcpy
(function).
png-access-version-number
(function).
png-create-info-struct
(function).
png-create-read-struct
(function).
png-create-write-struct
(function).
png-destroy-info-struct
(function).
png-destroy-read-struct
(function).
png-destroy-write-struct
(function).
png-get-ihdr
(function).
png-get-io-ptr
(function).
png-get-rows
(function).
png-get-valid
(function).
png-init-io
(function).
png-read-image
(function).
png-read-info
(function).
png-read-png
(function).
png-set-bgr
(function).
png-set-expand
(function).
png-set-expand-gray-1-2-4-to-8
(function).
png-set-ihdr
(function).
png-set-palette-to-rgb
(function).
png-set-read-fn
(function).
png-set-rows
(function).
png-set-strip-16
(function).
png-set-strip-alpha
(function).
png-set-swap
(function).
png-set-trns-to-alpha
(function).
png-set-write-fn
(function).
png-write-png
(function).
with-png-info-struct
(macro).
with-png-struct
(macro).
with-row-pointers
(macro).
png/image.lisp
png
(system).
16-bit-image
(function).
16-bit-image
(type).
8-bit-image
(function).
8-bit-image
(type).
copy-image
(function).
grayscale-alpha-image
(function).
grayscale-alpha-image
(type).
grayscale-image
(function).
grayscale-image
(type).
image
(type).
image-alpha
(function).
image-bit-depth
(function).
image-channels
(function).
image-height
(function).
image-width
(function).
make-image
(function).
opaque-image
(type).
rgb-alpha-image
(function).
rgb-alpha-image
(type).
rgb-image
(function).
rgb-image
(type).
transparent-image
(type).
color-and-alpha-channels-p
(function).
color-channels-p
(function).
even-channels-p
(function).
grayscale-alpha-channels-p
(function).
grayscale-channels-p
(function).
make-shareable-array
(function).
png/bmp.lisp
image.lisp
(file).
png
(system).
bmp
.
decode-file
(function).
encode-file
(function).
read-u2le
(function).
read-u4le
(function).
unhandled-bitcount
(condition).
unhandled-bitcount-bitcount
(reader method).
unhandled-compression
(condition).
unhandled-compression-mode
(reader method).
write-u2le
(function).
write-u4le
(function).
png/pnm.lisp
image.lisp
(file).
png
(system).
pnm
.
read-magic-number
(function).
read-pbm
(function).
read-pgm-16
(function).
read-pgm-8
(function).
read-pnm-header
(function).
read-positive-integer
(function).
read-ppm-16
(function).
read-ppm-8
(function).
read-whitespace
(function).
read-whitespace-character
(function).
whitespace-char-p
(function).
write-pnm-data
(function).
write-pnm-data-1
(function).
write-pnm-data-16
(function).
write-pnm-data-8
(function).
write-pnm-header
(function).
png/ops.lisp
image.lisp
(file).
png
(system).
add
(function).
add*
(function).
binary-morphological-filter
(function).
channel-max
(function).
channel-min
(function).
close-filter
(function).
convolve
(function).
dilation-filter
(function).
dims
(function).
erosion-filter
(function).
fillv
(function).
flip
(function).
intensity-max
(function).
majority-filter
(function).
make-image-like
(function).
mirror
(function).
mismatched-image-dims
(condition).
mismatched-image-sizes
(reader method).
mismatched-image-sizes
(condition).
mismatched-image-types
(condition).
move-towards
(function).
norm2
(function).
open-filter
(function).
rotate
(function).
size
(function).
subtract
(function).
subtract*
(function).
threshold-filter
(function).
binary-morph-kernel
(function).
color-channels
(function).
generate-mask
(function).
max-color-index
(function).
mismatched-image-dims-dims
(reader method).
mismatched-image-types-types
(reader method).
pixel-type
(function).
view-mask
(function).
Packages are listed by definition order.
image
Image representation and manipulation.
common-lisp
.
16-bit-image
(function).
16-bit-image
(type).
8-bit-image
(function).
8-bit-image
(type).
add
(function).
add*
(function).
binary-morphological-filter
(function).
channel-max
(function).
channel-min
(function).
close-filter
(function).
convolve
(function).
copy-image
(function).
dilation-filter
(function).
dims
(function).
erosion-filter
(function).
fillv
(function).
flip
(function).
grayscale-alpha-image
(function).
grayscale-alpha-image
(type).
grayscale-image
(function).
grayscale-image
(type).
image
(type).
image-alpha
(function).
image-bit-depth
(function).
image-channels
(function).
image-height
(function).
image-width
(function).
intensity-max
(function).
majority-filter
(function).
make-image
(function).
make-image-like
(function).
mirror
(function).
mismatched-image-dims
(condition).
mismatched-image-sizes
(generic reader).
mismatched-image-sizes
(condition).
mismatched-image-types
(condition).
move-towards
(function).
norm2
(function).
opaque-image
(type).
open-filter
(function).
rgb-alpha-image
(function).
rgb-alpha-image
(type).
rgb-image
(function).
rgb-image
(type).
rotate
(function).
size
(function).
subtract
(function).
subtract*
(function).
threshold-filter
(function).
transparent-image
(type).
binary-morph-kernel
(function).
color-and-alpha-channels-p
(function).
color-channels
(function).
color-channels-p
(function).
even-channels-p
(function).
generate-mask
(function).
grayscale-alpha-channels-p
(function).
grayscale-channels-p
(function).
make-shareable-array
(function).
max-color-index
(function).
mismatched-image-dims-dims
(generic reader).
mismatched-image-types-types
(generic reader).
pixel-type
(function).
view-mask
(function).
png
Read and write PNG (Portable Network Graphics) files.
cffi
.
common-lisp
.
image
.
decode
(function).
decode-file
(function).
encode
(function).
encode-file
(function).
*buffer*
(special variable).
*stream*
(special variable).
+png-libpng-ver-string+
(special variable).
array-storage-vector
(function).
bytes-per-pixel
(function).
ensure-buffer-sufficient
(function).
get-ihdr
(function).
grayp
(function).
memcpy
(function).
png-access-version-number
(function).
png-create-info-struct
(function).
png-create-read-struct
(function).
png-create-write-struct
(function).
png-destroy-info-struct
(function).
png-destroy-read-struct
(function).
png-destroy-write-struct
(function).
png-get-ihdr
(function).
png-get-io-ptr
(function).
png-get-rows
(function).
png-get-valid
(function).
png-init-io
(function).
png-read-image
(function).
png-read-info
(function).
png-read-png
(function).
png-set-bgr
(function).
png-set-expand
(function).
png-set-expand-gray-1-2-4-to-8
(function).
png-set-ihdr
(function).
png-set-palette-to-rgb
(function).
png-set-read-fn
(function).
png-set-rows
(function).
png-set-strip-16
(function).
png-set-strip-alpha
(function).
png-set-swap
(function).
png-set-trns-to-alpha
(function).
png-set-write-fn
(function).
png-write-png
(function).
with-png-info-struct
(macro).
with-png-struct
(macro).
with-pointer-to-array-data
(macro).
with-row-pointers
(macro).
bmp
common-lisp
.
image
.
decode-file
(function).
encode-file
(function).
read-u2le
(function).
read-u4le
(function).
unhandled-bitcount
(condition).
unhandled-bitcount-bitcount
(generic reader).
unhandled-compression
(condition).
unhandled-compression-mode
(generic reader).
write-u2le
(function).
write-u4le
(function).
pnm
common-lisp
.
image
.
read-magic-number
(function).
read-pbm
(function).
read-pgm-16
(function).
read-pgm-8
(function).
read-pnm-header
(function).
read-positive-integer
(function).
read-ppm-16
(function).
read-ppm-8
(function).
read-whitespace
(function).
read-whitespace-character
(function).
whitespace-char-p
(function).
write-pnm-data
(function).
write-pnm-data-1
(function).
write-pnm-data-16
(function).
write-pnm-data-8
(function).
write-pnm-header
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
If IMAGE is a 16-BIT-IMAGE, return it or a copy of it. If IMAGE is an 8-BIT-IMAGE, return a 16-BIT-IMAGE that has the same width, height, and number of channels as IMAGE, but where each element is the corresponding element in image multiplied by 257. The effect of this multiplication is to stretch the dynamic range of the image to utilize the increased bit depth.
If IMAGE is an 8-BIT-IMAGE, return it or a copy of it. If IMAGE is a 16-BIT-IMAGE, return an 8-BIT-IMAGE that has the same width, height, and number of channels as image, but where each element is the corresponding element in image divided by 257 and rounded to the nearest integer. The effect of this division is to compress the dynamic range of the image so as to fit within the smaller bit depth.
Adds image IM2 from image IM1 and returns the resulting image sum
without modifying either IM1 or IM2. Both images must be the same type
and size.
Clips to maximum intensity in each channel if exceeded.
Destructively adds image IM2 from image IM1, leaving the resulting image sum in im1. Both images must be the same type and size. Clips to maximum intensity in each channel if exceeded
Returns a binary-valued GRAYSCALE-IMAGE the same dimensions as IMAGE whose corresponding elements have been calculated using a binary morphological filter. The filter kernel centers a MASK on each pixel in IMAGE and looks at all the pixels in IMAGE which line up with those set in the MASK. OPERATION=:or sets the filtered pixel if any of these is set; :and sets the filtered pixel only if all of these are set; and :maj sets the filtered pixel if a majority of them are set. A border region can’t be reached by the center of the mask while keeping the mask within IMAGE. New pixels in the border region are filled with FILL.
Finds the max values over all the pixel channels (separately) in the image.
Finds the min values over all the pixel channels (separately) in the image.
Returns a binary GRAYSCALE-IMAGE produced by a cascade of a
dilation filter followed by an erosion filter, both using the same
mask. See those filters for descriptions of their properties.
The distinctive property of the cascade is size preservation of large scale features.
Returns a new image of type IMAGE produced by convolving KERNEL
with IMAGE. This is not a circular convolution and no values are
computed in the border region where the kernel is not completely
contained in IMAGE.
FILL controls the output image size: if set, it returns an image the
same size as IMAGE, if NIL, it returns an image which is shrunk to
exclude the uncomputed border region (the dimensions of KERNEL-1).
KERNEL must be a 2-d square mask with odd dimensions (e.g. 3x3), a
simple-array of type FLOAT. IMAGE can be GRAYSCALE-IMAGE or an
RGB-IMAGE - in the latter case the channels are convolved with the
KERNEL seperately.
If FILL is set, it must consist of a list of values of the same type as the pixels of IMAGE. For example, an rgb-image with 8-bit pixels might have a fill of ’(#x7f #x7f #x7f), whereas a grayscale-image would have a fill of ’(#x7f). If FILL is not set the image will shrink.
Creates a copy of IMAGE. The elements of the new image are the same as the corresponding elements of IMAGE, and the new image has the same height, width, number of channels, and bit depth as IMAGE.
Reads an image in PNG format from input and returns an array of
type IMAGE. If the bit depth of the PNG file is less than or equal to
8, an 8-BIT-IMAGE will be returned; otherwise, a 16-BIT-IMAGE will be
returned.
Applications that would like to receive images of consistent bit
depth (rather than 8 or 16 depending on the PNG file) can apply the
function 8-BIT-IMAGE or the function 16-BIT-IMAGE to the result of
DECODE.
Bit depths less than 8 will be converted to 8 bits when read, and bit
depths between 8 and 16 bits will be converted to 16 bits. As an
example, 2-bit PNG files contain only the pixel values 0, 1, 2, and 3.
These will be converted to 0, 85, 170, and 255, respectively, in order
to fill the dynamic range of the 8-bit image that is returned.
Swaps blue and red if SWAPBGR set.
Strips alpha channel unless PRESERVE-ALPHA is set.
Signals an error if reading the image fails.
png
.
Reads an image in BMP format from input and returns an array of
type IMAGE. The bit depth of the returned IMAGE will be either 8 or
16.
Setting FLIP will flip the image vertically.
Setting STRIP-ALPHA will strip an alpha channel, if present.
Setting BGR will leave the channels ordered as read from the BMP
stream. That is, in BGR or BGRA order, rather than swapping them to
RGB or RGBA order normal to IMAGE).
The current version will decode 24-bit RGB and 32-bit ARGB BMP
streams. Compressed formats are not currently supported and will
signal an error.
Signals an error if reading the image fails.
Returns a binary GRAYSCALE-IMAGE produced by a morphological filter
with an OR operation on the given mask kernel.
The mask may be either specified by PATTERN or provided by MASK, a
2-d array of (unsigned-byte 8) values set to 0 or 1.
The format of PATTERN is ’(:square 3) ’(:cross 4), where the 2*size+1 gives the total width and height of the mask.
The dimensions (height x width x channels) of an image as a list
Writes IMAGE in PNG format to OUTPUT. The current version always
writes an 8-bit PNG file if image is an 8-BIT-IMAGE and a 16-bit PNG
file if image is an 16-BIT-IMAGE. Future versions may write PNG files
of lower bit depths than IMAGE when the least significant bits may be
trimmed without loss of precision.
Signals an error if writing the image fails.
png
.
Writes IMAGE in BMP format to OUTPUT.
Flips image vertically if FLIP set. XPPI and YPPI specify pixels per
inch Strips alpha channel if STRIP-ALPHA is set (and there is one) - in
other words, encodes ARGB as RGB.
The current version only encodes RGB and ARGB BMP files (24 and 32 bit
pixels, respectively). Paletted versions signal an error.
Signals an error if writing the image fails.
Returns a binary GRAYSCALE-IMAGE produced by a morphological filter
with an AND operation on the mask kernel.
The mask may be either specified by PATTERN or provided by MASK, a
2-d array of (unsigned-byte 8) values set to 0 or 1.
The format of PATTERN is ’(:square 3) ’(:cross 4), where the 2*size+1 gives the total width and height of the mask.
Fills entire image with constant value. Value must be a list with
the same number of elements as IM has channels.
Returns IM.
Returns a new image which is flipped vertically from the old image
If IMAGE is a GRAYSCALE-ALPHA-IMAGE, return it, otherwise return a
GRAYSCALE-ALPHA-IMAGE of the same width and height whose corresponding
elements are the average of the channel intensities of IMAGE.
Add an alpha channel if needed.
If IMAGE is a GRAYSCALE-IMAGE, return it, otherwise return a GRAYSCALE-IMAGE of the same width and height whose corresponding elements are the average of the channel intensities of IMAGE. Strip out any alpha channel present.
Returns T if there is an alpha channel, NIL otherwise.
Returns the bit-depth of the image, i.e., the number of bits in the byte representing each sample. The bit depth is 8 or 16, depending on whether the image is an 8-bit-image or a 16-bit-image, respectively.
The number of channels in IMAGE. Grayscale images have one channel, whereas RGB images have three.
The height of image, i.e., the number of rows.
The width of IMAGE, i.e., the number of columns.
Finds the max intensities over all the pixels (sum of all the channels) in the image.
Returns a binary GRAYSCALE-IMAGE produced by a morphological filter
with an MAJ operation on the given mask kernel (majority).
The mask may be either specified by PATTERN or provided by MASK, a
2-d array of (unsigned-byte 8) values set to 0 or 1.
The format of PATTERN is ’(:square 3) ’(:cross 4), where the 2*size+1 gives the total width and height of the mask.
Make a new IMAGE of the specified height, width, and number of channels. The image will be an 8-bit-image or a 16-bit-image depending on the value of byte-size. Makes an 8-BIT-IMAGE if BIT-DEPTH is 8 or NIL and a 16-BIT-IMAGE if BIT-DEPTH is 16. The contents of the image are undefined.
Makes an image the same size and bit-depth as IM.
Returns a new image which is mirrored horizontally from the old image
Moves the pixels values of binary GRAYSCALE-IMAGE IM1 towards IM2 by at most STEP. IM1 is altered, IM2 is not. Step can be 0-255 for 8-bit depths and 0-65535 for 16-bit depths.
Calculates the sum of the squared intensities of all the pixels in the image.
Returns a binary GRAYSCALE-IMAGE produced by a cascade of an
erosion filter followed by a dilation filter, both using the same
mask. See those filters for descriptions of their properties.
The distinctive property of the cascade is size preservation of large scale features.
If IMAGE is a RGB-ALPHA-IMAGE, return it, otherwise return a RGB-ALPHA-IMAGE of the same width and height whose corresponding elements are the rgb elements of the original if the original is an RGB-IMAGE and the repeated grayscale values if the original is a GRAYSCALE image. Add an alpha channel if needed.
If IMAGE is an RGB-IMAGE, return it, otherwise return an RGB-IMAGE of the same width and height whose corresponding elements are the grayscale value repeated as needed. Strip out any alpha channels.
Returns a new image which is rotated counter-clockwise 90-degrees from the old image
Subtracts image IM2 from image IM1 and returns the resulting image
difference without modifying either IM1 or IM2. Both images must be
the same type and size.
Clips pixel intensity to 0 when necessary.
Destructively subtracts image IM2 from image IM1, leaving the
resulting image difference in im1. Both images must be the same type
and size.
Clips pixel intensity to 0 when necessary.
Returns a GRAYSCALE-IMAGE the same dimensions as IMAGE whose corresponding elements are white if they exceed a threshold, or black if they do not.
mismatched-image-sizes
)) ¶condition
.
:dims
This slot is read-only.
error
.
:sizes
This slot is read-only.
error
.
:types
This slot is read-only.
An IMAGE with element type (UNSIGNED-BYTE 16).
An IMAGE with element type (UNSIGNED-BYTE 8).
An IMAGE with exactly two channels.
An IMAGE with either one or two channels.
A three-dimensional array of (unsigned-byte 8) or (unsigned-byte
16). In the current version, an IMAGE is displaced to a
one-dimensional SIMPLE-ARRAY with the same total number of elements,
but applications should not rely on this implementation detail, as it
is likely to change in future versions. The functions MAKE-IMAGE,
DECODE, COPY-IMAGE, 8-BIT-IMAGE, AND 16-BIT-IMAGE return IMAGEs.
The three dimensions represent row, column, and channel. In other words, (aref image i j k) is the intensity in the k-th channel of the pixel in the i-th row and j-th column of image.
An IMAGE with either 1 or 3 channels
An IMAGE with exactly four channels.
An IMAGE with either three or four channels.
An IMAGE with either two or four channels (i.e. has an alphs channel).
Returns the underlying storage vector of ARRAY, which must be a non-displaced array.
In SBCL, if ARRAY is a of type (SIMPLE-ARRAY * (*)), it is its own storage
vector. Multidimensional arrays, arrays with fill pointers, and adjustable
arrays have an underlying storage vector with the same ARRAY-ELEMENT-TYPE as
ARRAY, which this function returns.
Important note: the underlying vector is an implementation detail. Even though
this function exposes it, changes in the implementation may cause this
function to be removed without further warning.
png
.
Impliments a binary morphological filter using binary MASK centered
at R,C on IMAGE. OP works as follows:
* OP = :or (erosion) any mask pixel set results in output set,
* OP = :and (dilation), all mask pixels set results in output set,
* OP = :maj (median), majority of mask pixels set results in output set
Reads file PATHNAME, decodes as BMP file and returns IMAGE.
Encodes IMAGE as BMP and writes to PATHNAME.
Generates a binary mask matrix of ’(UNSIGNED-BYTE 8) elements whose sides are both (2*1SIDE+1) pixels. Valid mask shapes are specified by NAME, currently :square and :cross. An invalid name will signal an error.
png
.
png
.
Read the header if it hasn’t been read already, then return it.
Reads 2 unsigned BYTES in little-endian from IN stream without testing for end of file.
Reads 4 unsigned BYTES in little-endian from IN stream without testing for end of file.
Prints MASK to *standard-output* for quick examination.
Writes 2 unsigned BYTES in little-endian to OUT stream.
Writes 4 unsigned BYTES in little-endian to OUT stream.
mismatched-image-dims
)) ¶mismatched-image-types
)) ¶bmp
.
unhandled-bitcount
)) ¶bmp
.
unhandled-compression
)) ¶Jump to: | 1
8
A B C D E F G I M N O P R S T U V W |
---|
Jump to: | 1
8
A B C D E F G I M N O P R S T U V W |
---|
Jump to: | *
+
B D M S T |
---|
Jump to: | *
+
B D M S T |
---|
Jump to: | 1
8
B C F G I L M O P R S T U W |
---|
Jump to: | 1
8
B C F G I L M O P R S T U W |
---|