public class SWMaskTexture extends Object
Texture.Usage, Texture.WrapMode
Modifier and Type | Method and Description |
---|---|
void |
assertLocked() |
void |
contentsNotUseful() |
void |
contentsUseful() |
void |
dispose() |
int |
getContentHeight()
Returns the content height of this texture, in pixels.
|
int |
getContentWidth()
Returns the content width of this texture, in pixels.
|
int |
getContentX()
Returns the content x-origin of this texture relative to the upper-left
corner, in pixels.
|
int |
getContentY()
Returns the content y-origin of this texture relative to the upper-left
corner, in pixels.
|
int |
getLastImageSerial() |
boolean |
getLinearFiltering()
Returns whether linear (smooth) filtering will be used when
rendering this texture.
|
int |
getLockCount() |
int |
getMaxContentHeight()
Returns the max content height of this texture, in pixels.
|
int |
getMaxContentWidth()
Returns the max content width of this texture, in pixels.
|
int |
getPhysicalHeight()
Returns the physical height of this texture, in pixels.
|
int |
getPhysicalWidth()
Returns the physical width of this texture, in pixels.
|
PixelFormat |
getPixelFormat()
Returns the
PixelFormat of this texture. |
Texture |
getSharedTexture(Texture.WrapMode altMode)
Constructs an alternate version of this
Texture with an
alternate WrapMode if the two modes allow the underlying texture
to be shared, otherwise a null value is returned. |
boolean |
getUseMipmap()
Returns the true if mipmapping is used for this texture.
|
Texture.WrapMode |
getWrapMode()
Returns the
WrapMode for this texture. |
boolean |
isLocked() |
boolean |
isSurfaceLost()
Called by code wanting to know if the RTTexture's surface is lost.
|
void |
lock() |
void |
makePermanent() |
void |
setContentHeight(int contentHeight)
Allows the content height, which is the current height of the actual content
in pixels, to be adjusted.
|
void |
setContentWidth(int contentWidth)
Allows the content width, which is the current width of the actual content
in pixels, to be adjusted.
|
void |
setLastImageSerial(int serial) |
void |
setLinearFiltering(boolean linear)
Sets whether linear filtering will be used when rendering this texture.
|
void |
unlock() |
void |
update(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(Image img)
Updates this texture using the contents of the given
Image . |
void |
update(Image img,
int dstx,
int dsty)
Updates this texture using the contents of the given
Image . |
void |
update(Image img,
int dstx,
int dsty,
int srcw,
int srch)
Updates this texture using the contents of the given
Image . |
void |
update(Image img,
int dstx,
int dsty,
int srcw,
int srch,
boolean skipFlush)
Updates this texture using the contents of the given
Image . |
void |
update(MediaFrame frame,
boolean skipFlush)
Updates this texture using the contents of the provided
MediaFrame . |
public PixelFormat getPixelFormat()
Texture
PixelFormat
of this texture.PixelFormat
of this texturepublic void update(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 flushedpublic int getLockCount()
getLockCount
in interface Texture
public void assertLocked()
assertLocked
in interface Texture
public void makePermanent()
makePermanent
in interface Texture
public void contentsUseful()
contentsUseful
in interface Texture
public void contentsNotUseful()
contentsNotUseful
in interface Texture
public boolean isSurfaceLost()
Texture
isSurfaceLost
in interface Texture
public void dispose()
dispose
in interface GraphicsResource
public int getPhysicalWidth()
Texture
getPhysicalWidth
in interface Texture
public int getPhysicalHeight()
Texture
getPhysicalHeight
in interface Texture
public int getContentX()
Texture
getContentX
in interface Texture
public int getContentY()
Texture
getContentY
in interface Texture
public int getContentWidth()
Texture
For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256, but the content dimensions will be 400x200.
getContentWidth
in interface Texture
public void setContentWidth(int contentWidth)
Texture
setContentWidth
in interface Texture
contentWidth
- The actual new width of user pixels.public int getContentHeight()
Texture
For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256, but the content dimensions will be 400x200.
getContentHeight
in interface Texture
public void setContentHeight(int contentHeight)
Texture
setContentHeight
in interface Texture
contentHeight
- The actual new height of user pixels.public int getMaxContentWidth()
Texture
For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256 and the max content dimensions will be 512x256 minus any padding needed by the implementation to simulate edge conditions., but the content dimensions will be 400x200.
getMaxContentWidth
in interface Texture
public int getMaxContentHeight()
Texture
For example, if the hardware does not support non-power-of-two textures, and you call ResourceFactory.createTexture(400, 200), the returned Texture will have physical dimensions of 512x256 and the max content dimensions will be 512x256 minus any padding needed by the implementation to simulate edge conditions., but the content dimensions will be 400x200.
getMaxContentHeight
in interface Texture
public int getLastImageSerial()
getLastImageSerial
in interface Texture
public void setLastImageSerial(int serial)
setLastImageSerial
in interface Texture
public void update(Image img)
Texture
Image
.
The upper-left corner of the image data will be positioned
at (contentX, contentY) of the texture, and the full width and height
of the image will be uploaded.
This method will cause the vertex buffer to be flushed prior to
uploading the pixels.
This is equivalent to calling:
update(img, 0, 0);
public void update(Image img, int dstx, int dsty)
Texture
Image
.
The upper-left corner of the image data will be positioned
at (contentX+dstx, contentY+dsty) of the texture, and the full width
and height of the image will be uploaded.
This method will cause the vertex buffer to be flushed prior to
uploading the pixels.
This is equivalent to calling:
update(img, dstx, dsty, img.getWidth(), img.getHeight());
public void update(Image img, int dstx, int dsty, int srcw, int srch)
Texture
Image
.
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 prior to
uploading the pixels.
This is equivalent to calling:
update(img, dstx, dsty, srcw, srch, false);
update
in interface Texture
img
- the image data to be uploaded to this texturedstx
- 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 texturesrcw
- the width of the pixel region from the source imagesrch
- the height of the pixel region from the source imagepublic void update(Image img, int dstx, int dsty, int srcw, int srch, boolean skipFlush)
Texture
Image
.
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.
This is equivalent to calling:
update(img.getPixelBuffer(), img.getPixelFormat(),
dstx, dsty, img.getMinX(), img.getMinY(),
srcw, srch, img.getScanlineStride(), skipFlush);
update
in interface Texture
img
- the image data to be uploaded to this texturedstx
- 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 texturesrcw
- the width of the pixel region from the source imagesrch
- the height of the pixel region from the source imageskipFlush
- if true, the vertex buffer will not be flushedpublic Texture.WrapMode getWrapMode()
Texture
WrapMode
for this texture.getWrapMode
in interface Texture
WrapMode
for this texturepublic boolean getUseMipmap()
Texture
getUseMipmap
in interface Texture
useMipmap
flag for this texturepublic Texture getSharedTexture(Texture.WrapMode altMode)
Texture
Texture
with an
alternate WrapMode if the two modes allow the underlying texture
to be shared, otherwise a null value is returned.
This method can only be used to create a shared texture for
REPEAT
or CLAMP_TO_EDGE
textures, which must
necessarily have content that spans their entire physical dimensions
(if their content was smaller then they would have a _SIMULATED
type of wrap mode).
This method expects the texture to be already locked (and checked for
a valid surface) and if it returns a non-null value then that return
value will have an outstanding lock in addition to retaining the lock
on the original texture.
Note that if the requested WrapMode
is the same as the wrap
mode of this texture, then this same object will be returned after
having its lock count increased by 1.
Thus, in all cases, the caller is responsible for locking this texture
before the call, and eventually unlocking this texture after the call,
and also for eventually unlocking the return value if it is non-null.getSharedTexture
in interface Texture
public boolean getLinearFiltering()
Texture
getLinearFiltering
in interface Texture
public void setLinearFiltering(boolean linear)
Texture
setLinearFiltering
in interface Texture
linear
- if true, enables linear filtering; if false, enables
nearest neighbor filteringCopyright © 2020. All rights reserved.