eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HalfFloatArray':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HalfFloatArray


Inheritance:

   Object
   |
   +--Collection
      |
      +--SequenceableCollection
         |
         +--ArrayedCollection
            |
            +--UninterpretedBytes
               |
               +--AbstractNumberVector
                  |
                  +--HalfFloatArray

Package:
stx:libbasic2
Category:
Collections-Arrayed
Version:
rev: 1.8 date: 2016/08/24 15:06:12
user: cg
file: HalfFloatArray.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Claus Gittinger

Description:


HalfFloatArrays store half precision (16bit) floats (and nothing else).
HalfFloats were traditionally seldom used, but seem to become more popular
these days, as some 3D graphics accelerators and game engines use them
for very dense and compact storage of texture and vertex data.

Notice, that HalfFloats are not supported as first class objects by the ST/X system;
i.e. outside of a HalfFloatArray, these values are represented as floats
or doubles. When accessing a HalfFloatArray's element via getters/setters,
shortFloat (i.e. single precision 32bit floats) are exchanged.

Be aware that the numeric range of a half-float is very very limited.

[memory requirements:]
    OBJ-HEADER + (size * 2)


Related information:

    FloatArray
    DoubleArray
    Array
    http://www.opengl.org/wiki/Small_Float_Formats

Class protocol:

queries
o  elementByteSize
for bit-like containers, return the number of bytes stored per element.
Here, 2 is returned


Instance protocol:

accessing
o  at: index

o  at: index put: aFloat

queries
o  defaultElement

o  isValidElement: anObject
return true, if I can hold this kind of object

o  numFloats



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Mon, 04 Aug 2025 16:34:53 GMT