53#include <Inventor/SbDataType.h>
54#include <Inventor/SbLinear.h>
55#include <Inventor/SbPList.h>
56#include <Inventor/fields/SoSubField.h>
57#include <Inventor/sys/SoGLType.h>
58#include <Inventor/devices/SoBufferObject.h>
59#include <Inventor/devices/SoCpuBufferObject.h>
63#pragma warning(disable:4251)
281 const unsigned char *bytes,
285 const unsigned char *bytes,
319 unsigned char *bytes);
325 unsigned char *bytes);
341 int num,
void **data);
347 int num,
void **data);
358 int num,
unsigned char **subBytes);
365 int num,
unsigned char **subBytes);
377 {
return ! ((*this) == f); }
470 {
return m_neverWrite ; }
501 return m_numComponents;
506 static void initClass();
507 static void exitClass();
508 void resetSubTextures();
526 void setHasTransparency( HasTransparency status );
528 const SbVec2i32& getSize()
const
544 unsigned char* m_buffer;
547 SoRef<SoBufferObject> m_bufferObject;
552 SoRef<SoCpuBufferObject> m_cpuBufferObject;
557 SbPList m_subTexList;
561 int m_hasTransparency;
563 HasTransparency m_hasTransparencyState;
567 unsigned int getImageValueSize()
const;
570 virtual SbBool readValue(SoInput *in);
571 virtual void writeValue(SoOutput *out)
const;
572 void deleteBytesArray();
577 SoBufferObject* bufferObject,
CopyPolicy copy);
579 const void*
getValue(int32_t &w, int32_t &h ,
int &nc,
DataType &dataType)
const;
586SoSFImage::getBufferObject()
const
588 return m_bufferObject.ptr();
@ UNSIGNED_INT32
unsigned int (32bits)
@ UNSIGNED_BYTE
unsigned byte
@ SIGNED_SHORT
signed short
@ UNSIGNED_SHORT
unsigned short
@ SIGNED_INT32
signed int (32bits)
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class encapsulat...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
void setSubValues(const SbVec2s *subSizes, const SbVec2s *offsets, int num, void **data)
This method can be used for subtexturing.
SbRasterImage * toRasterImage(bool downSample=true) const
Returns an instance of SbRasterImage filled with the content of this field.
void * startEditing(SbVec2s &size, int &nc, DataType &dataType)
This method (along with finishEditing()) can be used to efficiently edit the values in an image field...
void setValue(const SbVec2i32 &size, int nc, DataType dataType, const void *data, CopyPolicy copy=COPY)
DataType getDataType() const
Returns image's data type.
void setValue(const SbVec2i32 &size, int nc, const unsigned char *bytes, CopyPolicy copy=COPY)
unsigned char * getSubTexture(int index, SbVec2i32 &size, SbVec2i32 &offset)
const unsigned char * getValue(SbVec2s &size, int &nc) const
Same as above.
int getNumComponents() const
Returns image's number of components.
const void * getValue(SbVec2i32 &size, int &nc, DataType &dataType) const
SoSFImage(const SoSFImage &obj)
Copy constructor.
void setValue(const SbVec2i32 &size, int nc, DataType dataType, SoBufferObject *bufferObject, CopyPolicy copy=COPY)
void * getSubTexture(int index, SbVec2s &size, SbVec2s &offset, DataType &dataType)
Returns a buffer of a given subTexture set by setSubValue(), setSubValues() or a startEditing()/finis...
SoSFImage()
Default constructor.
unsigned char * startEditing(SbVec2s &size, int &nc)
Same as above.
void finishEditing()
This method (along with startEditing())can be used to efficiently edit the values in an image field.
void setValue(const SbVec2s &size, int nc, DataType dataType, SoBufferObject *bufferObject, CopyPolicy copy=COPY)
int operator!=(const SoSFImage &f) const
Inequality test.
void * startEditing(SbVec2i32 &size, int &nc, DataType &dataType)
void setValue(const SbVec2s &size, int nc, const unsigned char *bytes, CopyPolicy copy=COPY)
Same as above.
void setSubValue(const SbVec2i32 &subSize, const SbVec2i32 &offset, void *data)
SbBool isNeverWrite()
Queries the "neverWrite" flag.
CopyPolicy
SoSFImage may be manipulating some large amounts of memory.
@ NO_COPY
Passed buffer used , user will delete .
@ COPY
Open Inventor will make a copy of the data (default)
@ NO_COPY_AND_DELETE
Passed buffer used, SoSFImage will delete.
@ NO_COPY_AND_FREE
Passed buffer used, SoSFImage will free.
DataType
Encoding data type.
@ SIGNED_SHORT
SIGNED_SHORT.
@ UNSIGNED_SHORT
UNSIGNED_SHORT.
@ UNSIGNED_INT32
UNSIGNED_INT32.
@ SIGNED_INT32
SIGNED_INT32.
@ SIGNED_BYTE
SIGNED_BYTE.
@ UNSIGNED_BYTE
UNSIGNED_BYTE.
const unsigned char * getValue(SbVec2i32 &size, int &nc) const
const void * getValue(SbVec2s &size, int &nc, DataType &dataType) const
Returns the pixels in the image as an array of values of type <dataType>.
void setValue(const SbVec2s &size, int nc, DataType dataType, const void *data, CopyPolicy copy=COPY)
Sets the value of this field to be an image of the given size, with the given number of components,...
SbBool hasTransparency() const
Returns TRUE if the image contains any transparent pixels.
unsigned char * getSubTexture(int index, SbVec2s &size, SbVec2s &offset)
Same as above.
void setSubValues(const SbVec2i32 *subSizes, const SbVec2i32 *offsets, int num, unsigned char **subBytes)
void setSubValue(const SbVec2s &subSize, const SbVec2s &offset, unsigned char *bytes)
Same as above.
void setNeverWrite(SbBool neverWrite)
Sets the "neverWrite" flag.
int operator==(const SoSFImage &f) const
Equality test.
void * getSubTexture(int index, SbVec2i32 &size, SbVec2i32 &offset, DataType &dataType)
void setSubValue(const SbVec2i32 &subSize, const SbVec2i32 &offset, unsigned char *bytes)
SbBool hasSubTextures(int &numSubTextures)
Returns TRUE if subTextures have been defined or FALSE if none have been defined.
unsigned char * startEditing(SbVec2i32 &size, int &nc)
void setSubValues(const SbVec2s *subSizes, const SbVec2s *offsets, int num, unsigned char **subBytes)
Same as above.
void setSubValues(const SbVec2i32 *subSizes, const SbVec2i32 *offsets, int num, void **data)
void setSubValue(const SbVec2s &subSize, const SbVec2s &offset, void *data)
This method can be used for subtexturing.