.TH "SoSFImage3" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoSFImage3 \- .PP The \fBSoSFImage3\fP class is used to store 3D (volume) images\&. .PP The \fBSoSFImage3\fP class provides storage for inline 3D image maps\&. 3D images in Coin are mainly used for 3D texture mapping support\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoSField\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .ti -1c .RI "virtual void \fBcopyFrom\fP (const \fBSoField\fP &field)" .br .ti -1c .RI "const \fBSoSFImage3\fP & \fBoperator=\fP (const \fBSoSFImage3\fP &field)" .br .ti -1c .RI "virtual SbBool \fBisSame\fP (const \fBSoField\fP &field) const " .br .ti -1c .RI "const unsigned char * \fBgetValue\fP (\fBSbVec3s\fP &size, int &nc) const " .br .ti -1c .RI "void \fBsetValue\fP (const \fBSbVec3s\fP &size, const int nc, const unsigned char *bytes)" .br .ti -1c .RI "int \fBoperator==\fP (const \fBSoSFImage3\fP &field) const " .br .ti -1c .RI "int \fBoperator!=\fP (const \fBSoSFImage3\fP &field) const " .br .ti -1c .RI "unsigned char * \fBstartEditing\fP (\fBSbVec3s\fP &size, int &nc)" .br .ti -1c .RI "void \fBfinishEditing\fP (void)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void * \fBcreateInstance\fP (void)" .br .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoSFImage3\fP class is used to store 3D (volume) images\&. .PP The \fBSoSFImage3\fP class provides storage for inline 3D image maps\&. 3D images in Coin are mainly used for 3D texture mapping support\&. \fBSoSFImage3\fP instances can be exported and imported as any other field class in Coin\&. .PP The components of an \fBSoSFImage3\fP is: its image dimensions (width, height and depth), the number of bytes used for describing each pixel (number of components) and an associated pixel buffer\&. The size of the pixel buffer will be width*height*depth*components\&. .PP For texture maps, the components / bytes-per-pixel setting translates as follows: use 1 for a grayscale imagemap, 2 for grayscale + opacity (i\&.e\&. alpha value), 3 for RGB (1 byte each for red, green and blue) and 4 components means 3 bytes for RGB + 1 byte opacity value (aka RGBA)\&. .PP This field is serializable into the Inventor / Coin file format in the following manner: .PP .PP .nf FIELDNAME X Y Z C 0xRRGGBBAA 0xRRGGBBAA \&.\&.\&. .fi .PP .PP 'X', 'Y' and 'Z' are the image dimensions along the given axes, '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)\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP 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)\&. .PP Here's a simple example of the file format serialization, for a 2x2x2 RGB-image inside an \fBSoTexture3\fP node: .PP .PP .nf Texture3 { images 2 2 2 3 0x000000 0x00ff00 0xff0000 0xffff00 0x000000 0x0000ff 0x00ff00 0x00ffff } .fi .PP .PP 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\&. .PP Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2\&.1 API\&. .PP \fBSee Also:\fP .RS 4 \fBSoTexture3\fP, \fBSoSFImage\fP .RE .PP \fBSince:\fP .RS 4 Coin 2\&.0 .PP TGS Inventor 2\&.6 .RE .PP .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoSFImage3::getClassTypeId (void)\fC [static]\fP" Returns a unique type identifier for this field class\&. .PP \fBSee Also:\fP .RS 4 \fBgetTypeId()\fP, \fBSoType\fP .RE .PP .PP Reimplemented from \fBSoSField\fP\&. .SS "\fBSoType\fP SoSFImage3::getTypeId (void) const\fC [virtual]\fP" Returns the type identification instance which uniquely identifies the Coin field class the object belongs to\&. .PP \fBSee Also:\fP .RS 4 \fBgetClassTypeId()\fP, \fBSoType\fP .RE .PP .PP Implements \fBSoField\fP\&. .SS "void SoSFImage3::copyFrom (const \fBSoField\fP &f)\fC [virtual]\fP" Copy value(s) from \fIf\fP into this field\&. \fIf\fP must be of the same type as this field\&. .PP Implements \fBSoField\fP\&. .SS "SbBool SoSFImage3::isSame (const \fBSoField\fP &f) const\fC [virtual]\fP" Check for equal type and value(s)\&. .PP Implements \fBSoField\fP\&. .SS "void SoSFImage3::initClass (void)\fC [static]\fP" Internal method called upon initialization of the library (from \fBSoDB::init()\fP) to set up the type system\&. .PP Reimplemented from \fBSoSField\fP\&. .SS "const unsigned char * SoSFImage3::getValue (\fBSbVec3s\fP &size, int &nc) const" Return pixel buffer, set \fIsize\fP to contain the image dimensions and \fInc\fP to the number of components in the image\&. .SS "void SoSFImage3::setValue (const \fBSbVec3s\fP &size, const intnc, const unsigned char *bytes)" Initialize this field to \fIsize\fP and \fInc\fP\&. .PP If \fIbytes\fP is not \fCNULL\fP, the image data is copied from \fIbytes\fP into this field\&. If \fIbytes\fP is \fCNULL\fP, the image data is cleared by setting all bytes to 0 (note that the behavior on passing a \fCNULL\fP pointer is specific for Coin, Open Inventor will crash if you try it)\&. .SS "int SoSFImage3::operator== (const \fBSoSFImage3\fP &field) const" Compare image of \fIfield\fP with the image in this field and return \fCTRUE\fP if they are equal\&. .SS "int SoSFImage3::operator!= (const \fBSoSFImage3\fP &field) const\fC [inline]\fP" Compare image of \fIfield\fP with the image in this field and return \fCFALSE\fP if they are equal\&. .SS "unsigned char * SoSFImage3::startEditing (\fBSbVec3s\fP &size, int &nc)" Return pixel buffer, set \fIsize\fP to contain the image dimensions and \fInc\fP to the number of components in the image\&. .PP The field's container will not be notified about the changes until you call \fBfinishEditing()\fP\&. .SS "void SoSFImage3::finishEditing (void)" Notify the field's auditors that the image data has been modified\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.