OYLAFIHLW6O3VBMJHWRJM4QS5VEA2UJXLLTSHUEELUMYUA5L3NJAC
return (tl, tr, bl, br)
self.children = [tl, tr, bl, br]
return self.children
def serialize(self):
result = []
if self.children:
result.append(struct.pack('<B', 0))
for child in self.children:
result.append(child.serialize())
else:
result.append(struct.pack('<B', 1))
result.append(struct.pack('<BBB', *self.color))
return ''.join(result)
quad = Quad(self, (0, 0, self.width, self.height), 0)
self.push(quad)
self.root = Quad(self, (0, 0, self.width, self.height), 0)
self.push(self.root)
self.error_numerator = self.root.error * self.root.area
self.error_denominator = self.root.area
def total_error(self):
return self.error_numerator / self.error_denominator