UnsharpMaskSpecSerializer.java
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.scene7.is.util.serializers.Serializer
* org.jetbrains.annotations.NotNull
*/
package com.scene7.is.ps.provider;
import com.scene7.is.ps.provider.UnsharpMaskSpec;
import com.scene7.is.util.serializers.Serializer;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.jetbrains.annotations.NotNull;
public class UnsharpMaskSpecSerializer
implements Serializer<UnsharpMaskSpec> {
private static final Serializer<UnsharpMaskSpec> INSTANCE = new UnsharpMaskSpecSerializer();
@NotNull
public static Serializer<UnsharpMaskSpec> create() {
return INSTANCE;
}
@NotNull
public UnsharpMaskSpec load(@NotNull DataInput in) throws IOException {
return UnsharpMaskSpec.builder().setAmount(in.readDouble()).setRadius(in.readDouble()).setThreshold(in.readDouble()).setLightnessOnly(in.readBoolean()).getProduct();
}
public void store(@NotNull UnsharpMaskSpec value, @NotNull DataOutput out) throws IOException {
out.writeDouble(value.amount);
out.writeDouble(value.radius);
out.writeDouble(value.threshold);
out.writeBoolean(value.lightnessOnly);
}
public int dataLength() throws UnsupportedOperationException {
return 25;
}
private UnsharpMaskSpecSerializer() {
}
}