SOSFIMAGE(3iv)
π SoSFImage β ok bestie, welcome to the SoSFImage(3IV)() glow-up π
so this is the manual page for SoSFImage, from section 3IV (yes the header is literally SoSFImage(3IV)() with those empty lil parens, iconic honestly). it's giving "2D image field realness" and i am obsessed. let's get into it. π«Άβ¨
πΈ NAME πΈ
SoSFImage β Field containing a 2D image
𧬠INHERITS FROM π§¬
SoField > SoSField > SoSFImage
like, the whole ancestry is right there. slay.
β¨ SYNOPSIS β¨
#include <Inventor/fields/SoSFImage.h>
Methods from class SoSFImage:
const unsigned char * getValue(SbVec2s &size, int &nc) const
void setValue(const SbVec2s &size, int nc, const
unsigned char *bytes)
unsigned char * startEditing(SbVec2s &size, int &nc)
void finishEditing()
Methods from class SoSField:
static SoType getClassTypeId()
Methods from class SoField:
void setIgnored(SbBool ignore)
SbBool isIgnored() const
SbBool isDefault() const
virtual SoType getTypeId() const
virtual SbBool isOfType(SoType type) const
SbBool set(const char *valueString)
void get(SbString &valueString)
int operator ==(const SoField &f) const
int operator !=(const SoField &f) const
void touch()
SbBool connectFrom(SoField *fromField)
SbBool connectFrom(SoEngineOutput *fromEngine)
void disconnect()
SbBool isConnected() const
SbBool isConnectedFromField() const
SbBool getConnectedField(SoField *&writingField) const
SbBool isConnectedFromEngine() const
SbBool getConnectedEngine(SoEngineOutput *&engineOutput)
const
void enableConnection(SbBool flag)
SbBool isConnectionEnabled() const
int getForwardConnections(SoFieldList &list) const
SoFieldContainer * getContainer() const
π¦ DESCRIPTION π¦
A field containing a two-dimensional image. Images can be greyscale (intensity), greyscale with transparency information, RGB, or RGB with transparency. Each component of the image (intensity, red, green, blue or transparency (alpha)) can have an unsigned one-byte value from 0 to 255.
Values are returned as arrays of unsigned chars. The image is stored in this array starting at the bottom left corner of the image with the intensity or red component of that pixel, followed by either the alpha, the green and blue, or the green, blue and alpha components (depending on the number of components in the image). The next value is the first component of the next pixel to the right.
SoSFImages are written to file as three integers representing the width, height and number of components in the image, followed by width*height hexadecimal values representing the pixels in the image, separated by whitespace. A one-component image will have one-byte hexadecimal values representing the intensity of the image. For example, 0xFF is full intensity, 0x00 is no intensity. A two-component image puts the intensity in the first (high) byte and the transparency in the second (low) byte. Pixels in a three-component image have the red component in the first (high) byte, followed by the green and blue components (so 0xFF0000 is red). Four-component images put the transparency byte after red/green/blue (so 0x0000FF80 is semi-transparent blue). Note: each pixel is actually read as a single unsigned number, so a 3-component pixel with value "0x0000FF" can also be written as "0xFF" or "255" (decimal).
For example,
1 2 1 0xFF 0x00
is a 1 pixel wide by 2 pixel high greyscale image, with the bottom pixel white and the top pixel black. And:
2 4 3 0xFF0000 0xFF00 0 0 0 0 0xFFFFFF 0xFFFF00
is a 2 pixel wide by 4 pixel high RGB image, with the bottom left pixel red, the bottom right pixel green, the two middle rows of pixels black, the top left pixel white, and the top right pixel yellow.
π METHODS π
const unsigned char * getValue(SbVec2s &size, int &nc) constβ Returns the pixels in the image as an array of unsigned chars. Thesizeandncarguments are filled in with the dimensions of the image and the number of components in the image; the number of bytes in the array returned will besize[0]*size[1]*nc.void setValue(const SbVec2s &size, int nc, const unsigned char *bytes)β Sets the value of this field to be an image of the given size, with the given number of components, and with the given pixel values.size[0]*size[1]*ncbytes from the given array will be copied into internal storage maintained by theSoSFImagefield.unsigned char * startEditing(SbVec2s &size, int &nc)void finishEditing()β These methods can be used to efficiently edit the values in an image field.startEditing()returns the size of the image in thesizeandncarguments; writing past the end of the array returned is a good way to cause hard-to-find core dumps.
π¨ bestie warning: "writing past the end of the array returned is a good way to cause hard-to-find core dumps." that is NOT a vibe. do not do it. fr fr. ππ
π SEE ALSO π
SoField, SoSField
and that's the whole thing, babe. footer says SoSFImage(3IV)() β that's the source/version and date situation, so consider it signed, sealed, and slayed. periodt. ππβ¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms