Java 类android.graphics.MaskFilter 实例源码
项目:richmaps
文件:RichPolygon.java
RichPolygon(final int zIndex,
final List<RichPoint> points,
final List<List<RichPoint>> holes,
final int strokeWidth,
final Paint.Cap strokeCap,
final Paint.Join strokeJoin,
final PathEffect pathEffect,
final MaskFilter maskFilter,
final boolean linearGradient,
final Integer strokeColor,
final boolean antialias,
final boolean closed,
final Shader strokeShader,
final Shader fillShader,
final Paint.Style style,
final Integer fillColor) {
super(zIndex, points, strokeWidth, strokeCap, strokeJoin, pathEffect, maskFilter,
strokeShader, linearGradient, strokeColor, antialias, closed);
this.fillShader = fillShader;
this.style = style;
this.fillColor = fillColor;
if (holes != null) {
addHoles(holes);
}
}
项目:truth-android
文件:AbstractPaintSubject.java
public S hasMaskFilter(MaskFilter filter) {
assertThat(actual().getMaskFilter())
.named("mask filter")
.isSameAs(filter);
//noinspection unchecked
return (S) this;
}
项目:richmaps
文件:RichShape.java
RichShape(final int zIndex,
final List<RichPoint> points,
final int strokeWidth,
final Paint.Cap strokeCap,
final Paint.Join strokeJoin,
final PathEffect pathEffect,
final MaskFilter maskFilter,
final Shader strokeShader,
final boolean linearGradient,
final Integer strokeColor,
final boolean antialias,
final boolean closed) {
this.zIndex = zIndex;
this.strokeWidth = strokeWidth;
this.strokeCap = strokeCap;
this.strokeJoin = strokeJoin;
this.pathEffect = pathEffect;
this.maskFilter = maskFilter;
this.strokeShader = strokeShader;
this.linearGradient = linearGradient;
this.strokeColor = strokeColor;
this.antialias = antialias;
this.closed = closed;
if (points != null) {
for (RichPoint point : points) {
add(point);
}
}
}
项目:richmaps
文件:RichPolyline.java
RichPolyline(final int zIndex,
final List<RichPoint> points,
final int strokeWidth,
final Paint.Cap strokeCap,
final Paint.Join strokeJoin,
final PathEffect pathEffect,
final MaskFilter maskFilter,
final Shader strokeShader,
final boolean linearGradient,
final Integer strokeColor,
final boolean antialias,
final boolean closed) {
super(zIndex, points, strokeWidth, strokeCap, strokeJoin, pathEffect, maskFilter,
strokeShader, linearGradient, strokeColor, antialias, closed);
}
项目:yitu
文件:PaintStyle.java
private void embossPen()
{
MaskFilter mEmboss = new EmbossMaskFilter(new float[]{ 1, 1, 1 }, 0.4f, 6, 3.5f);
mPenPaint.setDither(true);
mPenPaint.setAntiAlias(true);
mPenPaint.setStyle(Paint.Style.STROKE);
mPenPaint.setStrokeJoin(Paint.Join.ROUND);
mPenPaint.setStrokeCap(Paint.Cap.ROUND);
mPenPaint.setMaskFilter(mEmboss);
}
项目:yitu
文件:PaintStyle.java
private void blurPen()
{
MaskFilter mBlur = new BlurMaskFilter(8, BlurMaskFilter.Blur.NORMAL);
mPenPaint.setDither(true);
mPenPaint.setAntiAlias(true);
mPenPaint.setStyle(Paint.Style.STROKE);
mPenPaint.setStrokeJoin(Paint.Join.ROUND);
mPenPaint.setStrokeCap(Paint.Cap.ROUND);
mPenPaint.setMaskFilter(mBlur);
}
项目:androidProject
文件:HolographicOutlineHelper.java
HolographicOutlineHelper() {
mHolographicPaint.setFilterBitmap(true);
mHolographicPaint.setAntiAlias(true);
mBlurPaint.setFilterBitmap(true);
mBlurPaint.setAntiAlias(true);
mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
mErasePaint.setFilterBitmap(true);
mErasePaint.setAntiAlias(true);
MaskFilter alphaClipTable = TableMaskFilter.CreateClipTable(180, 255);
mAlphaClipPaint.setMaskFilter(alphaClipTable);
}
项目:assertj-android
文件:AbstractPaintAssert.java
public S hasMaskFilter(MaskFilter filter) {
isNotNull();
MaskFilter actualFilter = actual.getMaskFilter();
assertThat(actualFilter) //
.overridingErrorMessage("Expected mask filter <%s> but was <%s>.", filter, actualFilter) //
.isSameAs(filter);
return myself;
}
项目:Android-Spans
文件:Span.java
public static Node mask(MaskFilter filter, Object... nodes) {
return new SpanNode(new MaskFilterSpan(filter), nodes);
}
项目:JotaTextEditor
文件:MaskFilterSpan.java
public MaskFilterSpan(MaskFilter filter) {
mFilter = filter;
}
项目:JotaTextEditor
文件:MaskFilterSpan.java
public MaskFilter getMaskFilter() {
return mFilter;
}
项目:androidProject
文件:AppsCustomizePagedView.java
private void beginDraggingWidget(View v) {
// Get the widget preview as the drag representation
ImageView image = (ImageView) v.findViewById(R.id.widget_preview);
PendingAddItemInfo createItemInfo = (PendingAddItemInfo) v.getTag();
// Compose the drag image
Bitmap b;
Drawable preview = image.getDrawable();
RectF mTmpScaleRect = new RectF(0f,0f,1f,1f);
image.getImageMatrix().mapRect(mTmpScaleRect);
float scale = mTmpScaleRect.right;
int w = (int) (preview.getIntrinsicWidth() * scale);
int h = (int) (preview.getIntrinsicHeight() * scale);
if (createItemInfo instanceof PendingAddWidgetInfo) {
PendingAddWidgetInfo createWidgetInfo = (PendingAddWidgetInfo) createItemInfo;
int[] spanXY = mLauncher.getSpanForWidget(createWidgetInfo, null);
createItemInfo.spanX = spanXY[0];
createItemInfo.spanY = spanXY[1];
b = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
renderDrawableToBitmap(preview, b, 0, 0, w, h, scale, mDragViewMultiplyColor);
} else {
// Workaround for the fact that we don't keep the original ResolveInfo associated with
// the shortcut around. To get the icon, we just render the preview image (which has
// the shortcut icon) to a new drag bitmap that clips the non-icon space.
b = Bitmap.createBitmap(mWidgetPreviewIconPaddedDimension,
mWidgetPreviewIconPaddedDimension, Bitmap.Config.ARGB_8888);
mCanvas.setBitmap(b);
mCanvas.save();
preview.draw(mCanvas);
mCanvas.restore();
mCanvas.drawColor(mDragViewMultiplyColor, PorterDuff.Mode.MULTIPLY);
mCanvas.setBitmap(null);
createItemInfo.spanX = createItemInfo.spanY = 1;
}
// We use a custom alpha clip table for the default widget previews
Paint alphaClipPaint = null;
if (createItemInfo instanceof PendingAddWidgetInfo) {
if (((PendingAddWidgetInfo) createItemInfo).hasDefaultPreview) {
MaskFilter alphaClipTable = TableMaskFilter.CreateClipTable(0, 255);
alphaClipPaint = new Paint();
alphaClipPaint.setMaskFilter(alphaClipTable);
}
}
// Start the drag
mLauncher.lockScreenOrientationOnLargeUI();
mLauncher.getWorkspace().onDragStartedWithItemSpans(createItemInfo.spanX,
createItemInfo.spanY, b, alphaClipPaint);
mDragController.startDrag(image, b, this, createItemInfo,
DragController.DRAG_ACTION_COPY, null);
b.recycle();
}