SbImage - Online Linux Manual Page
Section : 3
Updated : Mon Jan 25 2021
Source : Version 2.5.0
Note : Coin
NAMESbImage − The SbImage class is an abstract datatype for 2D and 3D images.
SYNOPSIS
#include <Inventor/SbImage.h>
Public Member FunctionsSbImage (void)
SbImage (const unsigned char *bytes, const SbVec2s &size, const int bytesperpixel)
SbImage (const unsigned char *bytes, const SbVec3s &size, const int bytesperpixel)
~SbImage ()
void setValue (const SbVec2s &size, const int bytesperpixel, const unsigned char *bytes)
void setValue (const SbVec3s &size, const int bytesperpixel, const unsigned char *bytes)
void setValuePtr (const SbVec2s &size, const int bytesperpixel, const unsigned char *bytes)
void setValuePtr (const SbVec3s &size, const int bytesperpixel, const unsigned char *bytes)
unsigned char * getValue (SbVec2s &size, int &bytesperpixel) const
unsigned char * getValue (SbVec3s &size, int &bytesperpixel) const
SbVec3s getSize (void) const
SbBool readFile (const SbString &filename, const SbString *const *searchdirectories=NULL, const int numdirectories=0)
int operator== (const SbImage &image) const
int operator!= (const SbImage &image) const
SbImage & operator= (const SbImage &image)
SbBool hasData (void) const
void readLock (void) const
void readUnlock (void) const
SbBool scheduleReadFile (SbImageScheduleReadCB *cb, void *closure, const SbString &filename, const SbString *const *searchdirectories=NULL, const int numdirectories=0)
Static Public Member Functionsstatic SbString searchForFile (const SbString &basename, const SbString *const *dirlist, const int numdirs)
Detailed DescriptionThe SbImage class is an abstract datatype for 2D and 3D images. Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Since Coin 1.0
Constructor & Destructor Documentation
SbImage::SbImage (void)Default constructor.
SbImage::SbImage (const unsigned char * bytes, const SbVec2s & size, const int bytesperpixel)Constructor which sets 2D data using setValue(). See also setValue() References setValue().
SbImage::SbImage (const unsigned char * bytes, const SbVec3s & size, const int bytesperpixel)Constructor which sets 3D data using setValue(). This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
See also setValue() Since Coin 2.0 References setValue().
SbImage::~SbImage (void)Destructor.
Member Function Documentation
void SbImage::setValue (const SbVec2s & size, const int bytesperpixel, const unsigned char * bytes)Convenience 2D version of setValue. Referenced by operator=(), readFile(), SbImage(), scheduleReadFile(), and SoSFImage3::setValue().
void SbImage::setValue (const SbVec3s & size, const int bytesperpixel, const unsigned char * bytes)Sets the image to size and bytesperpixel. If bytes != NULL, data is copied from bytes into this class' image data. If bytes == NULL, the image data is left uninitialized. The image data will always be allocated in multiples of four. This means that if you set an image with size == (1,1,1) and bytesperpixel == 1, four bytes will be allocated to hold the data. This is mainly done to simplify the export code in SoSFImage and normally you'll not have to worry about this feature. If the depth of the image (size[2]) is zero, the image is considered a 2D image. Since Coin 2.0
void SbImage::setValuePtr (const SbVec2s & size, const int bytesperpixel, const unsigned char * bytes)Convenience 2D version of setValuePtr. See also setValue() Since Coin 2.0 Referenced by operator=(), and readFile().
void SbImage::setValuePtr (const SbVec3s & size, const int bytesperpixel, const unsigned char * bytes)Sets the image data without copying the data. bytes will be used directly, and the data will not be freed when the image instance is destructed. If the depth of the image (size[2]) is zero, the image is considered a 2D image. See also setValue() Since Coin 2.0
unsigned char * SbImage::getValue (SbVec2s & size, int & bytesperpixel) constReturns the 2D image data. References SbVec2s::setValue(). Referenced by SoSFImage3::getValue(), and SoSFImage3::startEditing().
unsigned char * SbImage::getValue (SbVec3s & size, int & bytesperpixel) constReturns the 3D image data. Since Coin 2.0
SbVec3s SbImage::getSize (void) constReturns the size of the image. If this is a 2D image, the z component is zero. If this is a 3D image, the z component is >= 1. Since Coin 2.0
SbBool SbImage::readFile (const SbString & filename, const SbString *const * searchdirectories = NULL, const int numdirectories = 0)Reads image data from filename. In Coin, simage is used to load image files, and several common file formats are supported. simage can be downloaded from our webpages. If loading fails for some reason this method returns FALSE, and the instance is set to an empty image. If the file is successfully loaded, the file image data is copied into this class. If numdirectories > 0, this method will search for filename in all directories in searchdirectories. References SbString::getLength(), SbString::getString(), SoDebugError::post(), SoDebugError::postWarning(), searchForFile(), setValue(), and setValuePtr().
int SbImage::operator== (const SbImage & image) constCompare image of image with the image in this class and return TRUE if they are equal. References readLock(), and readUnlock().
int SbImage::operator!= (const SbImage & image) const [inline]Compare image of image with the image in this class and return FALSE if they are equal.
SbImage & SbImage::operator= (const SbImage & image)Assignment operator. References setValue(), and setValuePtr().
SbString SbImage::searchForFile (const SbString & basename, const SbString *const * dirlist, const int numdirs) [static]Given a basename for a file and and array of directories to search (in dirlist, of length numdirs), returns the full name of the file found. In addition to looking at the root of each directory in dirlist, we also look into the subdirectories texture/, textures/, images/, pics/ and pictures/ of each dirlist directory. If no file matching basename could be found, returns an empty string. References SbPList::getLength(), and SoInput::searchForFile(). Referenced by readFile(), and scheduleReadFile().
SbBool SbImage::hasData (void) constReturns TRUE if the image is not empty. This can be useful, since getValue() will start loading the image if scheduleReadFile() has been used to set the image data. Since Coin 2.0 References readLock(), and readUnlock(). Referenced by SoVRMLImageTexture::doAction().
void SbImage::readLock (void) constApply a read lock on this image. This will make it impossible for other threads to change the image while this lock is active. Other threads can do read-only operations on this image, of course. For the single thread version of Coin, this method does nothing. See also readUnlock() Since Coin 2.0 Referenced by hasData(), and operator==().
void SbImage::readUnlock (void) constRelease a read lock on this image. For the single thread version of Coin, this method does nothing. See also readLock() Since Coin 2.0 Referenced by hasData(), and operator==().
SbBool SbImage::scheduleReadFile (SbImageScheduleReadCB * cb, void * closure, const SbString & filename, const SbString *const * searchdirectories = NULL, const int numdirectories = 0)Schedule a file for reading. cb will be called the first time getValue() is called for this image, and the callback should then start a thread to read the image. Do not read the image in the callback, as this will lock up the application. See also readFile() Since Coin 2.0 References searchForFile(), and setValue().
AuthorGenerated automatically by Doxygen for Coin from the source code. 0
Johanes Gumabo
Data Size : 43,574 byte
man-SbImage.3coin2Build : 2025-03-22, 13:26 :
Visitor Screen : x
Visitor Counter ( page / site ) : 15 / 1,386,965
Visitor ID : :
Visitor IP : 3.145.86.137 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 25.03.22
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.