pygame.surfarray.array3d()的作用

来源:互联网 发布:网络策划 编辑:程序博客网 时间:2024/06/05 02:20

pygame.surfarray.array3d()
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. 跟老菜鸟学python

http://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/2579

7.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

0 0