def convert(self, format): print("Converting from {} to {}".format( self.image_format().name, VTFLibEnums.ImageFormat(format).name)) new_size = self.compute_image_size(self.width(), self.height(), self.depth(), self.mipmap_count(), format) new_buffer = cast((c_byte * new_size)(), POINTER(c_byte)) if not self.ImageConvert(self.ImageGetData(0, 0, 0, 0), new_buffer, self.width(), self.height(), self.image_format().value, format): return pointer_to_array(new_buffer, new_size) else: sys.stderr.write('CAN\'T CONVERT IMAGE\n') return 0
def get_image_flags(self): return VTFLibEnums.ImageFlag(self.ImageGetFlags())