vmm3d.core
Class Filmstrip
- java.lang.Object
-
- vmm3d.core.Filmstrip
-
public class Filmstrip extends java.lang.ObjectA Filmstrip is just a sequence of images. It is possible for some of the images in the Filmstrip to be null. The images are numbered starting at zero. There is no preset limit on the number of images.
-
-
Constructor Summary
Constructors Constructor and Description Filmstrip()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.image.BufferedImagegetFrame(int frameNumber)Returns the image at at a specified position in the filmstrip.intgetFrameCount()Returns the current number of frames in the filmstrip.static intmaxFrames(int width, int height, boolean color)Attempts to determine how many filmstrip frames an still be created with a specified size.voidsetFrame(int frameNumber, java.awt.image.BufferedImage image)Sets a specified frame in the filmstrip to a given image.voidstripNullFrames()Removes any frames for which the image is null from the filmstrip.
-
-
-
Method Detail
-
maxFrames
public static int maxFrames(int width, int height, boolean color)Attempts to determine how many filmstrip frames an still be created with a specified size. This is not necessarily going to give an exact value; the value is likely to be an underestimate.- Parameters:
width- the width in pixels of the imagesheight- the height in pixels of the imagescolor- are the images to be colored (4 bytes per pixel) or black and white (1 byte per pixel)?- See Also:
Util.availableMemory()
-
setFrame
public void setFrame(int frameNumber, java.awt.image.BufferedImage image)Sets a specified frame in the filmstrip to a given image. If frameNumber is less than the current filmstrip size, then the current frame at position frameNumber is replaced. Otherwise the size of the filmstrip is increased to (frameNumber+1) and the image is then stored in position frameNumber as the last frame in the filmstrip. Any extra locations that are created are filled with nulls.- Parameters:
frameNumber- The position in the filmstrip where the image is to be added. An error occurs if this is less than zero.image- The image that is to be put at postion frameNumber in the filmstrip. This can be null.
-
getFrameCount
public int getFrameCount()
Returns the current number of frames in the filmstrip.
-
getFrame
public java.awt.image.BufferedImage getFrame(int frameNumber)
Returns the image at at a specified position in the filmstrip. The return value can be null.- Parameters:
frameNumber- The number of the frame that is to be returned. An error occurs if this is not greater than or equal to zero and less thangetFrameCount().
-
stripNullFrames
public void stripNullFrames()
Removes any frames for which the image is null from the filmstrip.
-
-
DMelt 3.0 © DataMelt by jWork.ORG