Copy pixels into a 3d array
array3d(Surface) -> array
Copy the pixels from a Surface into a 3D array. The bit depth of the surface will control the size of the integer values, and will work for any type of pixel format.
This function will temporarily lock the Surface as pixels are copied (see the pygame.Surface.lock() lock the Surface memory for pixel access - lock the Surface memory for pixel access method).
本函数主要锁住表面,然后把像素拷贝到一个三维数组,数组表示为:RGB的颜色整数值。
例子:
image_data = pygame.surfarray.array3d(pygame.display.get_surface()) pygame.display.update() FPSCLOCK.tick(FPS) #print self.upperPipes[0]['y'] + PIPE_HEIGHT - int(BASEY * 0.2) return image_data, reward, terminal 1.TensorFlow入门基本教程http://edu.csdn.net/course/detail/4369
2. C++标准模板库从入门到精通http://edu.csdn.net/course/detail/3324
3.跟老菜鸟学C++http://edu.csdn.net/course/detail/2901
4. 跟老菜鸟学pythonhttp://edu.csdn.net/course/detail/2592
5. 在VC2015里学会使用tinyxml库http://edu.csdn.net/course/detail/2590
6. 在windows下SVN的版本管理与实战 http://edu.csdn.net/course/detail/25797.Visual Studio 2015开发C++程序的基本使用 http://edu.csdn.net/course/detail/2570
8.在VC2015里使用protobuf协议http://edu.csdn.net/course/detail/2582
9.在VC2015里学会使用mysql数据库http://edu.csdn.net/course/detail/2672