Package com.openinventor.inventor.image
Class SbRasterImage
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.image.SbRasterImage
-
public class SbRasterImage extends Inventor
Class encapsulating a raster image and its attributes. This class encapsulates a raster image, including its size and number of color components.- See Also:
SoRasterImageRW
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SbRasterImage.Components
Components type.static class
SbRasterImage.CopyPolicies
Copy policy.-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SbRasterImage()
Constructor that creates an empty image.SbRasterImage(SbVec2i32 size, SbRasterImage.Components components, byte[] bytes)
Deprecated.As of Open Inventor 9400.SbRasterImage(SbVec2i32 size, SbRasterImage.Components components, SoBufferObject bufferObject)
Constructor that initializes with an image.SbRasterImage(SbVec2s size, SbRasterImage.Components components, byte[] bytes)
Deprecated.As of Open Inventor 9400.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]
getBuffer()
Deprecated.As of Open Inventor 9400.SoBufferObject
getBufferObject()
Returns the pixel buffer of the raster image.SbRasterImage.Components
getComponents()
Returns the number of components of each pixel as an enum.int
getComponentsCount()
Returns the number of components of each pixel.int
getComponentsSize()
Returns the size in bytes of each pixel in the image.SbRasterImage.CopyPolicies
getCopyPolicy()
Returns the current buffer copy policy.int
getNumMipmaps()
Returns the number of mipmaps contained by the buffer.SbVec2s
getSize()
Returns the raster image size in pixels.SbVec2i32
getSizei32()
Returns the raster image size in pixels for large images.boolean
removeAlphaChannel()
Removes the Alpha channel from the current raster image.void
setBuffer(SoBufferObject bufferObject)
Sets the pixel buffer of the raster image.void
setComponents(SbRasterImage.Components comp)
Sets the number of components in each pixel of the raster image.void
setSize(SbVec2s size)
Sets the raster image size in pixels.void
setSizei32(SbVec2i32 size)
Sets the raster image size in pixels.-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SbRasterImage
public SbRasterImage(SbVec2i32 size, SbRasterImage.Components components, SoBufferObject bufferObject)
Constructor that initializes with an image. Image data is assumed to be packed (no padding between pixels or rows) and pixel components are assumed to be in RGBA order.
-
SbRasterImage
public SbRasterImage()
Constructor that creates an empty image.
-
SbRasterImage
@Deprecated public SbRasterImage(SbVec2i32 size, SbRasterImage.Components components, byte[] bytes)
Deprecated.As of Open Inventor 9400. Use SbRasterImage constructor with SoBufferObject instead.Constructor that initializes with a large image.Warning Deprecated since Open Inventor 9400. Use
SbRasterImage
constructor withSoBufferObject
instead.
-
SbRasterImage
@Deprecated public SbRasterImage(SbVec2s size, SbRasterImage.Components components, byte[] bytes)
Deprecated.As of Open Inventor 9400. Use SbRasterImage constructor with SoBufferObject instead.Constructor that initializes with an image.Warning Deprecated since Open Inventor 9400. Use
SbRasterImage
constructor withSoBufferObject
instead.
-
-
Method Detail
-
setSize
public void setSize(SbVec2s size)
Sets the raster image size in pixels.
The parameter is the size of the whole raster image. The maximum size that can be specified using this method is 32767 by 32767 (because the parameter is anSbVec2s
). To specify a larger image size use the method setSize_i32.
-
getBuffer
@Deprecated public byte[] getBuffer()
Deprecated.As of Open Inventor 9400. Use SbRasterImage.getBufferObject() instead.Returns the pixel buffer of the raster image.Warning Deprecated since Open Inventor 9400. Use
SbRasterImage.getBufferObject()
instead.
-
getComponents
public SbRasterImage.Components getComponents()
Returns the number of components of each pixel as an enum.
For example, an RGBA image returns RGB_TRANSPARENCY.
-
getCopyPolicy
public SbRasterImage.CopyPolicies getCopyPolicy()
Returns the current buffer copy policy.
-
setComponents
public void setComponents(SbRasterImage.Components comp)
Sets the number of components in each pixel of the raster image.
For example, an RGB image has 3 components.
-
getNumMipmaps
public int getNumMipmaps()
Returns the number of mipmaps contained by the buffer.
-
getComponentsCount
public int getComponentsCount()
Returns the number of components of each pixel.
Returns -1 in case of invalid or unknown components type.E.g: For an RGB image it returns 3 (R, G and B).
-
getBufferObject
public SoBufferObject getBufferObject()
Returns the pixel buffer of the raster image.
-
getComponentsSize
public int getComponentsSize()
Returns the size in bytes of each pixel in the image.
Returns -1 in case of invalid or unknown components type.E.g: For an RGB image containing byte data, the pixel size is 3 bytes.
-
setSizei32
public void setSizei32(SbVec2i32 size)
Sets the raster image size in pixels.
The parameter is the size of the whole raster image to be saved. Use for sizes with at least one side greater than 32767.
-
setBuffer
public void setBuffer(SoBufferObject bufferObject)
Sets the pixel buffer of the raster image.
Image data is assumed to be packed (no padding between pixels or rows) and pixel components are assumed to be in RGBA order.
-
getSize
public SbVec2s getSize()
Returns the raster image size in pixels.
-
removeAlphaChannel
public boolean removeAlphaChannel()
Removes the Alpha channel from the current raster image. If the copy policy is COPY (Open Inventor owns the memory) then the buffer is reallocated with the correct size. Otherwise the content of the buffer is just modified.- Returns:
- True if the format contains an alpha channel and it was possible to remove it.
-
getSizei32
public SbVec2i32 getSizei32()
Returns the raster image size in pixels for large images.
-
-