osg.Image

class osg.Image
Represents:c++ class
Wraps:osg::Image
Bases:osg.BufferData

Image class for encapsulating the storage texture image data.

Constructors:

osg.Image()

Methods:

:setFileName(std.string fileName)

Параметры:fileName (std.string) –
:getFileName()

Тип результата:std.string
:computeNumComponents()

Return the size in bytes of a block of compressed pixels.

Тип результата:int
:width()

Width of image. Helper function internally calling osg::Image::s().

Тип результата:int
:height()

Тип результата:int
:depth()

Depth of image. Helper function internally calling osg::Image::r().

Тип результата:int
:swap(osg.Image rhs)

Swap the data and settings between two image objects.

Параметры:rhs (osg.Image) –
:scaleImage(int s, int t, int r)

Scale image to specified size.

Параметры:
  • s (int) –
  • t (int) –
  • r (int) –
:setOrigin(osg.Image.Origin origin)

Set the origin of the image. The default value is osg.Image.BOTTOM_LEFT and is consistent with OpenGL. osg.Image.TOP_LEFT is used for imagery that follows standard Imagery convention, such as movies, and hasn’t been flipped yet. For such images one much flip the t axis of the tex coords to handle this origin position.

Параметры:origin (osg.Image.Origin) –
:getOrigin()

Get the origin of the image.

Тип результата:osg.Image.Origin
:setPixelFormat(GLenum.Value format)

Параметры:format (GLenum.Value) –
:getPixelFormat()

Тип результата:GLenum.Value
:data()

Тип результата:uint64
:setDataType(GLenum.Value format)

Параметры:format (GLenum.Value) –
:getDataType()

Тип результата:GLenum.Value
:setInternalTextureFormat(GLenum.Value format)

Параметры:format (GLenum.Value) –
:getInternalTextureFormat()

Тип результата:GLenum.Value
:getColor(osg.Vec2 texcoords)

Get the color value for specified texcoord.

Параметры:texcoords (osg.Vec2) –
Тип результата:osg.Vec4
:getColor(double s, double t)

Параметры:
  • s (double) –
  • t (double) –
Тип результата:

osg.Vec4

:getColor(double s, double t, double r)

Параметры:
  • s (double) –
  • t (double) –
  • r (double) –
Тип результата:

osg.Vec4

:setColor(osg.Vec4 color, osg.Vec2 texcoords)

Set the color value for specified texcoord. Note texcoord is clamped to edge.

Параметры:
:setColor(osg.Vec4 color, double s, double t)

Short version. setColor call with 0 as r argument.

Параметры:
  • color (osg.Vec4) –
  • s (double) –
  • t (double) –
:setColor(osg.Vec4 color, double s, double t, double r)

Set the color value for specified texcoord.

Параметры:
  • color (osg.Vec4) –
  • s (double) –
  • t (double) –
  • r (double) –
:flipHorizontal()

Flip the image horizontally, around s dimension.

:flipVertical()

Flip the image vertically, around t dimension.

:supportsTextureSubloading()

Returns false for texture formats that do not support texture subloading.

Тип результата:bool
:isImageTranslucent()

Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized).

Тип результата:bool
:setPixelBufferObject(osg.PixelBufferObject buffer)

Set the optional osg.PixelBufferObject used to map the image memory efficiently to graphics memory.

Параметры:buffer (osg.PixelBufferObject) –
:getPixelBufferObject()

Get the osg.PixelBufferObject.

Тип результата:osg.PixelBufferObject
:requiresUpdateCall()

Return whether the update(NodeVisitor* nv) should be required on each frame to enable proper working of osg.Image.

Тип результата:bool
:setAllocationMode(osg.Image.AllocationMode mode)

Set the method used for deleting data once it goes out of scope.

Параметры:mode (osg.Image.AllocationMode) –
:getAllocationMode()

Get the method used for deleting data once it goes out of scope.

Тип результата: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.

Параметры:
:allocateImage(int s, int t, int r, GLenum.Value pixelFormat, GLenum.Value type)

Short version. allocateImage call with 1 as packing argument.

Параметры:
: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.

Параметры:
:copySubImage(int s_offset, int t_offset, int r_offset, osg.Image source)

Copy a source osg.Image into a subpart of this osg.Image at 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 is nil then no operation happens, this osg.Image is left unchanged.

Параметры:
  • s_offset (int) –
  • t_offset (int) –
  • r_offset (int) –
  • source (osg.Image) –