osg.Image¶
-
class
osg.Image¶ Represents: c++ class Wraps: osg::Image Bases: osg.BufferDataImage class for encapsulating the storage texture image data.
Constructors:
-
osg.Image()¶
Methods:
-
:
setFileName(std.string fileName)¶ -
Parameters: fileName ( std.string) –
-
:
getFileName()¶ -
Return type: std.string
-
:
computeNumComponents()¶ Return the size in bytes of a block of compressed pixels.
Return type: int
-
:
width()¶ Width of image. Helper function internally calling
osg::Image::s().Return type: int
-
:
height()¶ -
Return type: int
-
:
depth()¶ Depth of image. Helper function internally calling
osg::Image::r().Return type: int
-
:
swap(osg.Image rhs)¶ Swap the data and settings between two image objects.
Parameters: rhs ( osg.Image) –
-
:
scaleImage(int s, int t, int r)¶ Scale image to specified size.
Parameters: - s (
int) – - t (
int) – - r (
int) –
- s (
-
:
setOrigin(osg.Image.Origin origin)¶ Set the origin of the image. The default value is
osg.Image.BOTTOM_LEFTand is consistent with OpenGL.osg.Image.TOP_LEFTis used for imagery that follows standard Imagery convention, such as movies, and hasn’t been flipped yet. For such images one much flip thetaxis of the tex coords to handle this origin position.Parameters: origin ( osg.Image.Origin) –
-
:
getOrigin()¶ Get the origin of the image.
Return type: osg.Image.Origin
-
:
setPixelFormat(GLenum.Value format)¶ -
Parameters: format ( GLenum.Value) –
-
:
getPixelFormat()¶ -
Return type: GLenum.Value
-
:
data()¶ -
Return type: uint64
-
:
setDataType(GLenum.Value format)¶ -
Parameters: format ( GLenum.Value) –
-
:
getDataType()¶ -
Return type: GLenum.Value
-
:
setInternalTextureFormat(GLenum.Value format)¶ -
Parameters: format ( GLenum.Value) –
-
:
getInternalTextureFormat()¶ -
Return type: GLenum.Value
-
:
getColor(osg.Vec2 texcoords)¶ Get the color value for specified texcoord.
Parameters: texcoords ( osg.Vec2) –Return type: osg.Vec4
-
:
getColor(double s, double t) -
Parameters: - s (
double) – - t (
double) –
Return type: - s (
-
:
getColor(double s, double t, double r) -
Parameters: - s (
double) – - t (
double) – - r (
double) –
Return type: - s (
-
:
setColor(osg.Vec4 color, osg.Vec2 texcoords)¶ Set the color value for specified texcoord. Note texcoord is clamped to edge.
Parameters:
-
:
setColor(osg.Vec4 color, double s, double t) Short version.
setColorcall with0asrargument.Parameters: - color (
osg.Vec4) – - s (
double) – - t (
double) –
- color (
-
:
setColor(osg.Vec4 color, double s, double t, double r) Set the color value for specified texcoord.
Parameters: - color (
osg.Vec4) – - s (
double) – - t (
double) – - r (
double) –
- color (
-
:
flipHorizontal()¶ Flip the image horizontally, around
sdimension.
-
:
flipVertical()¶ Flip the image vertically, around
tdimension.
-
:
supportsTextureSubloading()¶ Returns false for texture formats that do not support texture subloading.
Return type: bool
-
:
isImageTranslucent()¶ Return
trueif this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized).Return type: bool
-
:
setPixelBufferObject(osg.PixelBufferObject buffer)¶ Set the optional
osg.PixelBufferObjectused to map the image memory efficiently to graphics memory.Parameters: buffer ( osg.PixelBufferObject) –
-
:
getPixelBufferObject()¶ Get the
osg.PixelBufferObject.Return type: osg.PixelBufferObject
-
:
requiresUpdateCall()¶ Return whether the update(NodeVisitor* nv) should be required on each frame to enable proper working of
osg.Image.Return type: bool
-
:
setAllocationMode(osg.Image.AllocationMode mode)¶ Set the method used for deleting data once it goes out of scope.
Parameters: mode ( osg.Image.AllocationMode) –
-
:
getAllocationMode()¶ Get the method used for deleting data once it goes out of scope.
Return type: osg.Image.AllocationMode
-
:
allocateImage(int s, int t, int r, GLenum.Value pixelFormat, GLenum.Value type, int packing)¶ Allocate a pixel block of specified size and type.
Parameters: - s (
int) – - t (
int) – - r (
int) – - pixelFormat (
GLenum.Value) – - type (
GLenum.Value) – - packing (
int) –
- s (
-
:
allocateImage(int s, int t, int r, GLenum.Value pixelFormat, GLenum.Value type) Short version.
allocateImagecall with1aspackingargument.Parameters: - s (
int) – - t (
int) – - r (
int) – - pixelFormat (
GLenum.Value) – - type (
GLenum.Value) –
- s (
-
:
readPixels(int x, int y, int width, int height, GLenum.Value pixelFormat, GLenum.Value type)¶ Read pixels from current frame buffer at specified position and size, using
glReadPixels(https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glReadPixels.xml). Create memory for storage if required, reuse existing pixel coords if possible.Parameters: - x (
int) – - y (
int) – - width (
int) – - height (
int) – - pixelFormat (
GLenum.Value) – - type (
GLenum.Value) –
- x (
-
:
copySubImage(int s_offset, int t_offset, int r_offset, osg.Image source)¶ Copy a source
osg.Imageinto a subpart of thisosg.Imageat specified position. Typically used to copy to an already allocated image, such as creating a 3D image from a stack 2D images. If this Image is empty then image data is created to accommodate the source image in its offset position. If source isnilthen no operation happens, thisosg.Imageis left unchanged.Parameters: - s_offset (
int) – - t_offset (
int) – - r_offset (
int) – - source (
osg.Image) –
- s_offset (
-