open class ZoomSurfaceView : GLSurfaceView, ZoomApi, Renderer
Uses ZoomEngine to allow zooming and pan events onto a GL rendered surface.
interface Callback
A Callback to be notified of the surface lifecycle. All methods are invoked on the ui thread for convenience. |
ZoomSurfaceView(context: Context, attrs: AttributeSet? = null) |
val engine: ZoomEngine |
|
var surface: Surface?
A Surface that can be consumed by some buffer provider. This will be non-null after Callback.onZoomSurfaceCreated and null again after Callback.onZoomSurfaceDestroyed. |
|
var surfaceTexture: SurfaceTexture?
A SurfaceTexture that can be consumed by some buffer provider. This will be non-null after Callback.onZoomSurfaceCreated and null again after Callback.onZoomSurfaceDestroyed. |
fun addCallback(callback: Callback): Unit
Adds a new Callback to be notified of the surface state. Should be called as soon as possible. |
|
open fun onDetachedFromWindow(): Unit |
|
open fun onDraw(modelMatrix: FloatArray, textureTransformMatrix: FloatArray): Unit
Called on the renderer thread when the texture is being drawn. You can, if needed, perform extra transformation by editing the textureTransformMatrix or the modelMatrix using the android.opengl.Matrix utilities. |
|
open fun onDrawFrame(gl: GL10): Unit
Performs the texture and background drawing. |
|
open fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit |
|
open fun onSurfaceChanged(gl: GL10, width: Int, height: Int): Unit |
|
open fun onSurfaceCreated(gl: GL10?, config: EGLConfig?): Unit |
|
open fun onTouchEvent(ev: MotionEvent): Boolean |
|
fun removeCallback(callback: Callback): Unit
Removes a Callback previously added with addCallback. |
|
open fun setBackgroundColor(color: Int): Unit
If non transparent, we will draw this background color using GL before drawing the actual texture. |
|
fun setContentSize(width: Float, height: Float): Unit
Sets the size of the content. If this is not called, the size will be assumed to be that of the ZoomSurfaceView itself. In this case, make sure to measure ZoomSurfaceView correctly or the texture will be distorted. |