This is the cl-ktx Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:04:40 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-ktx
An implementation of the Khronos KTX image file format
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/shinmera/cl-ktx.git)
zlib
1.0.0
binary-structures
(system).
cl-opengl
(system).
trivial-features
(system).
documentation-utils
(system).
package.lisp
(file).
ktx.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-ktx/ktx.lisp
package.lisp
(file).
cl-ktx
(system).
array-element-count
(method).
(setf array-element-count)
(method).
create-file
(function).
data
(method).
(setf data)
(method).
depth
(method).
(setf depth)
(method).
endianness
(method).
(setf endianness)
(method).
face-count
(method).
(setf face-count)
(method).
file
(structure).
gl-base-internal-format
(method).
(setf gl-base-internal-format)
(method).
gl-format
(method).
(setf gl-format)
(method).
gl-internal-format
(method).
(setf gl-internal-format)
(method).
gl-type
(method).
(setf gl-type)
(method).
gl-type-size
(method).
(setf gl-type-size)
(method).
height
(method).
(setf height)
(method).
kv-store
(method).
(setf kv-store)
(method).
(setf kv-store)
(method).
make-mipmap-level
(function).
mip-count
(method).
(setf mip-count)
(method).
mipmap-level
(structure).
mipmaps
(method).
(setf mipmaps)
(method).
octet-size
(method).
octet-size
(method).
octet-size
(method).
print-object
(method).
print-object
(method).
print-object
(method).
read-file
(function).
size
(method).
(setf size)
(method).
width
(method).
(setf width)
(method).
write-file
(function).
copy-file
(function).
copy-kv-entry
(function).
copy-mipmap-level
(function).
define-accessors
(macro).
define-gl-accessors
(macro).
file-array-element-count
(reader).
(setf file-array-element-count)
(writer).
file-depth
(reader).
(setf file-depth)
(writer).
file-endianness
(reader).
(setf file-endianness)
(writer).
file-face-count
(reader).
(setf file-face-count)
(writer).
file-gl-base-internal-format
(reader).
(setf file-gl-base-internal-format)
(writer).
file-gl-format
(reader).
(setf file-gl-format)
(writer).
file-gl-internal-format
(reader).
(setf file-gl-internal-format)
(writer).
file-gl-type
(reader).
(setf file-gl-type)
(writer).
file-gl-type-size
(reader).
(setf file-gl-type-size)
(writer).
file-height
(reader).
(setf file-height)
(writer).
file-kv-store
(reader).
(setf file-kv-store)
(writer).
file-kv-store-size
(reader).
(setf file-kv-store-size)
(writer).
file-mip-count
(reader).
(setf file-mip-count)
(writer).
file-mipmaps
(reader).
(setf file-mipmaps)
(writer).
file-p
(function).
file-width
(reader).
(setf file-width)
(writer).
infer-internal-format
(function).
kv-entry
(structure).
kv-entry-kv-string
(reader).
(setf kv-entry-kv-string)
(writer).
kv-entry-p
(function).
kv-entry-size
(reader).
(setf kv-entry-size)
(writer).
make-file
(function).
make-kv-entry
(function).
mipmap-level-data
(reader).
(setf mipmap-level-data)
(writer).
mipmap-level-p
(function).
mipmap-level-size
(reader).
(setf mipmap-level-size)
(writer).
pixel-data-stride
(function).
read-io-octet-vector-file
(function).
read-io-octet-vector-kv-entry
(function).
read-io-octet-vector-mipmap-level
(function).
read-io-stream-file
(function).
read-io-stream-kv-entry
(function).
read-io-stream-mipmap-level
(function).
read-kv-entry
(function).
read-mipmap-level
(function).
write-io-octet-vector-file
(function).
write-io-octet-vector-kv-entry
(function).
write-io-octet-vector-mipmap-level
(function).
write-io-stream-file
(function).
write-io-stream-kv-entry
(function).
write-io-stream-mipmap-level
(function).
write-kv-entry
(function).
write-mipmap-level
(function).
Packages are listed by definition order.
org.shirakumo.ktx
common-lisp
.
org.shirakumo.binary-structures.types
.
array-element-count
(generic function).
(setf array-element-count)
(generic function).
create-file
(function).
data
(generic function).
(setf data)
(generic function).
depth
(generic function).
(setf depth)
(generic function).
endianness
(generic function).
(setf endianness)
(generic function).
face-count
(generic function).
(setf face-count)
(generic function).
file
(structure).
gl-base-internal-format
(generic function).
(setf gl-base-internal-format)
(generic function).
gl-format
(generic function).
(setf gl-format)
(generic function).
gl-internal-format
(generic function).
(setf gl-internal-format)
(generic function).
gl-type
(generic function).
(setf gl-type)
(generic function).
gl-type-size
(generic function).
(setf gl-type-size)
(generic function).
height
(generic function).
(setf height)
(generic function).
kv-store
(generic function).
(setf kv-store)
(generic function).
make-mipmap-level
(function).
mip-count
(generic function).
(setf mip-count)
(generic function).
mipmap-level
(structure).
mipmaps
(generic function).
(setf mipmaps)
(generic function).
read-file
(function).
size
(generic function).
(setf size)
(generic function).
width
(generic function).
(setf width)
(generic function).
write-file
(function).
copy-file
(function).
copy-kv-entry
(function).
copy-mipmap-level
(function).
define-accessors
(macro).
define-gl-accessors
(macro).
file-array-element-count
(reader).
(setf file-array-element-count)
(writer).
file-depth
(reader).
(setf file-depth)
(writer).
file-endianness
(reader).
(setf file-endianness)
(writer).
file-face-count
(reader).
(setf file-face-count)
(writer).
file-gl-base-internal-format
(reader).
(setf file-gl-base-internal-format)
(writer).
file-gl-format
(reader).
(setf file-gl-format)
(writer).
file-gl-internal-format
(reader).
(setf file-gl-internal-format)
(writer).
file-gl-type
(reader).
(setf file-gl-type)
(writer).
file-gl-type-size
(reader).
(setf file-gl-type-size)
(writer).
file-height
(reader).
(setf file-height)
(writer).
file-kv-store
(reader).
(setf file-kv-store)
(writer).
file-kv-store-size
(reader).
(setf file-kv-store-size)
(writer).
file-mip-count
(reader).
(setf file-mip-count)
(writer).
file-mipmaps
(reader).
(setf file-mipmaps)
(writer).
file-p
(function).
file-width
(reader).
(setf file-width)
(writer).
infer-internal-format
(function).
kv-entry
(structure).
kv-entry-kv-string
(reader).
(setf kv-entry-kv-string)
(writer).
kv-entry-p
(function).
kv-entry-size
(reader).
(setf kv-entry-size)
(writer).
make-file
(function).
make-kv-entry
(function).
mipmap-level-data
(reader).
(setf mipmap-level-data)
(writer).
mipmap-level-p
(function).
mipmap-level-size
(reader).
(setf mipmap-level-size)
(writer).
pixel-data-stride
(function).
read-io-octet-vector-file
(function).
read-io-octet-vector-kv-entry
(function).
read-io-octet-vector-mipmap-level
(function).
read-io-stream-file
(function).
read-io-stream-kv-entry
(function).
read-io-stream-mipmap-level
(function).
read-kv-entry
(function).
read-mipmap-level
(function).
write-io-octet-vector-file
(function).
write-io-octet-vector-kv-entry
(function).
write-io-octet-vector-mipmap-level
(function).
write-io-stream-file
(function).
write-io-stream-kv-entry
(function).
write-io-stream-mipmap-level
(function).
write-kv-entry
(function).
write-mipmap-level
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Create a new file instance.
PAYLOADS should be a vector of data vectors to use for the mipmap
levels to include in the file, stored in the correct order starting
with level 0.
If GL-INTERNAL-FORMAT, GL-BASE-INTERNAL-FORMAT, or GL-TYPE-SIZE are not supplied, they are inferred based on the GL-TYPE and GL-FORMAT.
See FILE (type)
Create a new mipmap-level instance.
See MIPMAP-LEVEL (type)
Reads a file from a backend supported by binary-structures.
This is, by default, one of:
- PATHNAME
- BINARY-STREAM
- OCTET-VECTOR
- FOREIGN-POINTER
See FILE (type)
Writes the file to a backend supported by binary-structures.
This is, by default, one of:
- PATHNAME
- BINARY-STREAM
- OCTET-VECTOR
- FOREIGN-POINTER
See FILE (type)
Accesses the number of texture array elements in the data.
As per spec:
numberOfArrayElements specifies the number of array elements. If the
texture is not an array texture, numberOfArrayElements must equal 0.
See FILE (type)
Accesses the mipmap level’s pixel data.
As per spec:
The data is stored as follows within the opaque array:
for each array_element in max(1, arrayElementCount)
for each face in max(1, faceCount)
for each z_slice in max(1, depth)
for each row or row_of_blocks in max(1, height)
for each pixel or block_of_pixels in width
Byte data[format-specific-number-of-bytes]
end
end
end
Byte cubePadding[0-3]
end
end
For non-array cubemap textures (any texture where numberOfFaces is 6
and numberOfArrayElements is 0) cubePadding contains between 0 and 3
bytes of value 0x00 to ensure that the data in each face begins at a
file offset that is a multiple of 4. In all other cases cubePadding is
empty (0 bytes long). This is empty in the non-array cubemap case as
well. The requirement of GL_UNPACK_ALIGNMENT = 4 means the size of
uncompressed textures will always be a multiple of 4 bytes. All known
compressed formats, that are usable for cubemaps, have block sizes
that are a multiple of 4 bytes. The field is still shown in case a
compressed format emerges with a block size that is not a multiple of
4 bytes.
See MIPMAP-LEVEL (type)
mipmap-level
)) ¶mipmap-level
)) ¶Accesses the depth of the pixel data.
As per spec:
The size of the texture image for level 0, in pixels. No rounding to
block sizes should be applied for block compressed textures.
For 1D textures pixelHeight and pixelDepth must be 0. For 2D and cube
textures pixelDepth must be 0.
See FILE (type)
Accesses the endianness type of the file.
Must be either :LITTLE-ENDIAN or :BIG-ENDIAN
See FILE (type)
Accesses the number of cubemap faces in the data.
As per spec:
numberOfFaces specifies the number of cubemap faces. For cubemaps and
cubemap arrays this should be 6. For non cubemaps this should be
1. Cube map faces are stored in the order: +X, -X, +Y, -Y, +Z, -Z.
Due to GL_OES_compressed_paletted_texture [OESCPT] not defining the
interaction between cubemaps and its GL_PALETTE* formats, if
‘glInternalFormat‘ is one of its GL_PALETTE* format, numberOfFaces
must be 1.
See FILE (type)
Accesses the basic GL Internal Texture Format the data should be uploaded as.
As per spec:
For both compressed and uncompressed textures, glBaseInternalFormat
specifies the base internal format of the texture, usually one of the
values from table 8.11 of the OpenGL 4.4 specification [OPENGL44]
(RGB, RGBA, ALPHA, etc.). For uncompressed textures, this value will
be the same as glFormat and is used as the internalformat parameter
when loading into a context that does not support sized formats, such
as an unextended OpenGL ES 2.0 context.
See FILE (type)
Accesses the GL Pixel Format the data is stored as.
As per spec:
For compressed textures, glFormat must equal 0. For uncompressed
textures, glFormat specifies the format parameter passed to
glTex{,Sub}Image*D, usually one of the values from table 8.3 of the
OpenGL 4.4 specification [OPENGL44] (RGB, RGBA, BGRA, etc.)
See FILE (type)
Accesses the GL Internal Texture Format the data should be uploaded as.
As per spec:
For compressed textures, glInternalFormat must equal the compressed
internal format, usually one of the values from table 8.14 of the
OpenGL 4.4 specification [OPENGL44]. For uncompressed textures,
glInternalFormat specifies the internalformat parameter passed to
glTexStorage*D or glTexImage*D, usually one of the sized internal
formats from tables 8.12 & 8.13 of the OpenGL 4.4 specification
[OPENGL44]. The sized format should be chosen to match the bit depth
of the data provided. glInternalFormat is used when loading both
compressed and uncompressed textures, except when loading into a
context that does not support sized formats, such as an unextended
OpenGL ES 2.0 context where the internalformat parameter is required
to have the same value as the format parameter.
See FILE (type)
Accesses the GL Pixel Type the data is stored as.
As per spec:
For compressed textures, glType must equal 0. For uncompressed
textures, glType specifies the type parameter passed to
glTex{,Sub}Image*D, usually one of the values from table 8.2 of the
OpenGL 4.4 specification [OPENGL44] (UNSIGNED_BYTE,
UNSIGNED_SHORT_5_6_5, etc.)
See FILE (type)
Accesses the size of the GL Pixel Type in octets.
As per spec:
glTypeSize specifies the data type size that should be used when
endianness conversion is required for the texture data stored in the
file. If glType is not 0, this should be the size in bytes
corresponding to glType. For texture data which does not depend on
platform endianness, including compressed texture data, glTypeSize
must equal 1.
See FILE (type)
Accesses the height of the pixel data.
As per spec:
The size of the texture image for level 0, in pixels. No rounding to
block sizes should be applied for block compressed textures.
For 1D textures pixelHeight and pixelDepth must be 0. For 2D and cube
textures pixelDepth must be 0.
See FILE (type)
Accesses the key-value store of the file.
Always returns a fresh hash-table.
Setting this will not preserve referential transparency. You may set
it as either an ALIST or a HASH-TABLE.
As per spec:
Keys that begin with the 3 ascii characters ’KTX’ or ’ktx’ are
reserved and must not be used except as described by this spec (this
version of the KTX spec defines a single key, see FILE).
See FILE (type)
Accesses the number of mipmap levels in the data.
As per spec:
numberOfMipmapLevels must equal 1 for non-mipmapped textures. For
mipmapped textures, it equals the number of mipmaps. Mipmaps are
stored in order from largest size to smallest size. The first mipmap
level is always level 0. A KTX file does not need to contain a
complete mipmap pyramid. If numberOfMipmapLevels equals 0, it
indicates that a full mipmap pyramid should be generated from level 0
at load time (this is usually not allowed for compressed formats).
For the GL_PALETTE* formats, this equals the number of mipmaps and is
passed as the levels, parameter when uploading to OpenGL
{,ES}. However all levels are packed into a single block of data along
with the palette so numberOfMipmapLevels is considered to be 1 in the
for loop over the data. Individual mipmaps are not identifiable.
See FILE (type)
See MIPMAPS
Accesses the vector of mipmap storage levels.
Even the base level is stored as a mipmap-level.
See FILE (type)
See MIPMAP-LEVEL (type)
Accesses the size of the mipmap’s data vector in octets.
As per spec:
For most textures imageSize is the number of bytes of pixel data in
the current LOD level. This includes all array layers, all z slices,
all faces, all rows (or rows of blocks) and all pixels (or blocks) in
each row for the mipmap level. It does not include any bytes in
mipPadding.
The exception is non-array cubemap textures (any texture where numberOfFaces is 6 and numberOfArrayElements is 0). For these textures imageSize is the number of bytes in each face of the texture for the current LOD level, not including bytes in cubePadding or mipPadding.
See MIPMAP-LEVEL (type)
mipmap-level
)) ¶mipmap-level
)) ¶Accesses the width of the pixel data.
As per spec:
The size of the texture image for level 0, in pixels. No rounding to
block sizes should be applied for block compressed textures.
For 1D textures pixelHeight and pixelDepth must be 0. For 2D and cube
textures pixelDepth must be 0.
See FILE (type)
mipmap-level
)) ¶org.shirakumo.binary-structures
.
mipmap-level
) stream) ¶Representation of a KTX file.
As per spec:
KTX™ is a format for storing textures for OpenGL® and OpenGL® ES
applications. It is distinguished by the simplicity of the loader
required to instantiate a GL texture object from the file contents.
The unpack alignment is 4. I.e. uncompressed pixel data is packed
according to the rules described in section 8.4.4.1 of the OpenGL 4.4
specification [OPENGL44] for a GL_UNPACK_ALIGNMENT of 4.
Values listed in tables referred to in the OpenGL 4.4 specification
[OPENGL44] may be supplemented by extensions. The references are given
as examples and do not imply that all of those texture types can be
loaded in OpenGL ES or earlier versions of OpenGL.
Texture data in a KTX file are arranged so that the first pixel in the
data stream for each face and/or array element is closest to the
origin of the texture coordinate system. In OpenGL that origin is
conventionally described as being at the lower left, but this
convention is not shared by all image file formats and content
creation tools, so there is abundant room for confusion.
The desired texture axis orientation is often predetermined by, e.g. a
content creation tool’s or existing application’s use of the
image. Therefore it is strongly recommended that tools for generating
KTX files clearly describe their behaviour, and provide an option to
specify the texture axis origin and orientation relative to the
logical orientation of the source image. At minimum they should
provide a choice between top-left and bottom-left as origin for 2D
source images, with the positive S axis pointing right. Where
possible, the preferred default is to use the logical upper-left
corner of the image as the texture origin. Note that this is contrary
to the standard interpretation of GL texture coordinates. However, the
majority of texture compression tools use this convention.
As an aid to writing image manipulation tools and viewers, the logical
orientation of the data in a KTX file may be indicated in the file’s
key/value metadata. Note that this metadata affects only the logical
interpretation of the data, has no effect on the mapping from pixels
in the file byte stream to texture coordinates. The recommended key to
use is:
KTXorientation
It is recommended that viewing and editing tools support at least the
following values:
S=r,T=d
S=r,T=u
S=r,T=d,R=i
S=r,T=u,R=o
where
S indicates the direction of increasing S values
T indicates the direction of increasing T values
R indicates the direction of increasing R values
r indicates increasing to the right
l indicates increasing to the left
d indicates increasing downwards
u indicates increasing upwards
o indicates increasing out from the screen (moving towards viewer)
i indicates increasing in towards the screen (moving away from viewer)
Although other orientations can be represented, it is recommended that
tools that create KTX files use only the values listed above as other
values may not be widely supported by other tools.
See READ-FILE
See WRITE-FILE
See ENDIANNESS
See GL-TYPE
See GL-TYPE-SIZE
See GL-FORMAT
See GL-INTERNAL-FORMAT
See GL-BASE-INTERNAL-FORMAT
See WIDTH
See HEIGHT
See DEPTH
See ARRAY-ELEMENT-COUNT
See FACE-COUNT
See MIP-COUNT
See MIPMAPS
See KV-STORE
See CREATE-FILE
io-structure-object
.
(setf array-element-count)
.
array-element-count
.
(setf depth)
.
depth
.
(setf endianness)
.
endianness
.
(setf face-count)
.
face-count
.
(setf gl-base-internal-format)
.
gl-base-internal-format
.
(setf gl-format)
.
gl-format
.
(setf gl-internal-format)
.
gl-internal-format
.
(setf gl-type)
.
gl-type
.
(setf gl-type-size)
.
gl-type-size
.
(setf height)
.
height
.
(setf kv-store)
.
(setf kv-store)
.
kv-store
.
(setf mip-count)
.
mip-count
.
(setf mipmaps)
.
mipmaps
.
octet-size
.
print-object
.
(setf width)
.
width
.
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(unsigned-byte 32)
0
(array (unsigned-byte 8) (*))
(make-array 0 :element-type (quote (unsigned-byte 8)))
(array org.shirakumo.ktx:mipmap-level (*))
(make-array 0 :element-type (quote org.shirakumo.ktx:mipmap-level))
Representation of a mipmap level’s graphical data.
See SIZE
See DATA
size
.
data
.
size
.
Jump to: | (
A C D E F G H I K M O P R S W |
---|
Jump to: | (
A C D E F G H I K M O P R S W |
---|
Jump to: | A D E F G H K M S W |
---|
Jump to: | A D E F G H K M S W |
---|
Jump to: | C D F K M O P S |
---|
Jump to: | C D F K M O P S |
---|