class ES2Texture<T extends ES2TextureData> extends BaseTexture<ES2TextureResource<T>>
Texture.Usage, Texture.WrapMode
Modifier and Type | Field and Description |
---|---|
(package private) ES2Context |
context |
contentHeight, contentWidth, resource
Modifier | Constructor and Description |
---|---|
(package private) |
ES2Texture(ES2Context context,
ES2TextureResource<T> resource,
PixelFormat format,
Texture.WrapMode wrapMode,
int physicalWidth,
int physicalHeight,
int contentX,
int contentY,
int contentWidth,
int contentHeight,
boolean useMipmap) |
(package private) |
ES2Texture(ES2Context context,
ES2TextureResource<T> resource,
PixelFormat format,
Texture.WrapMode wrapMode,
int physicalWidth,
int physicalHeight,
int contentX,
int contentY,
int contentWidth,
int contentHeight,
int maxContentWidth,
int maxContentHeight,
boolean useMipmap) |
private |
ES2Texture(ES2Texture sharedTex,
Texture.WrapMode newMode) |
Modifier and Type | Method and Description |
---|---|
static Texture |
create(ES2Context context,
MediaFrame frame) |
(package private) static ES2Texture |
create(ES2Context context,
PixelFormat format,
Texture.WrapMode wrapMode,
int w,
int h,
boolean useMipmap) |
protected Texture |
createSharedTexture(Texture.WrapMode newMode)
Create a new version of this texture which shares the same
ManagedResource reference. |
static int |
getBufferElementSizeLog(java.nio.Buffer b) |
int |
getNativeSourceHandle() |
(package private) static int |
nextPowerOfTwo(int val,
int max)
Given a starting value and a maximum limit, returns the first
power-of-two greater than or equal to the starting value.
|
void |
update(java.nio.Buffer pixels,
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 |
updateFilterState() |
(package private) void |
updateWrapState() |
private static boolean |
uploadPixels(GLContext glCtx,
int target,
java.nio.Buffer pixels,
PixelFormat format,
int texw,
int texh,
int dstx,
int dsty,
int srcx,
int srcy,
int srcw,
int srch,
int srcscan,
boolean create,
boolean useMipmap) |
private static boolean |
uploadPixels(GLContext glCtx,
int target,
MediaFrame frame,
int texw,
int texh,
boolean create) |
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
final ES2Context context
ES2Texture(ES2Context context, ES2TextureResource<T> resource, PixelFormat format, Texture.WrapMode wrapMode, int physicalWidth, int physicalHeight, int contentX, int contentY, int contentWidth, int contentHeight, boolean useMipmap)
ES2Texture(ES2Context context, ES2TextureResource<T> resource, PixelFormat format, Texture.WrapMode wrapMode, int physicalWidth, int physicalHeight, int contentX, int contentY, int contentWidth, int contentHeight, int maxContentWidth, int maxContentHeight, boolean useMipmap)
private ES2Texture(ES2Texture sharedTex, Texture.WrapMode newMode)
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<ES2TextureResource<T extends ES2TextureData>>
newMode
- the WrapMode
to use for the new texture.Texture
object sharing the underlying resource.static int nextPowerOfTwo(int val, int max)
static ES2Texture create(ES2Context context, PixelFormat format, Texture.WrapMode wrapMode, int w, int h, boolean useMipmap)
public static Texture create(ES2Context context, MediaFrame frame)
private static boolean uploadPixels(GLContext glCtx, int target, java.nio.Buffer pixels, PixelFormat format, int texw, int texh, int dstx, int dsty, int srcx, int srcy, int srcw, int srch, int srcscan, boolean create, boolean useMipmap)
private static boolean uploadPixels(GLContext glCtx, int target, MediaFrame frame, int texw, int texh, boolean create)
public static int getBufferElementSizeLog(java.nio.Buffer b)
void updateWrapState()
void updateFilterState()
public int getNativeSourceHandle()
public void update(java.nio.Buffer pixels, 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