Package com.openinventor.inventor.image
Class SbRasterImage
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.image.SbRasterImage
Class encapsulating a raster image and its attributes.
This class encapsulates a raster image, including its size and number of color components.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Components type.static enum
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
ConstructorsConstructorDescriptionConstructor that creates an empty image.SbRasterImage
(SbVec2i32 size, SbRasterImage.Components components, byte[] bytes) Deprecated.As of Open Inventor 9.4.0.0.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 9.4.0.0. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Deprecated.As of Open Inventor 9.4.0.0.Returns the pixel buffer of the raster image.Returns the number of components of each pixel as an enum.int
Returns the number of components of each pixel.int
Returns the size in bytes of each pixel in the image.Returns the current buffer copy policy.int
Returns the number of mipmaps contained by the buffer.getSize()
Returns the raster image size in pixels.Returns the raster image size in pixels for large images.boolean
Removes the Alpha channel from the current raster image.void
setBuffer
(SoBufferObject bufferObject) Sets the pixel buffer of the raster image.void
Sets the number of components in each pixel of the raster image.void
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 Details
-
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(since="9.4.0.0") public SbRasterImage(SbVec2i32 size, SbRasterImage.Components components, byte[] bytes) Deprecated.As of Open Inventor 9.4.0.0. 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(since="9.4.0.0") public SbRasterImage(SbVec2s size, SbRasterImage.Components components, byte[] bytes) Deprecated.As of Open Inventor 9.4.0.0. Use SbRasterImage constructor with SoBufferObject instead.Constructor that initializes with an image.Warning Deprecated since Open Inventor 9400. Use
SbRasterImage
constructor withSoBufferObject
instead.
-
-
Method Details
-
setSize
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.As of Open Inventor 9.4.0.0. Use SbRasterImage.getBufferObject() instead.Returns the pixel buffer of the raster image.Warning Deprecated since Open Inventor 9400. Use
SbRasterImage.getBufferObject()
instead. -
getComponents
Returns the number of components of each pixel as an enum.
For example, an RGBA image returns RGB_TRANSPARENCY. -
getCopyPolicy
Returns the current buffer copy policy. -
setComponents
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
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
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
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
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
Returns the raster image size in pixels for large images.
-