public class TextGlLayer extends GlLayer implements RenderToCanvasLayerI, EventListenerInterface<TextLayerSettings.Event>
Modifier and Type | Field and Description |
---|---|
static float |
BORDER_THICKNESS |
static android.graphics.Paint |
clearPaint |
static int |
EDGE_COLOR |
static float |
EDGE_HEIGHT |
static float |
EDGE_THICKNESS |
static float |
EDGE_WIDTH |
static int |
LINE_COLOR |
static float |
LINE_HEIGHT_OFFSET |
static float |
LINE_WIDTH_OFFSET |
static float[] |
OUTSIDE_COLOR_RGBA |
static float |
SNAP_RANGE_IN_DP |
static float |
TOUCH_OFFSET |
stage, transformationGlSafe, transformationUiSafe
isAttached, showState, uiDensity, willDrawUi
Constructor and Description |
---|
TextGlLayer(StateHandler stateHandler,
TextLayerSettings settings) |
Modifier and Type | Method and Description |
---|---|
boolean |
doRespondOnClick(TransformedMotionEvent event) |
void |
drawStickerSlice(android.graphics.Canvas canvas,
android.graphics.RectF region,
android.graphics.RectF fullRange) |
protected void |
drawTextToCanvas(android.graphics.Canvas canvas,
TextStickerConfig config,
TextInBoundsDrawer.WorkerSafe workerSafe) |
android.graphics.Rect |
getResultRect(android.graphics.Rect fullImageRegion,
float subSample) |
MultiRect |
getStickerDestinationRect(TextLayerSettings.ScaleContext scaleContext) |
MultiRect |
getStickerDestinationRectGlSafe(TextLayerSettings.ScaleContext scaleContext) |
Transformation |
getStickerMatrix() |
Transformation |
getStickerMatrix(TextLayerSettings.ScaleContext scaleContext) |
Transformation |
getStickerMatrix(TextLayerSettings.ScaleContext scaleContext,
Transformation stickerMatrix) |
RectEdge |
getTouchedEdge(float[] pos) |
void |
glSetup() |
protected boolean |
isInBitmap(TransformedMotionEvent event) |
boolean |
isRelativeToCrop() |
protected void |
loadBitmapCache() |
protected void |
loadBitmapCache(long pixelSize) |
boolean |
needFullImageRegion() |
void |
onActivated() |
protected void |
onAttachedToUI(StateHandler stateHandler) |
void |
onDeactivated() |
protected void |
onDetachedFromUI(StateHandler stateHandler) |
protected void |
onDrawLayer() |
void |
onDrawUI(android.graphics.Canvas canvas) |
void |
onMotionEvent(TransformedMotionEvent event) |
void |
onStateChangeEvent(TextLayerSettings.Event event) |
protected void |
refresh() |
void |
render() |
void |
renderToCanvas(android.graphics.Canvas canvas,
android.graphics.Rect fullImageRegion,
android.graphics.Rect destRegion,
Transformation transformation) |
static void |
setHiddenAreaColor(int color) |
protected void |
setImageDimensions() |
void |
setImageRect(android.graphics.Rect rect) |
glDrawLayer
getResources, setTransformation
getStateHandler, isEnabled, onAttached, onDetached, onSizeChanged, postInvalidateUi, setWillDrawUi
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAttached, onDetached, onSizeChanged, setTransformation
public static final float[] OUTSIDE_COLOR_RGBA
public static int LINE_COLOR
public static int EDGE_COLOR
public static float TOUCH_OFFSET
public static float EDGE_THICKNESS
public static float BORDER_THICKNESS
public static float EDGE_WIDTH
public static float EDGE_HEIGHT
public static float LINE_WIDTH_OFFSET
public static float LINE_HEIGHT_OFFSET
public static float SNAP_RANGE_IN_DP
public static android.graphics.Paint clearPaint
public TextGlLayer(StateHandler stateHandler, TextLayerSettings settings)
public static void setHiddenAreaColor(int color)
@MainThread public void onDrawUI(android.graphics.Canvas canvas)
onDrawUI
in interface UIOverlayDrawer
onDrawUI
in class LayerBase
@NonNull @MainThread public Transformation getStickerMatrix(TextLayerSettings.ScaleContext scaleContext)
@NonNull @AnyThread public Transformation getStickerMatrix(TextLayerSettings.ScaleContext scaleContext, Transformation stickerMatrix)
@NonNull @MainThread public MultiRect getStickerDestinationRect(TextLayerSettings.ScaleContext scaleContext)
@NonNull @WorkerThread public MultiRect getStickerDestinationRectGlSafe(TextLayerSettings.ScaleContext scaleContext)
@MainThread protected void onAttachedToUI(StateHandler stateHandler)
onAttachedToUI
in class LayerBase
@MainThread protected void onDetachedFromUI(StateHandler stateHandler)
onDetachedFromUI
in class LayerBase
@MainThread public RectEdge getTouchedEdge(float[] pos)
@MainThread public void setImageRect(@NonNull android.graphics.Rect rect)
setImageRect
in interface LayerI
@MainThread public void onActivated()
onActivated
in interface LayerI
onActivated
in class GlLayer
@MainThread public void onDeactivated()
onDeactivated
in interface LayerI
onDeactivated
in class GlLayer
@MainThread protected void setImageDimensions()
@MainThread protected void refresh()
@MainThread protected void loadBitmapCache()
@MainThread protected void loadBitmapCache(long pixelSize)
@AnyThread public boolean isRelativeToCrop()
isRelativeToCrop
in interface LayerI
@WorkerThread public void glSetup()
glSetup
in class GlLayerBase
@WorkerThread protected void onDrawLayer()
onDrawLayer
in class GlLayer
@AnyThread public void render()
render
in class GlLayerBase
@MainThread public void onMotionEvent(@NonNull TransformedMotionEvent event)
onMotionEvent
in interface LayerI
onMotionEvent
in class GlLayerBase
@MainThread public boolean doRespondOnClick(@NonNull TransformedMotionEvent event)
doRespondOnClick
in interface LayerI
doRespondOnClick
in class GlLayerBase
@MainThread protected boolean isInBitmap(@NonNull TransformedMotionEvent event)
@NonNull @MainThread public Transformation getStickerMatrix()
@WorkerThread public void renderToCanvas(android.graphics.Canvas canvas, android.graphics.Rect fullImageRegion, android.graphics.Rect destRegion, Transformation transformation)
renderToCanvas
in interface RenderToCanvasLayerI
@WorkerThread public android.graphics.Rect getResultRect(android.graphics.Rect fullImageRegion, float subSample)
getResultRect
in interface ProcessableLayerI
getResultRect
in interface RenderToCanvasLayerI
@WorkerThread public boolean needFullImageRegion()
needFullImageRegion
in interface ProcessableLayerI
needFullImageRegion
in interface RenderToCanvasLayerI
@WorkerThread public void drawStickerSlice(android.graphics.Canvas canvas, android.graphics.RectF region, android.graphics.RectF fullRange)
@NonNull @WorkerThread protected void drawTextToCanvas(android.graphics.Canvas canvas, @NonNull TextStickerConfig config, TextInBoundsDrawer.WorkerSafe workerSafe)
public void onStateChangeEvent(TextLayerSettings.Event event)
onStateChangeEvent
in interface EventListenerInterface<TextLayerSettings.Event>