-
Notifications
You must be signed in to change notification settings - Fork 109
/
ImageProperties.go
98 lines (83 loc) · 2.59 KB
/
ImageProperties.go
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
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package tflite_metadata
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type ImagePropertiesT struct {
ColorSpace ColorSpaceType
DefaultSize *ImageSizeT
}
func (t *ImagePropertiesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil { return 0 }
defaultSizeOffset := t.DefaultSize.Pack(builder)
ImagePropertiesStart(builder)
ImagePropertiesAddColorSpace(builder, t.ColorSpace)
ImagePropertiesAddDefaultSize(builder, defaultSizeOffset)
return ImagePropertiesEnd(builder)
}
func (rcv *ImageProperties) UnPackTo(t *ImagePropertiesT) {
t.ColorSpace = rcv.ColorSpace()
t.DefaultSize = rcv.DefaultSize(nil).UnPack()
}
func (rcv *ImageProperties) UnPack() *ImagePropertiesT {
if rcv == nil { return nil }
t := &ImagePropertiesT{}
rcv.UnPackTo(t)
return t
}
type ImageProperties struct {
_tab flatbuffers.Table
}
func GetRootAsImageProperties(buf []byte, offset flatbuffers.UOffsetT) *ImageProperties {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &ImageProperties{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsImageProperties(buf []byte, offset flatbuffers.UOffsetT) *ImageProperties {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &ImageProperties{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *ImageProperties) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *ImageProperties) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *ImageProperties) ColorSpace() ColorSpaceType {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return ColorSpaceType(rcv._tab.GetInt8(o + rcv._tab.Pos))
}
return 0
}
func (rcv *ImageProperties) MutateColorSpace(n ColorSpaceType) bool {
return rcv._tab.MutateInt8Slot(4, int8(n))
}
func (rcv *ImageProperties) DefaultSize(obj *ImageSize) *ImageSize {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
obj = new(ImageSize)
}
obj.Init(rcv._tab.Bytes, x)
return obj
}
return nil
}
func ImagePropertiesStart(builder *flatbuffers.Builder) {
builder.StartObject(2)
}
func ImagePropertiesAddColorSpace(builder *flatbuffers.Builder, colorSpace ColorSpaceType) {
builder.PrependInt8Slot(0, int8(colorSpace), 0)
}
func ImagePropertiesAddDefaultSize(builder *flatbuffers.Builder, defaultSize flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(defaultSize), 0)
}
func ImagePropertiesEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}