public class SimpleProcessor
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected android.graphics.Bitmap |
brushSnap
笔刷快照
|
protected android.graphics.Bitmap |
currentSnap
绘制画布,不包含底图
|
protected float |
mBrushScale
笔刷缩放系数
|
protected BrushData |
mCurrentBrush
当前使用的笔刷
|
protected android.graphics.Bitmap |
originalImage
原始图片,没有经过放缩
|
protected android.graphics.Bitmap |
originalSnap
经过缩放的底图
|
protected android.graphics.Canvas |
smudgeCanvas
当前绘制快照,在绘制时同步更新,不包含底图数据
|
构造器和说明 |
---|
SimpleProcessor()
构造函数
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
destroy() |
protected void |
drawAtPoint(float x,
float y,
float d,
float scale,
float angle)
根据笔刷类型采用不同的绘制方式
|
protected void |
drawBetweenPoints(android.graphics.PointF previousPoint,
android.graphics.PointF currentPoint)
draw function
|
protected BrushData |
getBrush() |
protected android.graphics.Bitmap |
getCanvasImage()
get preview image
|
protected int |
getImageHeight()
获取适应屏幕后的图片高度
|
protected int |
getImageWidth()
获取适应屏幕后的图片宽度
|
protected float |
getMaxTemplateDistance(float mBrushScale)
最大间距
|
protected int |
getMaxUndoCount()
允许撤销的次数 (默认: 5)
|
protected android.graphics.Bitmap |
getOriginalImage() |
protected int |
getRedoCount()
允许重做的次数
|
protected android.graphics.Bitmap |
getRedoData() |
protected android.graphics.Bitmap |
getSmudgeImage(android.graphics.Bitmap image,
boolean recycle) |
protected int |
getUndoCount()
允许撤销的次数
|
protected android.graphics.Bitmap |
getUndoData() |
protected void |
init(android.graphics.Bitmap originalImage,
android.graphics.Bitmap scaledImage,
int screenWidth)
初始化
|
protected void |
saveCurrentAsHistory()
保存当前绘制进历史记录
|
protected void |
setBrush(BrushData brush) |
protected void |
setBrushSize(BrushSize.SizeType size) |
protected void |
setMaxUndoCount(int mMaxUndoCount)
允许撤销的次数 (默认: 5)
|
protected void |
touchBegan() |
protected android.graphics.Bitmap originalImage
protected android.graphics.Bitmap originalSnap
protected android.graphics.Bitmap currentSnap
protected android.graphics.Canvas smudgeCanvas
protected android.graphics.Bitmap brushSnap
protected BrushData mCurrentBrush
protected float mBrushScale
protected void init(android.graphics.Bitmap originalImage, android.graphics.Bitmap scaledImage, int screenWidth)
originalImage
- 原始图像scaledImage
- 适应屏幕尺寸的图像screenWidth
- 视图宽度protected int getImageWidth()
protected int getImageHeight()
protected void setBrush(BrushData brush)
brush
- protected BrushData getBrush()
protected void setBrushSize(BrushSize.SizeType size)
size
- protected int getMaxUndoCount()
protected void setMaxUndoCount(int mMaxUndoCount)
protected int getRedoCount()
protected int getUndoCount()
protected void saveCurrentAsHistory()
protected android.graphics.Bitmap getRedoData()
protected android.graphics.Bitmap getUndoData()
protected android.graphics.Bitmap getCanvasImage()
protected android.graphics.Bitmap getOriginalImage()
protected void touchBegan()
protected final void drawBetweenPoints(android.graphics.PointF previousPoint, android.graphics.PointF currentPoint)
protected float getMaxTemplateDistance(float mBrushScale)
mBrushScale
- 笔刷缩放protected void drawAtPoint(float x, float y, float d, float scale, float angle)
protected android.graphics.Bitmap getSmudgeImage(android.graphics.Bitmap image, boolean recycle)
image
- 源图recycle
- 是否回收 image 对象protected void destroy()