IppPropInt.java
4.61 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
* Decompiled with CFR 0_118.
*/
package com.scene7.is.ipp.messages;
import com.scene7.is.ipp.messages.Ipp;
import com.scene7.is.ipp.messages.IppByte;
import com.scene7.is.ipp.messages.IppClientType;
import com.scene7.is.ipp.messages.IppColorModelType;
import com.scene7.is.ipp.messages.IppEncodingType;
import com.scene7.is.ipp.messages.IppFormatType;
import com.scene7.is.ipp.messages.IppInt;
import com.scene7.is.ipp.messages.IppLayoutType;
import com.scene7.is.ipp.messages.IppPixelType;
import com.scene7.is.ipp.messages.IppProp;
import com.scene7.is.ipp.messages.IppPropId;
import com.scene7.is.ipp.messages.IppPropType;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.Writer;
public class IppPropInt
extends IppProp {
private int id_;
private int value_;
public IppPropInt(int id, int value) {
this.id_ = id;
this.value_ = value;
}
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("[");
buffer.append("id: ").append(String.valueOf(this.id_)).append(" ");
buffer.append("value: ").append(String.valueOf(this.value_)).append(" ");
buffer.append("]");
return buffer.toString();
}
public boolean equals(Object o) {
if (!(o instanceof IppPropInt)) {
return false;
}
IppPropInt e = (IppPropInt)o;
if (this.id_ != e.id_) {
return false;
}
if (this.value_ != e.value_) {
return false;
}
return true;
}
public static IppPropInt UnstuffDerived(byte[] arr, Offset arrayPos) {
Ipp.Assert((arrayPos.val & 7) == 0, "IppPropInt align");
int type = IppInt.Unstuff(arr, arrayPos);
int id = IppInt.Unstuff(arr, arrayPos);
int value = IppInt.Unstuff(arr, arrayPos);
IppByte.UnstuffFixedArray(arr, arrayPos, 36);
Ipp.Assert(type == 65537, "IppPropInt enum id");
return new IppPropInt(id, value);
}
public static void StuffDerived(byte[] arr, Offset arrayPos, Offset varPos, IppPropInt val) {
Ipp.Assert((arrayPos.val & 7) == 0, "IppPropInt align");
if (val != null) {
IppInt.Stuff(arr, arrayPos, varPos, val.type());
IppInt.Stuff(arr, arrayPos, varPos, val.id());
IppInt.Stuff(arr, arrayPos, varPos, val.value());
Ipp.StuffNullBytes(arr, arrayPos, 36);
} else {
Ipp.StuffNullBytes(arr, arrayPos, 48);
}
}
public static void Print(Writer tf, String label, IppPropInt it) throws IOException {
String ll = label + "IppPropInt: ";
if (it == null) {
tf.write(ll + "NULL!!\n");
return;
}
tf.write(ll + "\n");
IppPropType.Print(tf, ll + "type: ", it.type());
IppPropId.Print(tf, ll + "id: ", it.id());
switch (it.id()) {
default: {
IppInt.Print(tf, ll + "value: ", it.value());
break;
}
case 65796: {
IppColorModelType.Print(tf, ll + "value: ", it.value());
break;
}
case 65797: {
IppPixelType.Print(tf, ll + "value: ", it.value());
break;
}
case 65798: {
IppFormatType.Print(tf, ll + "value: ", it.value());
break;
}
case 65799: {
IppLayoutType.Print(tf, ll + "value: ", it.value());
break;
}
case 65800: {
IppEncodingType.Print(tf, ll + "value: ", it.value());
break;
}
case 67078: {
IppClientType.Print(tf, ll + "value: ", it.value());
}
}
}
public static void PrintArray(Writer tf, String label, IppPropInt[] it) throws IOException {
String ll = label + "IppPropInt Array, length: ";
tf.write(ll);
if (it == null) {
tf.write("NULL!!!\n");
return;
}
tf.write("" + it.length + "\n");
for (int i = 0; i < it.length; ++i) {
ll = label + "IppPropInt[" + String.valueOf(i) + "]: ";
IppPropInt.Print(tf, ll, it[i]);
}
}
public void adjustVarPos(Offset varPos) {
}
public int type() {
return 65537;
}
public int id() {
return this.id_;
}
public int value() {
return this.value_;
}
public String toStringDerived() {
return String.valueOf(this.value());
}
public Object getValue() {
return new Integer(this.value());
}
}