Skip to content

Commit 35f4a4d

Browse files
committed
Work on property enums as these are scoped to the data we are encoding. eg the root doc doesn't have a blend mode to encode
1 parent 1f82938 commit 35f4a4d

File tree

7 files changed

+335
-252
lines changed

7 files changed

+335
-252
lines changed

documentation/reference/gimpformats/GimpIOBase.md

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
## GimpIOBase
4040

41-
[Show source in GimpIOBase.py:34](../../../gimpformats/GimpIOBase.py#L34)
41+
[Show source in GimpIOBase.py:35](../../../gimpformats/GimpIOBase.py#L35)
4242

4343
#### Signature
4444

@@ -49,7 +49,7 @@ class GimpIOBase:
4949

5050
### GimpIOBase().__repr__
5151

52-
[Show source in GimpIOBase.py:566](../../../gimpformats/GimpIOBase.py#L566)
52+
[Show source in GimpIOBase.py:554](../../../gimpformats/GimpIOBase.py#L554)
5353

5454
Get a textual representation of this object.
5555

@@ -61,7 +61,7 @@ def __repr__(self) -> str: ...
6161

6262
### GimpIOBase().__str__
6363

64-
[Show source in GimpIOBase.py:562](../../../gimpformats/GimpIOBase.py#L562)
64+
[Show source in GimpIOBase.py:550](../../../gimpformats/GimpIOBase.py#L550)
6565

6666
Get a textual representation of this object.
6767

@@ -73,7 +73,7 @@ def __str__(self) -> str: ...
7373

7474
### GimpIOBase()._colormapDecode
7575

76-
[Show source in GimpIOBase.py:194](../../../gimpformats/GimpIOBase.py#L194)
76+
[Show source in GimpIOBase.py:195](../../../gimpformats/GimpIOBase.py#L195)
7777

7878
_colormapDecode_.
7979

@@ -91,7 +91,7 @@ def _colormapDecode(self, data: bytearray | IO, index: int = 0) -> None: ...
9191

9292
### GimpIOBase()._guidelinesDecode
9393

94-
[Show source in GimpIOBase.py:142](../../../gimpformats/GimpIOBase.py#L142)
94+
[Show source in GimpIOBase.py:143](../../../gimpformats/GimpIOBase.py#L143)
9595

9696
Decode guidelines.
9797

@@ -103,7 +103,7 @@ def _guidelinesDecode(self, data: bytearray) -> None: ...
103103

104104
### GimpIOBase()._itemPathDecode
105105

106-
[Show source in GimpIOBase.py:152](../../../gimpformats/GimpIOBase.py#L152)
106+
[Show source in GimpIOBase.py:153](../../../gimpformats/GimpIOBase.py#L153)
107107

108108
Decode item path.
109109

@@ -115,7 +115,7 @@ def _itemPathDecode(self, data: bytearray) -> None: ...
115115

116116
### GimpIOBase()._parasitesDecode
117117

118-
[Show source in GimpIOBase.py:125](../../../gimpformats/GimpIOBase.py#L125)
118+
[Show source in GimpIOBase.py:126](../../../gimpformats/GimpIOBase.py#L126)
119119

120120
Decode list of parasites.
121121

@@ -127,7 +127,7 @@ def _parasitesDecode(self, data: bytearray) -> int: ...
127127

128128
### GimpIOBase()._parasitesEncode
129129

130-
[Show source in GimpIOBase.py:135](../../../gimpformats/GimpIOBase.py#L135)
130+
[Show source in GimpIOBase.py:136](../../../gimpformats/GimpIOBase.py#L136)
131131

132132
Encode list of parasites.
133133

@@ -139,7 +139,7 @@ def _parasitesEncode(self) -> bytearray: ...
139139

140140
### GimpIOBase()._propertiesDecode
141141

142-
[Show source in GimpIOBase.py:540](../../../gimpformats/GimpIOBase.py#L540)
142+
[Show source in GimpIOBase.py:515](../../../gimpformats/GimpIOBase.py#L515)
143143

144144
Decode a list of properties.
145145

@@ -155,10 +155,14 @@ def _propertiesDecode(self, ioBuf: IO) -> int: ...
155155

156156
### GimpIOBase()._propertiesEncode
157157

158-
[Show source in GimpIOBase.py:553](../../../gimpformats/GimpIOBase.py#L553)
158+
[Show source in GimpIOBase.py:530](../../../gimpformats/GimpIOBase.py#L530)
159159

160160
Encode a list of properties.
161161

162+
uint32 prop_type Type identification
163+
uint32 len(payload) size of payload
164+
bytes[] payload
165+
162166
#### Signature
163167

164168
```python
@@ -167,15 +171,10 @@ def _propertiesEncode(self) -> bytearray: ...
167171

168172
### GimpIOBase()._propertyDecode
169173

170-
[Show source in GimpIOBase.py:239](../../../gimpformats/GimpIOBase.py#L239)
174+
[Show source in GimpIOBase.py:240](../../../gimpformats/GimpIOBase.py#L240)
171175

172176
Decode a single property.
173177

174-
Many properties are in the form
175-
prop: one of PROP_
176-
lengthOfData: 4
177-
data: varies but is often ioBuf.32 or ioBuf.boolean
178-
179178
#### Signature
180179

181180
```python
@@ -184,17 +183,10 @@ def _propertyDecode(self, prop: int, data: bytearray) -> int: ...
184183

185184
### GimpIOBase()._propertyEncode
186185

187-
[Show source in GimpIOBase.py:350](../../../gimpformats/GimpIOBase.py#L350)
186+
[Show source in GimpIOBase.py:343](../../../gimpformats/GimpIOBase.py#L343)
188187

189188
Encode a single property.
190189

191-
Many properties are in the form
192-
prop: one of PROP_
193-
lengthOfData: 4
194-
data: varies but is often ioBuf.32 or ioBuf.boolean
195-
196-
If the property is the same as the default, or not specified, returns empty array
197-
198190
#### Signature
199191

200192
```python
@@ -203,7 +195,7 @@ def _propertyEncode(self, prop: int) -> bytearray: ...
203195

204196
### GimpIOBase()._samplePointsDecode
205197

206-
[Show source in GimpIOBase.py:227](../../../gimpformats/GimpIOBase.py#L227)
198+
[Show source in GimpIOBase.py:228](../../../gimpformats/GimpIOBase.py#L228)
207199

208200
Decode a series of points.
209201

@@ -215,7 +207,7 @@ def _samplePointsDecode(self, data: bytearray) -> None: ...
215207

216208
### GimpIOBase()._userUnitsDecode
217209

218-
[Show source in GimpIOBase.py:221](../../../gimpformats/GimpIOBase.py#L221)
210+
[Show source in GimpIOBase.py:222](../../../gimpformats/GimpIOBase.py#L222)
219211

220212
Decode a set of user-defined measurement units.
221213

@@ -227,7 +219,7 @@ def _userUnitsDecode(self, data: bytearray) -> None: ...
227219

228220
### GimpIOBase()._vectorsDecode
229221

230-
[Show source in GimpIOBase.py:162](../../../gimpformats/GimpIOBase.py#L162)
222+
[Show source in GimpIOBase.py:163](../../../gimpformats/GimpIOBase.py#L163)
231223

232224
Decode vectors.
233225

@@ -239,7 +231,7 @@ def _vectorsDecode(self, data: bytearray) -> None: ...
239231

240232
### GimpIOBase().activeVector
241233

242-
[Show source in GimpIOBase.py:176](../../../gimpformats/GimpIOBase.py#L176)
234+
[Show source in GimpIOBase.py:177](../../../gimpformats/GimpIOBase.py#L177)
243235

244236
Get the vector that is currently active.
245237

@@ -256,7 +248,7 @@ def activeVector(self) -> GimpVector: ...
256248

257249
### GimpIOBase().doc
258250

259-
[Show source in GimpIOBase.py:103](../../../gimpformats/GimpIOBase.py#L103)
251+
[Show source in GimpIOBase.py:104](../../../gimpformats/GimpIOBase.py#L104)
260252

261253
#### Signature
262254

@@ -267,7 +259,7 @@ def doc(self) -> GimpIOBase: ...
267259

268260
### GimpIOBase().expanded
269261

270-
[Show source in GimpIOBase.py:181](../../../gimpformats/GimpIOBase.py#L181)
262+
[Show source in GimpIOBase.py:182](../../../gimpformats/GimpIOBase.py#L182)
271263

272264
Is the group layer expanded.
273265

@@ -280,7 +272,7 @@ def expanded(self) -> bool: ...
280272

281273
### GimpIOBase().expanded
282274

283-
[Show source in GimpIOBase.py:186](../../../gimpformats/GimpIOBase.py#L186)
275+
[Show source in GimpIOBase.py:187](../../../gimpformats/GimpIOBase.py#L187)
284276

285277
Is the group layer expanded.
286278

@@ -293,7 +285,7 @@ def expanded(self, expanded: bool) -> None: ...
293285

294286
### GimpIOBase().full_repr
295287

296-
[Show source in GimpIOBase.py:577](../../../gimpformats/GimpIOBase.py#L577)
288+
[Show source in GimpIOBase.py:565](../../../gimpformats/GimpIOBase.py#L565)
297289

298290
Get a textual representation of this object.
299291

@@ -305,7 +297,7 @@ def full_repr(self, indent: int = 0) -> str: ...
305297

306298
### GimpIOBase().pointerSize
307299

308-
[Show source in GimpIOBase.py:77](../../../gimpformats/GimpIOBase.py#L77)
300+
[Show source in GimpIOBase.py:78](../../../gimpformats/GimpIOBase.py#L78)
309301

310302
Determine the size of the "pointer" datatype based on the document version.
311303

@@ -322,7 +314,7 @@ def pointerSize(self) -> int: ...
322314

323315
### GimpIOBase().root
324316

325-
[Show source in GimpIOBase.py:110](../../../gimpformats/GimpIOBase.py#L110)
317+
[Show source in GimpIOBase.py:111](../../../gimpformats/GimpIOBase.py#L111)
326318

327319
Get the root of the file object tree (Which is the same as self.doc).
328320

@@ -335,7 +327,7 @@ def root(self) -> GimpIOBase: ...
335327

336328
### GimpIOBase().tattoo
337329

338-
[Show source in GimpIOBase.py:115](../../../gimpformats/GimpIOBase.py#L115)
330+
[Show source in GimpIOBase.py:116](../../../gimpformats/GimpIOBase.py#L116)
339331

340332
Gimp nomenclature for the item's unique id.
341333

@@ -348,7 +340,7 @@ def tattoo(self) -> Any | None: ...
348340

349341
### GimpIOBase().tattoo
350342

351-
[Show source in GimpIOBase.py:120](../../../gimpformats/GimpIOBase.py#L120)
343+
[Show source in GimpIOBase.py:121](../../../gimpformats/GimpIOBase.py#L121)
352344

353345
Gimp nomenclature for the item's unique id.
354346

@@ -363,7 +355,7 @@ def tattoo(self, tattoo: Any | None) -> None: ...
363355

364356
## GimpUserUnits
365357

366-
[Show source in GimpIOBase.py:654](../../../gimpformats/GimpIOBase.py#L654)
358+
[Show source in GimpIOBase.py:642](../../../gimpformats/GimpIOBase.py#L642)
367359

368360
User-defined measurement units.
369361

@@ -376,7 +368,7 @@ class GimpUserUnits:
376368

377369
### GimpUserUnits().__str__
378370

379-
[Show source in GimpIOBase.py:701](../../../gimpformats/GimpIOBase.py#L701)
371+
[Show source in GimpIOBase.py:689](../../../gimpformats/GimpIOBase.py#L689)
380372

381373
Get a textual representation of this object.
382374

@@ -388,7 +380,7 @@ def __str__(self) -> str: ...
388380

389381
### GimpUserUnits().decode
390382

391-
[Show source in GimpIOBase.py:666](../../../gimpformats/GimpIOBase.py#L666)
383+
[Show source in GimpIOBase.py:654](../../../gimpformats/GimpIOBase.py#L654)
392384

393385
Decode a byte buffer.
394386

@@ -411,7 +403,7 @@ def decode(self, data: bytearray, index: int = 0) -> int: ...
411403

412404
### GimpUserUnits().encode
413405

414-
[Show source in GimpIOBase.py:689](../../../gimpformats/GimpIOBase.py#L689)
406+
[Show source in GimpIOBase.py:677](../../../gimpformats/GimpIOBase.py#L677)
415407

416408
Convert this object to raw bytearray.
417409

@@ -423,7 +415,7 @@ def encode(self) -> bytearray: ...
423415

424416
### GimpUserUnits().full_repr
425417

426-
[Show source in GimpIOBase.py:705](../../../gimpformats/GimpIOBase.py#L705)
418+
[Show source in GimpIOBase.py:693](../../../gimpformats/GimpIOBase.py#L693)
427419

428420
Get a textual representation of this object.
429421

@@ -437,7 +429,7 @@ def full_repr(self, indent: int = 0) -> str: ...
437429

438430
## camel_to_pascal_with_spaces
439431

440-
[Show source in GimpIOBase.py:29](../../../gimpformats/GimpIOBase.py#L29)
432+
[Show source in GimpIOBase.py:30](../../../gimpformats/GimpIOBase.py#L30)
441433

442434
#### Signature
443435

0 commit comments

Comments
 (0)