SoSFImage3(3)
π NAME π
SoSFImage3 β bestie, this class is where you store 3D (volume) images. That's it, that's the whole job. π§β¨
πΈ SYNOPSIS πΈ
So this lives in the library functions manual, section 3, and here's how you pull it in:
#include <Inventor/fields/SoSFImage3.h>
And it inherits SoSField π (which itself goes all the way back up to SoField, so there's a whole family tree of stuff you get for free).
β¨ Public Member Functions β¨
virtual SoType getTypeId (void) constvirtual void copyFrom (const SoField &field)const SoSFImage3 & operator= (const SoSFImage3 &field)virtual SbBool isSame (const SoField &field) constconst unsigned char * getValue (SbVec3s &size, int &nc) constvoid setValue (const SbVec3s &size, const int nc, const unsigned char *bytes)int operator== (const SoSFImage3 &field) constint operator!= (const SoSFImage3 &field) constunsigned char * startEditing (SbVec3s &size, int &nc)void finishEditing (void)
π«Ά Public Member Functions inherited from SoSField
virtual ~SoSField ()
π«Ά Public Member Functions inherited from SoField
virtual ~SoField ()void setIgnored (SbBool ignore)SbBool isIgnored (void) constvoid setDefault (SbBool def)SbBool isDefault (void) constSbBool isOfType (const SoType type) constvoid enableConnection (SbBool flag)SbBool isConnectionEnabled (void) constSbBool connectFrom (SoEngineOutput *master, SbBool notnotify=0, SbBool append=0)SbBool appendConnection (SoEngineOutput *master, SbBool notnotify=0)void disconnect (SoEngineOutput *engineoutput)SbBool isConnectedFromEngine (void) constSbBool getConnectedEngine (SoEngineOutput *&master) constSbBool connectFrom (SoField *master, SbBool notnotify=0, SbBool append=0)SbBool appendConnection (SoField *master, SbBool notnotify=0)void disconnect (SoField *field)SbBool isConnectedFromField (void) constSbBool getConnectedField (SoField *&master) constint getNumConnections (void) constint getForwardConnections (SoFieldList &slavelist) constint getConnections (SoFieldList &masterlist) constvoid disconnect (void)SbBool isConnected (void) constvoid setContainer (SoFieldContainer *cont)SoFieldContainer * getContainer (void) constSbBool set (const char *valuestring)void get (SbString &valuestring)SbBool shouldWrite (void) constvirtual void touch (void)virtual void startNotify (void)virtual void notify (SoNotList *nlist)SbBool enableNotify (SbBool on)SbBool isNotifyEnabled (void) constvoid addAuditor (void *f, SoNotRec::Type type)void removeAuditor (void *f, SoNotRec::Type type)int operator== (const SoField &f) constint operator!= (const SoField &f) constvirtual void connectionStatusChanged (int numconnections)SbBool isReadOnly (void) constvirtual void fixCopy (SbBool copyconnections)virtual SbBool referencesCopy (void) constvoid copyConnection (const SoField *fromfield)virtual SbBool read (SoInput *in, const SbName &name)virtual void write (SoOutput *out, const SbName &name) constvirtual void countWriteRefs (SoOutput *out) constvoid setFieldType (int type)int getFieldType (void) constSbBool getDirty (void) constvoid setDirty (SbBool dirty)void evaluate (void) const
β Static Public Member Functions β
static void * createInstance (void)static SoType getClassTypeId (void)static void initClass (void)
π«Ά Static Public Member Functions inherited from SoSField
static void initClass (void)static SoType getClassTypeId (void)
π«Ά Static Public Member Functions inherited from SoField
static void initClass (void)static void initClasses (void)static SoType getClassTypeId (void)
π¦ Additional Inherited Members π¦
Public Types inherited from SoField:
enum FieldType { NORMAL_FIELD = 0, EVENTIN_FIELD, EVENTOUT_FIELD, EXPOSED_FIELD }
Protected Member Functions inherited from SoSField:
SoSField (void)
Protected Member Functions inherited from SoField:
SoField (void)void valueChanged (SbBool resetdefault=1)virtual void evaluateConnection (void) constvirtual SbBool readConnection (SoInput *in)virtual void writeConnection (SoOutput *out) constSbBool isDestructing (void) const
π Detailed Description π
Okay so SoSFImage3? It's the class you use to store 3D (volume) images. Periodt. π
It gives you storage for inline 3D image maps. And like, what are 3D images in Coin even for? Mainly 3D texture mapping support. That's the whole vibe. π§
SoSFImage3 instances can be exported and imported just like any other field class in Coin. Slay, portable. βοΈ
The components of an SoSFImage3 are literally:
- its image dimensions β width, height and depth
- the number of bytes used for describing each pixel (that's the number of components)
- and an associated pixel buffer
And the size of that pixel buffer? It's width*height*depth*components. Math, bestie. π’
For texture maps, the components / bytes-per-pixel setting translates like this:
1β a grayscale imagemap2β grayscale + opacity (i.e. an alpha value)3β RGB (1 byte each for red, green and blue)4components β 3 bytes for RGB + 1 byte opacity value (aka RGBA) π
This field is serializable into the Inventor / Coin file format in the following manner:
FIELDNAME X Y Z C 0xRRGGBBAA 0xRRGGBBAA ...
"X", "Y" and "Z" are the image dimensions along the given axes, and "C" is the number of components in the image. The number of 0xRRGGBBAA pixel color specifications needs to equal the exact number of pixels, which is X*Y*Z. Each part of the pixel color value is in the range 0x00 to 0xff (hexadecimal, 0 to 255 decimal). π₯
For 3-component images, the pixel-format is 0xXXRRGGBB, where the byte in the pixel color value marked as "XX" is ignored and can be left out.
For 2-component images, the pixel-format is 0xXXXXGGAA, where the bytes in the pixel color values marked as "XX" are ignored and can be left out. "GG" is the part which gives a grayscale value and "AA" is for opacity.
For 1-component images, the pixel-format is 0xXXXXXXGG, where the bytes in the pixel color values marked as "XX" are ignored and can be left out.
The pixels are read as being ordered in rows along X (width), columns along Y (height, bottom to top) and Z "planes" (depth, front to back). Keep that order in mind, bestie, it matters. π
Here's a simple example of the file format serialization, for a 2x2x2 RGB-image inside an SoTexture3 node:
Texture3 {
images 2 2 2 3
0x000000 0x00ff00
0xff0000 0xffff00
0x000000 0x0000ff
0x00ff00 0x00ffff
}
The image above is colored black+green on the first line and red+yellow on the second line in the first Z plane. The second Z plane is colored black+blue on the first line and green+cyan on the second line. πβ¨
β οΈ Heads up! Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. So don't go looking for it there, she's not home. π
π See also
SoTexture3, SoSFImage
π Since
- Coin 2.0
- TGS Inventor 2.6
π§ Member Function Documentation π§
π SoType SoSFImage3::getTypeId (void ) const [virtual]
Returns the type identification instance which uniquely identifies the Coin field class the object belongs to. It's giving β¨identityβ¨.
See also: getClassTypeId(), SoType
Implements SoField.
π void SoSFImage3::copyFrom (const SoField & f) [virtual]
Copy value(s) from f into this field. And f must be of the same type as this field, no mixing bestie. π
Implements SoField.
π SbBool SoSFImage3::isSame (const SoField & f) const [virtual]
Check for equal type and value(s). Both, not just one. π
Implements SoField.
π const unsigned char * SoSFImage3::getValue (SbVec3s & size, int & nc) const
Return the pixel buffer, set size to contain the image dimensions and nc to the number of components in the image. Three things at once, multitasking queen. π
π void SoSFImage3::setValue (const SbVec3s & size, const int nc, const unsigned char * bytes)
Initialize this field to size and nc.
If bytes is not NULL, the image data is copied from bytes into this field. If bytes is NULL, the image data is cleared by setting all bytes to 0.
β οΈ Note that the behavior on passing a NULL pointer is specific for Coin β Open Inventor will crash if you try it. So like, don't. ππ
References SoField::valueChanged().
π int SoSFImage3::operator== (const SoSFImage3 & field) const
Compare image of field with the image in this field and return TRUE if they are equal. β
π int SoSFImage3::operator!= (const SoSFImage3 & field) const [inline]
Compare image of field with the image in this field and return FALSE if they are equal. (Yes, FALSE. That's the whole bit. π)
References SoField::operator==().
π unsigned char * SoSFImage3::startEditing (SbVec3s & size, int & nc)
Return the pixel buffer, set size to contain the image dimensions and nc to the number of components in the image.
π Important: the field's container will not be notified about the changes until you call finishEditing(). So don't forget, or nobody will know you did anything.
π void SoSFImage3::finishEditing (void )
Notify the field's auditors that the image data has been modified. You did the edit, now you gotta announce it. π£
References SoField::valueChanged().
π Author π
Generated automatically by Doxygen for Coin from the source code. Not me, bestie, the robot did it. π€β¨
okay that's the whole page, you're so welcome π«Ά This is from Coin, Version 2.5.0, manual page SoSFImage3(3) in the Library Functions Manual β go forth and texture your volumes, main character. πππ¦πβππ
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms