a.smali

.class public Lh7/a;
.super Lg7/a;
.source "AutoFixFilter.java"

# interfaces
.implements Lg7/e;


# instance fields
.field public i:F

.field public j:I


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>()V
    .registers 2

    invoke-direct {p0}, Lg7/a;-><init>()V

    const/high16 v0, 0x3f800000    # 1.0f

    iput v0, p0, Lh7/a;->i:F

    const/4 v0, -0x1

    iput v0, p0, Lh7/a;->j:I

    return-void
.end method


# virtual methods
.method public a(I)V
    .registers 3

    invoke-super {p0, p1}, Lg7/a;->a(I)V

    const-string v0, "scale"

    invoke-static {p1, v0}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result p1

    iput p1, p0, Lh7/a;->j:I

    invoke-static {p1, v0}, Ls7/a;->a(ILjava/lang/String;)V

    return-void
.end method

.method public b(F)V
    .registers 2

    invoke-virtual {p0, p1}, Lh7/a;->c(F)V

    return-void
.end method

.method public b(J[F)V
    .registers 4
    .param p1    # J
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    invoke-super {p0, p1, p2, p3}, Lg7/a;->b(J[F)V

    iget p1, p0, Lh7/a;->j:I

    iget p2, p0, Lh7/a;->i:F

    invoke-static {p1, p2}, Landroid/opengl/GLES20;->glUniform1f(IF)V

    const-string p1, "glUniform1f"

    invoke-static {p1}, Ls7/a;->a(Ljava/lang/String;)V

    return-void
.end method

.method public c()Ljava/lang/String;
    .registers 2
    .annotation build Landroidx/annotation/NonNull;
    .end annotation

    const-string v0, "#extension GL_OES_EGL_image_external : require\nprecision mediump float;\nuniform samplerExternalOES tex_sampler_0;\nuniform samplerExternalOES tex_sampler_1;\nuniform samplerExternalOES tex_sampler_2;\nuniform float scale;\nfloat shift_scale;\nfloat hist_offset;\nfloat hist_scale;\nfloat density_offset;\nfloat density_scale;\nvarying vec2 vTextureCoord;\nvoid main() {\n  shift_scale = 0.00390625;\n  hist_offset = 6.527415E-4;\n  hist_scale = 0.99869454;\n  density_offset = 4.8828125E-4;\n  density_scale = 0.99902344;\n  const vec3 weights = vec3(0.33333, 0.33333, 0.33333);\n  vec4 color = texture2D(tex_sampler_0, vTextureCoord);\n  float energy = dot(color.rgb, weights);\n  float mask_value = energy - 0.5;\n  float alpha;\n  if (mask_value > 0.0) {\n    alpha = (pow(2.0 * mask_value, 1.5) - 1.0) * scale + 1.0;\n  } else { \n    alpha = (pow(2.0 * mask_value, 2.0) - 1.0) * scale + 1.0;\n  }\n  float index = energy * hist_scale + hist_offset;\n  vec4 temp = texture2D(tex_sampler_1, vec2(index, 0.5));\n  float value = temp.g + temp.r * shift_scale;\n  index = value * density_scale + density_offset;\n  temp = texture2D(tex_sampler_2, vec2(index, 0.5));\n  value = temp.g + temp.r * shift_scale;\n  float dst_energy = energy * alpha + value * (1.0 - alpha);\n  float max_energy = energy / max(color.r, max(color.g, color.b));\n  if (dst_energy > max_energy) {\n    dst_energy = max_energy;\n  }\n  if (energy == 0.0) {\n    gl_FragColor = color;\n  } else {\n    gl_FragColor = vec4(color.rgb * dst_energy / energy, color.a);\n  }\n}\n"

    return-object v0
.end method

.method public c(F)V
    .registers 4

    const/4 v0, 0x0

    cmpg-float v1, p1, v0

    if-gez v1, :cond_6

    const/4 p1, 0x0

    :cond_6
    const/high16 v0, 0x3f800000    # 1.0f

    cmpl-float v1, p1, v0

    if-lez v1, :cond_e

    const/high16 p1, 0x3f800000    # 1.0f

    :cond_e
    iput p1, p0, Lh7/a;->i:F

    return-void
.end method

.method public d()F
    .registers 2

    invoke-virtual {p0}, Lh7/a;->g()F

    move-result v0

    return v0
.end method

.method public g()F
    .registers 2

    iget v0, p0, Lh7/a;->i:F

    return v0
.end method

.method public onDestroy()V
    .registers 2

    invoke-super {p0}, Lg7/a;->onDestroy()V

    const/4 v0, -0x1

    iput v0, p0, Lh7/a;->j:I

    return-void
.end method