IppImageAnchor.java
11.4 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
/*
* 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.IppImageAnchorExtension;
import com.scene7.is.ipp.messages.IppImageAnchorFileName;
import com.scene7.is.ipp.messages.IppImageAnchorFxg;
import com.scene7.is.ipp.messages.IppImageAnchorPhotoFont;
import com.scene7.is.ipp.messages.IppImageAnchorRandomAccessUrl;
import com.scene7.is.ipp.messages.IppImageAnchorS3File;
import com.scene7.is.ipp.messages.IppImageAnchorSolid;
import com.scene7.is.ipp.messages.IppImageAnchorSvg;
import com.scene7.is.ipp.messages.IppImageAnchorUrl;
import com.scene7.is.ipp.messages.IppImageAnchorVirtualPath;
import com.scene7.is.ipp.messages.IppInt;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.Writer;
public abstract class IppImageAnchor {
public static IppImageAnchor Unstuff(byte[] arr, Offset arrayPos) {
int tp = Ipp.UnstuffInt(arr, arrayPos.val);
switch (tp) {
case 65537: {
IppImageAnchorFileName c = IppImageAnchorFileName.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorFileName unstuff derived");
return c;
}
case 65538: {
IppImageAnchorVirtualPath c = IppImageAnchorVirtualPath.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorVirtualPath unstuff derived");
return c;
}
case 65540: {
IppImageAnchorSolid c = IppImageAnchorSolid.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorSolid unstuff derived");
return c;
}
case 65543: {
IppImageAnchorSvg c = IppImageAnchorSvg.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorSvg unstuff derived");
return c;
}
case 65544: {
IppImageAnchorFxg c = IppImageAnchorFxg.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorFxg unstuff derived");
return c;
}
case 65545: {
IppImageAnchorUrl c = IppImageAnchorUrl.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorUrl unstuff derived");
return c;
}
case 65546: {
IppImageAnchorPhotoFont c = IppImageAnchorPhotoFont.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorPhotoFont unstuff derived");
return c;
}
case 65547: {
IppImageAnchorS3File c = IppImageAnchorS3File.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorS3File unstuff derived");
return c;
}
case 65549: {
IppImageAnchorRandomAccessUrl c = IppImageAnchorRandomAccessUrl.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorRandomAccessUrl unstuff derived");
return c;
}
case 131071: {
IppImageAnchorExtension c = IppImageAnchorExtension.UnstuffDerived(arr, arrayPos);
Ipp.Assert(c != null, "IppImageAnchorExtension unstuff derived");
return c;
}
}
IppInt.Unstuff(arr, arrayPos);
IppByte.UnstuffFixedArray(arr, arrayPos, 44);
Ipp.Assert(false, "IppImageAnchor default unstuff");
return null;
}
public static IppImageAnchor[] UnstuffArray(byte[] arr, Offset arrayPos) {
Ipp.Assert((arrayPos.val & 3) == 0, "IppImageAnchor alignemt");
int count = IppInt.Unstuff(arr, arrayPos);
int size = IppInt.Unstuff(arr, arrayPos);
Ipp.Assert(count == 0 || size >= 48, "IppImageAnchor count");
Offset roff = new Offset(IppInt.Unstuff(arr, arrayPos));
Offset loff = new Offset(roff.val);
IppImageAnchor[] result = new IppImageAnchor[count];
for (int i = 0; i < count; ++i) {
loff.val = roff.val;
result[i] = IppImageAnchor.Unstuff(arr, loff);
roff.val += size;
}
return result;
}
public static IppImageAnchor[] UnstuffFixedArray(byte[] arr, Offset arrayPos, int count) {
IppImageAnchor[] result = new IppImageAnchor[count];
for (int i = 0; i < count; ++i) {
result[i] = IppImageAnchor.Unstuff(arr, arrayPos);
}
return result;
}
public static void Stuff(byte[] arr, Offset arrayPos, Offset varPos, IppImageAnchor val) {
int swv = val != null ? val.type() : -1;
switch (swv) {
case 65537: {
IppImageAnchorFileName.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorFileName)val);
break;
}
case 65538: {
IppImageAnchorVirtualPath.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorVirtualPath)val);
break;
}
case 65540: {
IppImageAnchorSolid.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorSolid)val);
break;
}
case 65543: {
IppImageAnchorSvg.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorSvg)val);
break;
}
case 65544: {
IppImageAnchorFxg.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorFxg)val);
break;
}
case 65545: {
IppImageAnchorUrl.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorUrl)val);
break;
}
case 65546: {
IppImageAnchorPhotoFont.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorPhotoFont)val);
break;
}
case 65547: {
IppImageAnchorS3File.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorS3File)val);
break;
}
case 65549: {
IppImageAnchorRandomAccessUrl.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorRandomAccessUrl)val);
break;
}
case 131071: {
IppImageAnchorExtension.StuffDerived(arr, arrayPos, varPos, (IppImageAnchorExtension)val);
break;
}
default: {
if (val != null) {
IppInt.Stuff(arr, arrayPos, varPos, val.type());
} else {
Ipp.StuffNullBytes(arr, arrayPos, 4);
}
Ipp.StuffNullBytes(arr, arrayPos, 44);
Ipp.Assert(false, "IppImageAnchor default stuff");
}
}
}
public static void StuffArray(byte[] arr, Offset arrayPos, Offset varPos, IppImageAnchor[] val) {
Ipp.Assert((arrayPos.val & 3) == 0, "IppImageAnchor stuffarray align");
int len = val != null ? val.length : 0;
IppInt.Stuff(arr, arrayPos, varPos, len);
IppInt.Stuff(arr, arrayPos, varPos, 48);
Ipp.StuffOffset(arr, arrayPos, varPos, len > 0 ? 4 : 1);
Offset varvarPos = new Offset(varPos.val + 48 * len);
for (int i = 0; i < len; ++i) {
IppImageAnchor.Stuff(arr, varPos, varvarPos, val[i]);
}
varPos.val = varvarPos.val;
}
public static void StuffFixedArray(byte[] arr, Offset arrayPos, Offset varPos, int count, IppImageAnchor[] val) {
Ipp.Assert(val.length == count, "IppImageAnchor count");
for (int i = 0; i < count; ++i) {
IppImageAnchor.Stuff(arr, arrayPos, varPos, val[i]);
}
}
public static void Print(Writer tf, String label, IppImageAnchor it) throws IOException {
if (it == null) {
tf.write(label + "IppImageAnchor: NULL!!\n");
return;
}
switch (it.type()) {
case 65537: {
Ipp.Assert(it instanceof IppImageAnchorFileName, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorFileName c = (IppImageAnchorFileName)it;
IppImageAnchorFileName.Print(tf, label, c);
break;
}
case 65538: {
Ipp.Assert(it instanceof IppImageAnchorVirtualPath, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorVirtualPath c = (IppImageAnchorVirtualPath)it;
IppImageAnchorVirtualPath.Print(tf, label, c);
break;
}
case 65540: {
Ipp.Assert(it instanceof IppImageAnchorSolid, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorSolid c = (IppImageAnchorSolid)it;
IppImageAnchorSolid.Print(tf, label, c);
break;
}
case 65543: {
Ipp.Assert(it instanceof IppImageAnchorSvg, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorSvg c = (IppImageAnchorSvg)it;
IppImageAnchorSvg.Print(tf, label, c);
break;
}
case 65544: {
Ipp.Assert(it instanceof IppImageAnchorFxg, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorFxg c = (IppImageAnchorFxg)it;
IppImageAnchorFxg.Print(tf, label, c);
break;
}
case 65545: {
Ipp.Assert(it instanceof IppImageAnchorUrl, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorUrl c = (IppImageAnchorUrl)it;
IppImageAnchorUrl.Print(tf, label, c);
break;
}
case 65546: {
Ipp.Assert(it instanceof IppImageAnchorPhotoFont, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorPhotoFont c = (IppImageAnchorPhotoFont)it;
IppImageAnchorPhotoFont.Print(tf, label, c);
break;
}
case 65547: {
Ipp.Assert(it instanceof IppImageAnchorS3File, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorS3File c = (IppImageAnchorS3File)it;
IppImageAnchorS3File.Print(tf, label, c);
break;
}
case 65549: {
Ipp.Assert(it instanceof IppImageAnchorRandomAccessUrl, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorRandomAccessUrl c = (IppImageAnchorRandomAccessUrl)it;
IppImageAnchorRandomAccessUrl.Print(tf, label, c);
break;
}
case 131071: {
Ipp.Assert(it instanceof IppImageAnchorExtension, "IppImageAnchor not a IppImageAnchor");
IppImageAnchorExtension c = (IppImageAnchorExtension)it;
IppImageAnchorExtension.Print(tf, label, c);
break;
}
default: {
tf.write(label + "Unknown IppImageAnchor type\n");
}
}
}
public static void PrintArray(Writer tf, String label, IppImageAnchor[] it) throws IOException {
String ll = label + "IppImageAnchor 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 + "IppImageAnchor[" + String.valueOf(i) + "]: ";
IppImageAnchor.Print(tf, ll, it[i]);
}
}
public abstract void adjustVarPos(Offset var1);
public abstract int type();
}