class J2DTexture extends BaseTexture<J2DTexture.J2DTexResource>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
J2DTexture.J2DTexResource |
Texture.Usage, Texture.WrapMode
Modifier and Type | Field and Description |
---|---|
private PixelSetter |
setter |
contentHeight, contentWidth, resource
Constructor and Description |
---|
J2DTexture(java.awt.image.BufferedImage bimg,
PixelFormat format,
PixelSetter setter,
Texture.WrapMode wrapMode) |
J2DTexture(J2DTexture sharedTex,
Texture.WrapMode altMode) |
Modifier and Type | Method and Description |
---|---|
(package private) static J2DTexture |
create(PixelFormat format,
Texture.WrapMode wrapMode,
int w,
int h) |
protected Texture |
createSharedTexture(Texture.WrapMode newMode)
Create a new version of this texture which shares the same
ManagedResource reference. |
(package private) java.awt.image.BufferedImage |
getBufferedImage() |
private static java.nio.Buffer |
getDstBuffer(java.awt.image.BufferedImage bimg) |
private static PixelGetter |
getGetter(PixelFormat format) |
void |
update(java.nio.Buffer buffer,
PixelFormat format,
int dstx,
int dsty,
int srcx,
int srcy,
int srcw,
int srch,
int srcscan,
boolean skipFlush)
Updates this texture using the contents of the given
Buffer . |
void |
update(MediaFrame frame,
boolean skipFlush)
Updates this texture using the contents of the provided
MediaFrame . |
(package private) void |
updateFromBuffer(java.awt.image.BufferedImage bimg,
java.nio.Buffer buffer,
PixelFormat format,
int dstx,
int dsty,
int srcx,
int srcy,
int srcw,
int srch,
int srcscan) |
assertLocked, checkUpdateParams, contentsNotUseful, contentsUseful, dispose, getContentHeight, getContentWidth, getContentX, getContentY, getLastImageSerial, getLinearFiltering, getLockCount, getMaxContentHeight, getMaxContentWidth, getPhysicalHeight, getPhysicalWidth, getPixelFormat, getSharedTexture, getUseMipmap, getWrapMode, isLocked, isSurfaceLost, lock, makePermanent, setContentHeight, setContentWidth, setLastImageSerial, setLinearFiltering, toString, unlock, update, update, update, update
private final PixelSetter setter
J2DTexture(java.awt.image.BufferedImage bimg, PixelFormat format, PixelSetter setter, Texture.WrapMode wrapMode)
J2DTexture(J2DTexture sharedTex, Texture.WrapMode altMode)
static J2DTexture create(PixelFormat format, Texture.WrapMode wrapMode, int w, int h)
protected Texture createSharedTexture(Texture.WrapMode newMode)
BaseTexture
ManagedResource
reference.
The lock counts for the shared resource reference are not
changed in the processing of this method.createSharedTexture
in class BaseTexture<J2DTexture.J2DTexResource>
newMode
- the WrapMode
to use for the new texture.Texture
object sharing the underlying resource.java.awt.image.BufferedImage getBufferedImage()
private static PixelGetter getGetter(PixelFormat format)
private static java.nio.Buffer getDstBuffer(java.awt.image.BufferedImage bimg)
void updateFromBuffer(java.awt.image.BufferedImage bimg, java.nio.Buffer buffer, PixelFormat format, int dstx, int dsty, int srcx, int srcy, int srcw, int srch, int srcscan)
public void update(java.nio.Buffer buffer, PixelFormat format, int dstx, int dsty, int srcx, int srcy, int srcw, int srch, int srcscan, boolean skipFlush)
Texture
Buffer
.
The upper-left corner of the image data will be positioned
at (contentX+dstx, contentY+dsty) of the texture, and the source
region to be uploaded will be srcw
by srch
pixels.
This method will cause the vertex buffer to be flushed unless
skipFlush
is true.format
- the format of the data contained in the pixel bufferdstx
- the x-offset of the image data, in pixels, relative to the
contentX of this texturedsty
- the y-offset of the image data, in pixels, relative to the
contentY of this texturesrcx
- the x-offset into the source buffer, in pixelssrcy
- the y-offset into the source buffer, in pixelssrcw
- the width of the pixel region from the source buffersrch
- the height of the pixel region from the source buffersrcscan
- the scanline stride of the source buffer, in bytesskipFlush
- if true, the vertex buffer will not be flushedpublic void update(MediaFrame frame, boolean skipFlush)
Texture
MediaFrame
. The source and destination coordinates are implicit,
you can only update the entire video texture.frame
- the source video buffer to update the texture data fromskipFlush
- if true, the vertex buffer will not be flushed