Package org.web3d.util
Class SFImageUtils
java.lang.Object
org.web3d.util.SFImageUtils
Utility class for dealing with converting image data to and from the SFImage
integer format.
- Version:
- $Revision: 1.5 $
- Author:
- Bradley Vender, Rex Melton
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WritableRenderedImageconvertDataToRenderedImage(int width, int height, int components, int[] pixels) Utility method to convert SFImage data representation to a WritableRenderedImagestatic voidconvertRenderedImageToData(RenderedImage img, int[] targetArray, int startOffset) Utility method for MFImageWrapper and SFImageWrapper to convert a RenderedImage to the SFImage integer formatstatic voidconvertSubRenderedImageToData(RenderedImage img, int[] targetArray, int startOffset, int srcWidth, int srcHeight, int srcXOffset, int srcYOffset, int destXOffset, int destYOffset) Perform a bitBlt from a source image to an SFImage field.
-
Constructor Details
-
SFImageUtils
public SFImageUtils()
-
-
Method Details
-
convertRenderedImageToData
public static void convertRenderedImageToData(RenderedImage img, int[] targetArray, int startOffset) Utility method for MFImageWrapper and SFImageWrapper to convert a RenderedImage to the SFImage integer format- Parameters:
img- The rendered image to converttargetArray- The integer array to place the data instartOffset- Starting offset in array
-
convertSubRenderedImageToData
public static void convertSubRenderedImageToData(RenderedImage img, int[] targetArray, int startOffset, int srcWidth, int srcHeight, int srcXOffset, int srcYOffset, int destXOffset, int destYOffset) Perform a bitBlt from a source image to an SFImage field. Does not do wrapping.- Parameters:
img- The image the sample is taken fromtargetArray- The array containing the target fieldstartOffset- The index where the target field startssrcWidth- The width of the sub image to copysrcHeight- The height of the sub image to copysrcXOffset- The X offset of the sub image to copysrcYOffset- The Y offset of the sub image to copydestXOffset- The destination X offsetdestYOffset- The destination Y offset
-
convertDataToRenderedImage
public static WritableRenderedImage convertDataToRenderedImage(int width, int height, int components, int[] pixels) Utility method to convert SFImage data representation to a WritableRenderedImage- Parameters:
width- The image widthheight- The image heightcomponents- The number of components per pixelpixels- The array of pixel data- Returns:
-