.class public Lcom/moji/camera/view/ScaleView;
.super Landroid/widget/ImageView;
.source "ScaleView.java"


# instance fields
.field private final a:Landroid/view/GestureDetector;

.field private final b:I

.field private final c:F

.field private final d:[F

.field private e:Landroid/graphics/Matrix;

.field private f:Landroid/view/ScaleGestureDetector;

.field private g:I

.field private h:I

.field private i:Landroid/graphics/drawable/Drawable;

.field private j:I

.field private k:I

.field private l:F

.field private m:F

.field private n:F

.field private o:F

.field private p:Landroid/graphics/Rect;

.field private q:F

.field private r:I

.field private s:I

.field private t:Landroid/graphics/Paint;

.field private u:Landroid/graphics/Paint;

.field private v:Landroid/graphics/PorterDuffXfermode;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    .line 197
    invoke-direct {p0, p1, v0}, Lcom/moji/camera/view/ScaleView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    const/4 v0, 0x0

    .line 201
    invoke-direct {p0, p1, p2, v0}, Lcom/moji/camera/view/ScaleView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1

    .line 90
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    const/16 p2, 0x9

    .line 33
    new-array p2, p2, [F

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->d:[F

    const/16 p2, 0x438

    .line 50
    iput p2, p0, Lcom/moji/camera/view/ScaleView;->s:I

    .line 91
    invoke-static {}, Lcom/moji/tool/DeviceTool;->b()I

    move-result p2

    iput p2, p0, Lcom/moji/camera/view/ScaleView;->b:I

    iput p2, p0, Lcom/moji/camera/view/ScaleView;->r:I

    .line 92
    sget p2, Lcom/moji/camera/R$dimen;->camera_margin:I

    invoke-static {p2}, Lcom/moji/tool/DeviceTool;->a(I)F

    move-result p2

    const/high16 p3, 0x40800000    # 4.0f

    invoke-static {p3}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result p3

    int-to-float p3, p3

    add-float/2addr p2, p3

    iput p2, p0, Lcom/moji/camera/view/ScaleView;->o:F

    .line 93
    iget p2, p0, Lcom/moji/camera/view/ScaleView;->b:I

    int-to-float p2, p2

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->o:F

    const/high16 v0, 0x40000000    # 2.0f

    mul-float p3, p3, v0

    sub-float/2addr p2, p3

    iput p2, p0, Lcom/moji/camera/view/ScaleView;->c:F

    .line 94
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->getImageMatrix()Landroid/graphics/Matrix;

    move-result-object p2

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    .line 95
    iget-object p2, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    iget-object p3, p0, Lcom/moji/camera/view/ScaleView;->d:[F

    invoke-virtual {p2, p3}, Landroid/graphics/Matrix;->getValues([F)V

    .line 97
    new-instance p2, Landroid/graphics/Rect;

    invoke-direct {p2}, Landroid/graphics/Rect;-><init>()V

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    .line 98
    new-instance p2, Landroid/graphics/Paint;

    const/4 p3, 0x1

    invoke-direct {p2, p3}, Landroid/graphics/Paint;-><init>(I)V

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->t:Landroid/graphics/Paint;

    .line 99
    new-instance p2, Landroid/graphics/Paint;

    invoke-direct {p2, p3}, Landroid/graphics/Paint;-><init>(I)V

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->u:Landroid/graphics/Paint;

    .line 100
    new-instance p2, Landroid/graphics/PorterDuffXfermode;

    sget-object p3, Landroid/graphics/PorterDuff$Mode;->CLEAR:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {p2, p3}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->v:Landroid/graphics/PorterDuffXfermode;

    .line 101
    iget-object p2, p0, Lcom/moji/camera/view/ScaleView;->t:Landroid/graphics/Paint;

    sget p3, Lcom/moji/camera/R$color;->camera_shadow:I

    invoke-static {p3}, Lcom/moji/tool/DeviceTool;->e(I)I

    move-result p3

    invoke-virtual {p2, p3}, Landroid/graphics/Paint;->setColor(I)V

    .line 103
    new-instance p2, Landroid/view/ScaleGestureDetector;

    new-instance p3, Lcom/moji/camera/view/ScaleView$1;

    invoke-direct {p3, p0}, Lcom/moji/camera/view/ScaleView$1;-><init>(Lcom/moji/camera/view/ScaleView;)V

    invoke-direct {p2, p1, p3}, Landroid/view/ScaleGestureDetector;-><init>(Landroid/content/Context;Landroid/view/ScaleGestureDetector$OnScaleGestureListener;)V

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->f:Landroid/view/ScaleGestureDetector;

    .line 121
    new-instance p2, Landroid/view/GestureDetector;

    new-instance p3, Lcom/moji/camera/view/ScaleView$2;

    invoke-direct {p3, p0}, Lcom/moji/camera/view/ScaleView$2;-><init>(Lcom/moji/camera/view/ScaleView;)V

    invoke-direct {p2, p1, p3}, Landroid/view/GestureDetector;-><init>(Landroid/content/Context;Landroid/view/GestureDetector$OnGestureListener;)V

    iput-object p2, p0, Lcom/moji/camera/view/ScaleView;->a:Landroid/view/GestureDetector;

    return-void
.end method

.method static synthetic a(Lcom/moji/camera/view/ScaleView;)F
    .locals 0

    .line 29
    invoke-direct {p0}, Lcom/moji/camera/view/ScaleView;->getScale()F

    move-result p0

    return p0
.end method

.method public static a(IILandroid/graphics/BitmapFactory$Options;)I
    .locals 2

    .line 239
    iget v0, p2, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    .line 240
    iget p2, p2, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    if-le v0, p2, :cond_0

    move v1, p1

    move p1, p0

    move p0, v1

    :cond_0
    if-gt v0, p0, :cond_2

    if-le p2, p1, :cond_1

    goto :goto_0

    :cond_1
    const/4 p0, 0x1

    goto :goto_1

    :cond_2
    :goto_0
    int-to-float v0, v0

    int-to-float p0, p0

    div-float/2addr v0, p0

    int-to-float p0, p2

    int-to-float p1, p1

    div-float/2addr p0, p1

    .line 249
    invoke-static {v0, p0}, Ljava/lang/Math;->min(FF)F

    move-result p0

    invoke-static {p0}, Ljava/lang/Math;->round(F)I

    move-result p0

    :goto_1
    return p0
.end method

.method public static a(Ljava/lang/String;II)Landroid/graphics/Bitmap;
    .locals 2

    .line 229
    new-instance v0, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    const/4 v1, 0x1

    .line 230
    iput-boolean v1, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 231
    invoke-static {p0, v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    .line 232
    invoke-static {p1, p2, v0}, Lcom/moji/camera/view/ScaleView;->a(IILandroid/graphics/BitmapFactory$Options;)I

    move-result p1

    iput p1, v0, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    const/4 p1, 0x0

    .line 233
    iput-boolean p1, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 234
    invoke-static {p0, v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object p0

    return-object p0
.end method

.method private a(Landroid/graphics/Matrix;)Landroid/graphics/RectF;
    .locals 4

    .line 157
    new-instance v0, Landroid/graphics/RectF;

    invoke-direct {v0}, Landroid/graphics/RectF;-><init>()V

    .line 158
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v1

    .line 159
    invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    int-to-float v2, v2

    invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v1

    int-to-float v1, v1

    const/4 v3, 0x0

    invoke-virtual {v0, v3, v3, v2, v1}, Landroid/graphics/RectF;->set(FFFF)V

    .line 160
    invoke-virtual {p1, v0}, Landroid/graphics/Matrix;->mapRect(Landroid/graphics/RectF;)Z

    const-string p1, "ScaleView"

    .line 161
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "getMatrixRectF: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Landroid/graphics/RectF;->toShortString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {p1, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    return-object v0
.end method

.method static synthetic b(Lcom/moji/camera/view/ScaleView;)F
    .locals 0

    .line 29
    iget p0, p0, Lcom/moji/camera/view/ScaleView;->n:F

    return p0
.end method

.method private b()V
    .locals 6

    .line 136
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    invoke-direct {p0, v0}, Lcom/moji/camera/view/ScaleView;->a(Landroid/graphics/Matrix;)Landroid/graphics/RectF;

    move-result-object v0

    .line 139
    iget v1, p0, Lcom/moji/camera/view/ScaleView;->g:I

    .line 140
    iget v2, v0, Landroid/graphics/RectF;->left:F

    iget v3, p0, Lcom/moji/camera/view/ScaleView;->o:F

    const/4 v4, 0x0

    cmpl-float v2, v2, v3

    if-lez v2, :cond_0

    .line 141
    iget v1, v0, Landroid/graphics/RectF;->left:F

    neg-float v1, v1

    iget v2, p0, Lcom/moji/camera/view/ScaleView;->o:F

    add-float/2addr v1, v2

    goto :goto_0

    .line 142
    :cond_0
    iget v2, v0, Landroid/graphics/RectF;->right:F

    int-to-float v1, v1

    iget v3, p0, Lcom/moji/camera/view/ScaleView;->o:F

    sub-float v3, v1, v3

    cmpg-float v2, v2, v3

    if-gez v2, :cond_1

    .line 143
    iget v2, p0, Lcom/moji/camera/view/ScaleView;->o:F

    sub-float/2addr v1, v2

    iget v2, v0, Landroid/graphics/RectF;->right:F

    sub-float/2addr v1, v2

    goto :goto_0

    :cond_1
    const/4 v1, 0x0

    .line 145
    :goto_0
    iget v2, v0, Landroid/graphics/RectF;->top:F

    iget v3, p0, Lcom/moji/camera/view/ScaleView;->q:F

    cmpl-float v2, v2, v3

    if-lez v2, :cond_2

    .line 146
    iget v0, v0, Landroid/graphics/RectF;->top:F

    neg-float v0, v0

    iget v2, p0, Lcom/moji/camera/view/ScaleView;->q:F

    add-float v4, v0, v2

    goto :goto_1

    .line 147
    :cond_2
    iget v2, v0, Landroid/graphics/RectF;->bottom:F

    iget v3, p0, Lcom/moji/camera/view/ScaleView;->q:F

    iget v5, p0, Lcom/moji/camera/view/ScaleView;->c:F

    add-float/2addr v3, v5

    cmpg-float v2, v2, v3

    if-gez v2, :cond_3

    .line 148
    iget v2, p0, Lcom/moji/camera/view/ScaleView;->q:F

    iget v3, p0, Lcom/moji/camera/view/ScaleView;->c:F

    add-float/2addr v2, v3

    iget v0, v0, Landroid/graphics/RectF;->bottom:F

    sub-float v4, v2, v0

    .line 150
    :cond_3
    :goto_1
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    invoke-virtual {v0, v1, v4}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    return-void
.end method

.method static synthetic c(Lcom/moji/camera/view/ScaleView;)Landroid/graphics/Matrix;
    .locals 0

    .line 29
    iget-object p0, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    return-object p0
.end method

.method static synthetic d(Lcom/moji/camera/view/ScaleView;)F
    .locals 0

    .line 29
    invoke-direct {p0}, Lcom/moji/camera/view/ScaleView;->getTransX()F

    move-result p0

    return p0
.end method

.method static synthetic e(Lcom/moji/camera/view/ScaleView;)F
    .locals 0

    .line 29
    iget p0, p0, Lcom/moji/camera/view/ScaleView;->o:F

    return p0
.end method

.method static synthetic f(Lcom/moji/camera/view/ScaleView;)V
    .locals 0

    .line 29
    invoke-direct {p0}, Lcom/moji/camera/view/ScaleView;->b()V

    return-void
.end method

.method private getScale()F
    .locals 2

    .line 172
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->d:[F

    invoke-virtual {v0, v1}, Landroid/graphics/Matrix;->getValues([F)V

    .line 173
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->d:[F

    const/4 v1, 0x0

    aget v0, v0, v1

    return v0
.end method

.method private getTransX()F
    .locals 2

    .line 178
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->d:[F

    invoke-virtual {v0, v1}, Landroid/graphics/Matrix;->getValues([F)V

    .line 179
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->d:[F

    const/4 v1, 0x2

    aget v0, v0, v1

    return v0
.end method


# virtual methods
.method public a()Landroid/graphics/Bitmap;
    .locals 5

    const/4 v0, 0x1

    .line 215
    invoke-virtual {p0, v0}, Lcom/moji/camera/view/ScaleView;->setDrawingCacheEnabled(Z)V

    .line 216
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->buildDrawingCache()V

    .line 219
    :try_start_0
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->getDrawingCache()Landroid/graphics/Bitmap;

    move-result-object v0

    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->left:I

    iget-object v2, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    iget v2, v2, Landroid/graphics/Rect;->top:I

    iget-object v3, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    invoke-virtual {v3}, Landroid/graphics/Rect;->width()I

    move-result v3

    iget-object v4, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    invoke-virtual {v4}, Landroid/graphics/Rect;->height()I

    move-result v4

    invoke-static {v0, v1, v2, v3, v4}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIII)Landroid/graphics/Bitmap;

    move-result-object v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 222
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    .line 224
    :goto_0
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->destroyDrawingCache()V

    return-object v0
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 8

    .line 185
    invoke-super {p0, p1}, Landroid/widget/ImageView;->onDraw(Landroid/graphics/Canvas;)V

    .line 187
    invoke-virtual {p1}, Landroid/graphics/Canvas;->getWidth()I

    move-result v0

    int-to-float v4, v0

    invoke-virtual {p1}, Landroid/graphics/Canvas;->getHeight()I

    move-result v0

    int-to-float v5, v0

    const/4 v2, 0x0

    const/4 v3, 0x0

    const/4 v6, 0x0

    const/16 v7, 0x1f

    move-object v1, p1

    invoke-virtual/range {v1 .. v7}, Landroid/graphics/Canvas;->saveLayer(FFFFLandroid/graphics/Paint;I)I

    move-result v0

    .line 188
    iget v1, p0, Lcom/moji/camera/view/ScaleView;->g:I

    int-to-float v5, v1

    iget v1, p0, Lcom/moji/camera/view/ScaleView;->h:I

    int-to-float v6, v1

    iget-object v7, p0, Lcom/moji/camera/view/ScaleView;->t:Landroid/graphics/Paint;

    const/4 v4, 0x0

    move-object v2, p1

    invoke-virtual/range {v2 .. v7}, Landroid/graphics/Canvas;->drawRect(FFFFLandroid/graphics/Paint;)V

    .line 189
    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->u:Landroid/graphics/Paint;

    const v2, -0xff0100

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setColor(I)V

    .line 190
    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->u:Landroid/graphics/Paint;

    iget-object v2, p0, Lcom/moji/camera/view/ScaleView;->v:Landroid/graphics/PorterDuffXfermode;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    .line 191
    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    iget-object v2, p0, Lcom/moji/camera/view/ScaleView;->u:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 192
    iget-object v1, p0, Lcom/moji/camera/view/ScaleView;->u:Landroid/graphics/Paint;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    .line 193
    invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->restoreToCount(I)V

    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 2

    .line 58
    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/ImageView;->onSizeChanged(IIII)V

    .line 59
    iput p1, p0, Lcom/moji/camera/view/ScaleView;->g:I

    .line 60
    iput p2, p0, Lcom/moji/camera/view/ScaleView;->h:I

    iput p2, p0, Lcom/moji/camera/view/ScaleView;->s:I

    .line 61
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->h:I

    int-to-float p1, p1

    iget p2, p0, Lcom/moji/camera/view/ScaleView;->c:F

    sub-float/2addr p1, p2

    const/high16 p2, 0x40000000    # 2.0f

    div-float/2addr p1, p2

    iput p1, p0, Lcom/moji/camera/view/ScaleView;->q:F

    .line 63
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/camera/view/ScaleView;->i:Landroid/graphics/drawable/Drawable;

    .line 64
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object p1

    invoke-virtual {p1}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result p1

    iput p1, p0, Lcom/moji/camera/view/ScaleView;->j:I

    .line 65
    invoke-virtual {p0}, Lcom/moji/camera/view/ScaleView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object p1

    invoke-virtual {p1}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result p1

    iput p1, p0, Lcom/moji/camera/view/ScaleView;->k:I

    .line 66
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->c:F

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->k:I

    int-to-float p3, p3

    div-float/2addr p1, p3

    iput p1, p0, Lcom/moji/camera/view/ScaleView;->l:F

    .line 67
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->c:F

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->j:I

    int-to-float p3, p3

    div-float/2addr p1, p3

    iput p1, p0, Lcom/moji/camera/view/ScaleView;->m:F

    .line 69
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->l:F

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->m:F

    cmpl-float p1, p1, p3

    if-lez p1, :cond_0

    iget p1, p0, Lcom/moji/camera/view/ScaleView;->l:F

    goto :goto_0

    :cond_0
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->m:F

    :goto_0
    iput p1, p0, Lcom/moji/camera/view/ScaleView;->n:F

    const-string p1, "ScaleView"

    .line 70
    new-instance p3, Ljava/lang/StringBuilder;

    invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V

    const-string p4, "setImage 333: "

    invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->c:F

    invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    const-string p4, "   "

    invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->o:F

    invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p3

    invoke-static {p1, p3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 73
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->j:I

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->k:I

    if-ge p1, p3, :cond_1

    .line 74
    iget-object p1, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->n:F

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->n:F

    invoke-virtual {p1, p3, p4}, Landroid/graphics/Matrix;->postScale(FF)Z

    .line 75
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->k:I

    int-to-float p1, p1

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->n:F

    mul-float p1, p1, p3

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->g:I

    int-to-float p3, p3

    sub-float/2addr p1, p3

    div-float/2addr p1, p2

    .line 76
    iget-object p2, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    neg-float p1, p1

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->q:F

    invoke-virtual {p2, p1, p3}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    goto :goto_1

    .line 78
    :cond_1
    iget-object p1, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->n:F

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->n:F

    invoke-virtual {p1, p3, p4}, Landroid/graphics/Matrix;->postScale(FF)Z

    .line 79
    iget p1, p0, Lcom/moji/camera/view/ScaleView;->q:F

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->j:I

    int-to-float p3, p3

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->n:F

    mul-float p3, p3, p4

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->c:F

    sub-float/2addr p3, p4

    div-float/2addr p3, p2

    sub-float/2addr p1, p3

    .line 80
    iget-object p2, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->o:F

    invoke-virtual {p2, p3, p1}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    .line 84
    :goto_1
    iget-object p1, p0, Lcom/moji/camera/view/ScaleView;->p:Landroid/graphics/Rect;

    iget p2, p0, Lcom/moji/camera/view/ScaleView;->o:F

    float-to-int p2, p2

    iget p3, p0, Lcom/moji/camera/view/ScaleView;->q:F

    float-to-int p3, p3

    iget p4, p0, Lcom/moji/camera/view/ScaleView;->o:F

    iget v0, p0, Lcom/moji/camera/view/ScaleView;->c:F

    add-float/2addr p4, v0

    float-to-int p4, p4

    iget v0, p0, Lcom/moji/camera/view/ScaleView;->q:F

    iget v1, p0, Lcom/moji/camera/view/ScaleView;->c:F

    add-float/2addr v0, v1

    const/high16 v1, 0x3f800000    # 1.0f

    invoke-static {v1}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v1

    int-to-float v1, v1

    sub-float/2addr v0, v1

    float-to-int v0, v0

    invoke-virtual {p1, p2, p3, p4, v0}, Landroid/graphics/Rect;->set(IIII)V

    .line 85
    iget-object p1, p0, Lcom/moji/camera/view/ScaleView;->e:Landroid/graphics/Matrix;

    invoke-virtual {p0, p1}, Lcom/moji/camera/view/ScaleView;->setImageMatrix(Landroid/graphics/Matrix;)V

    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 1

    .line 167
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->a:Landroid/view/GestureDetector;

    invoke-virtual {v0, p1}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z

    .line 168
    iget-object v0, p0, Lcom/moji/camera/view/ScaleView;->f:Landroid/view/ScaleGestureDetector;

    invoke-virtual {v0, p1}, Landroid/view/ScaleGestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result p1

    return p1
.end method

.method public setImage(Ljava/lang/String;)V
    .locals 2

    .line 207
    iget v0, p0, Lcom/moji/camera/view/ScaleView;->r:I

    iget v1, p0, Lcom/moji/camera/view/ScaleView;->s:I

    invoke-static {p1, v0, v1}, Lcom/moji/camera/view/ScaleView;->a(Ljava/lang/String;II)Landroid/graphics/Bitmap;

    move-result-object p1

    .line 208
    invoke-virtual {p0, p1}, Lcom/moji/camera/view/ScaleView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    return-void
.end method
