SoGLBigImage(3)
π NAME π
SoGLBigImage β bestie, this is the class that handles 2D OpenGL textures of any size. Any. Size. Periodt. It lives in the Coin manual, section 3. π
β¨ SYNOPSIS β¨
#include <include/Inventor/misc/SoGLBigImage.h>
Inherits SoGLImage. It's giving "I'm the big sister class." π
π«Ά Public Member Functions
SoGLBigImage ()virtual void unref (SoState *state=NULL)virtual SoType getTypeId (void) constvirtual void setData (const SbImage *image, const Wrap wraps=REPEAT, const Wrap wrapt=REPEAT, const float quality=0.5f, const int border=0, SoState *createinstate=NULL)virtual void setData (const SbImage *image, const Wrap wraps, const Wrap wrapt, const Wrap wrapr, const float quality=0.5f, const int border=0, SoState *createinstate=NULL)int initSubImages (const SbVec2s &subimagesize) constvoid handleSubImage (const int idx, SbVec2f &start, SbVec2f &end, SbVec2f &tcmul)void applySubImage (SoState *state, const int idx, const float quality, const SbVec2s &projsize)SbBool exceededChangeLimit (void)virtual SoGLDisplayList * getGLDisplayList (SoState *state)
πΈ Public Member Functions inherited from SoGLImage
SoGLImage ()virtual SbBool isOfType (SoType type) constvoid setGLDisplayList (SoGLDisplayList *dl, SoState *state, const Wrap wraps=REPEAT, const Wrap wrapt=REPEAT, const float quality=0.5f)void setPBuffer (SoState *state, void *context, const Wrap wraps=REPEAT, const Wrap wrapt=REPEAT, const float quality=0.5f)void setData (const unsigned char *bytes, const SbVec2s &size, const int numcomponents, const Wrap wraps=REPEAT, const Wrap wrapt=REPEAT, const float quality=0.5f, const int border=0, SoState *createinstate=NULL)void setData (const unsigned char *bytes, const SbVec3s &size, const int numcomponents, const Wrap wraps=REPEAT, const Wrap wrapt=REPEAT, const Wrap wrapr=REPEAT, const float quality=0.5f, const int border=0, SoState *createinstate=NULL)void setFlags (const uint32_t flags)uint32_t getFlags (void) constconst SbImage * getImage (void) constSbBool hasTransparency (void) constSbBool useAlphaTest (void) constWrap getWrapS (void) constWrap getWrapT (void) constWrap getWrapR (void) constfloat getQuality (void) constuint32_t getGLImageId (void) constvoid setEndFrameCallback (void(*cb)(void *), void *closure)int getNumFramesSinceUsed (void) const
π¦ Static Public Member Functions
static SoType getClassTypeId (void)static int setChangeLimit (const int limit)static void initClass (void)
π Static Public Member Functions inherited from SoGLImage
static SoType getClassTypeId (void)static void beginFrame (SoState *state)static void tagImage (SoState *state, SoGLImage *image)static void endFrame (SoState *state)static void setDisplayListMaxAge (const uint32_t maxage)static void freeAllImages (SoState *state=NULL)static void initClass (void)static void setResizeCallback (SoGLImageResizeCB *f, void *closure)
π Protected Member Functions
virtual void unrefOldDL (SoState *state, const uint32_t maxage)
π Protected Member Functions inherited from SoGLImage
void incAge (void) constvoid resetAge (void) constvirtual ~SoGLImage ()
β Additional Inherited Members
Public Types inherited from SoGLImage
enum Wrap { REPEAT = 0, CLAMP, CLAMP_TO_EDGE, CLAMP_TO_BORDER }enum ResizeReason { IMAGE = 0, SUBIMAGE, MIPMAP }enum Flags { SCALE_DOWN = 0x0001, NO_MIPMAP = 0x0002, LINEAR_MAG_FILTER = 0x0004, LINEAR_MIN_FILTER = 0x0008, LINEAR_MIPMAP_FILTER = 0x0010, FORCE_TRANSPARENCY_TRUE = 0x0020, FORCE_TRANSPARENCY_FALSE = 0x0040, FORCE_ALPHA_TEST_TRUE = 0x0080, FORCE_ALPHA_TEST_FALSE = 0x0100, INVINCIBLE = 0x0200, RECTANGLE = 0x0400, COMPRESSED = 0x0800, USE_QUALITY_VALUE = 0X8000 }typedef SbBool SoGLImageResizeCB(SoState *state, const SbVec3s &newsize, unsigned char *destbuffer, ResizeReason reason, void *closure, class SoGLImage *image)
π Detailed Description π
So the SoGLBigImage class handles 2D OpenGL textures of any size. No cap. β¨
Okay so heads up bestie: this class is internal. If you wanna turn big-image texture handling on or off, you go through the SoTextureScalePolicy node instead. That's the move. π
The technique it uses is literally iconic, so let me break it down:
- Split the texture into x*y equal size blocks.
- All these subtextures are of size 2^n, and they're typically quite small (256x256 or smaller).
- Each triangle gets clipped, based on the texture coordinates, into several smaller triangles.
- The triangles are then guaranteed to use only one subtexture.
- Then the triangles are projected onto the screen, and the maximum projected size for each subtexture is calculated.
- Subtextures outside the viewport get culled. Bye bestie. π
- Each subtexture is then sampled down to a 2^n value close to the projected size, and a GL texture is created with this size.
- That GL texture is used when rendering triangles that are clipped into that subtexture.
Mipmapping is disabled for SoGLBigImage. Aliasing problems shouldn't occur, because the projected size of the texture is calculated on the fly. When mipmapping is enabled, the amount of texture memory used is doubled, and creating the texture object is much slower β so we avoid this for SoGLBigImage. It's just not the vibe. π
β οΈ Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. Don't come for me, I'm just the messenger. π
Since
Coin 2.0 πΈ
π Constructor & Destructor Documentation π
SoGLBigImage::SoGLBigImage (void )
Constructor. It constructs. Iconic behaviour, honestly. β¨
π Member Function Documentation π
void SoGLBigImage::unref (SoState * state = NULL) [virtual]
This class has a private destructor, since we want users to supply the current GL state when deleting the image. Why? To make sure GL texture objects are freed as soon as possible. Responsible queen behaviour. π
If you supply NULL to this method, the GL texture objects won't be deleted until the next time an GLRenderAction is applied in the image's cache context(s).
Reimplemented from SoGLImage.
SoType SoGLBigImage::getClassTypeId (void ) [static]
This static method returns the SoType object associated with objects of this class. Classic. π«Ά
SoType SoGLBigImage::getTypeId (void ) const [virtual]
Returns the type identification of an object derived from a class inheriting SoGLImage. This is used for runtime type checking and "downward" casting. It's giving type-system main character energy. β
Reimplemented from SoGLImage.
void SoGLBigImage::setData (const SbImage * image, const Wrap wraps = REPEAT, const Wrap wrapt = REPEAT, const float quality = 0.5f, const int border = 0, SoState * createinstate = NULL) [virtual]
Convenience 2D wrapper function around the 3D setData(). Lowkey just a little shortcut, and we love her for it. π
Reimplemented from SoGLImage.
void SoGLBigImage::setData (const SbImage * image, const Wrap wraps, const Wrap wrapt, const Wrap wrapr, const float quality = 0.5f, const int border = 0, SoState * createinstate = NULL) [virtual]
Sets the data for this GL image. Only call this when one of the parameters have changed, because it will cause the GL texture object to be recreated. Don't be out here calling it for fun. π€
Caller is responsible for sending legal wrap values. CLAMP_TO_EDGE is only supported on OpenGL v1.2 implementations, and as an extension on some earlier SGI implementations (GL_SGIS_texture_edge_clamp).
For now, if quality > 0.5 when created, we create mipmaps, otherwise a regular texture is created. Be aware: if you for instance create a texture with texture quality 0.4, and then later try to apply the texture with a texture quality greater than 0.5, the texture object will be recreated as a mipmap texture object. This will happen only once though, of course. We're not doing that twice, bestie.
If border != 0, the OpenGL texture will be created with this border size.
β οΈ Be aware that this might be extremely slow on most PC hardware. Like, painfully slow. Consider yourself warned. π
Normally, the OpenGL texture object isn't created until the first time it is needed β but if createinstate is != NULL, the texture object is created immediately. This is useful if you use a temporary buffer to hold the texture data.
β οΈ Be careful when using this feature, since the texture data might be needed at a later stage (for instance to create a texture object for another context). It will not be possible to create texture objects for other cache contexts when createinstate is != NULL.
Also, if createinstate is supplied, and all the attributes are the same as the current data in the image, glTexSubImage() will be used to insert the image data instead of creating a new texture object. This is much faster on most OpenGL drivers, and is very useful β for instance when doing animated textures. Slay. π₯
If you supply NULL for image, the instance will be reset, causing all display lists and memory to be freed. Clean slate, fresh start. π¦
Reimplemented from SoGLImage.
SbBool SoGLBigImage::exceededChangeLimit (void )
To avoid doing too much work in one frame, there is a limit on the number of subtextures that can be changed each frame. If this limit is exceeded, this function returns TRUE, otherwise FALSE. It's the vibe check for "bestie, you're doing too much." β
See also
setChangeLimit()
int SoGLBigImage::setChangeLimit (const int limit) [static]
Sets the change limit. Returns the old limit. Out with the old, in with the new. π
See also
exceededChangeLimit()
Since
Coin 2.3 πΈ
SoGLDisplayList * SoGLBigImage::getGLDisplayList (SoState * state) [virtual]
Returns or creates a SoGLDisplayList to be used for rendering. Returns NULL if no SoGLDisplayList could be created. Sometimes the answer is just no, and that's valid. π
Reimplemented from SoGLImage.
void SoGLBigImage::unrefOldDL (SoState * state, const uint32_t maxage) [protected], [virtual]
Virtual method that will be called once each frame. The method should unref display lists that have an age bigger or equal to maxage, and increment the age for other display lists. It's giving "spring cleaning but every frame." π§Ήβ¨
Reimplemented from SoGLImage.
void SoGLBigImage::initClass (void ) [static]
This static method initializes static data for the SoGLBigImage class. Gotta set up before the party starts. π
πΈ Author πΈ
Generated automatically by Doxygen for Coin from the source code. The robots did this one, not me. π€π
Okay bestie, that's the whole page β this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and you just read SoGLBigImage(3). Thanks for scrolling all the way down with me, you're literally the main character. π«Άβ¨ Bye! π
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms