annotate src/camera.doc @ 1849:301bc61643a9 math_module

merged changes from trunk
author lorenz
date Mon, 16 Nov 2009 18:31:40 +0000
parents cfc16dce35e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
1 pygame.camera
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
2 pygame module for camera use
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
3
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
4 Pygame currently supports only Linux and v4l2 cameras.
1532
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
5
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
6 EXPERIMENTAL!: This api may change or disappear in later
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
7 pygame releases. If you use this, your code will very likely
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
8 break with the next pygame release.
1782
9bec0f332824 Marked camera, gfxdraw, and scrap as experimental in the docs.
Rene Dudfield <renesd@gmail.com>
parents: 1532
diff changeset
9
9bec0f332824 Marked camera, gfxdraw, and scrap as experimental in the docs.
Rene Dudfield <renesd@gmail.com>
parents: 1532
diff changeset
10
9bec0f332824 Marked camera, gfxdraw, and scrap as experimental in the docs.
Rene Dudfield <renesd@gmail.com>
parents: 1532
diff changeset
11
1532
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
12 The Bayer to RGB function is based on:
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
13 Sonix SN9C101 based webcam basic I/F routines
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
14 Copyright (C) 2004 Takafumi Mizuno <taka-qce@ls-a.jp>
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
15
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
16 Redistribution and use in source and binary forms, with or without
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
17 modification, are permitted provided that the following conditions
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
18 are met:
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
19 1. Redistributions of source code must retain the above copyright
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
20 notice, this list of conditions and the following disclaimer.
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
21 2. Redistributions in binary form must reproduce the above copyright
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
22 notice, this list of conditions and the following disclaimer in the
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
23 documentation and/or other materials provided with the distribution.
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
24
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
25 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
26 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
27 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
28 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
29 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
30 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
31 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
32 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
33 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
34 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
35 SUCH DAMAGE.
e672d97c46c5 Licensing problems in the Camera module.
Nirav Patel <nrp@eclecti.cc>
parents: 1323
diff changeset
36
1782
9bec0f332824 Marked camera, gfxdraw, and scrap as experimental in the docs.
Rene Dudfield <renesd@gmail.com>
parents: 1532
diff changeset
37
9bec0f332824 Marked camera, gfxdraw, and scrap as experimental in the docs.
Rene Dudfield <renesd@gmail.com>
parents: 1532
diff changeset
38 New in pygame 1.9.0.
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
39 <SECTION>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
40
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
41 colorspace
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
42 Surface colorspace conversion
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
43 pygame.camera.colorspace(Surface, format, DestSurface = None): return Surface
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
44
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
45 Allows for conversion from "RGB" to a destination colorspace of "HSV" or "YUV".
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
46 The source and destination surfaces must be the same size and pixel depth.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
47 This is useful for computer vision on devices with limited processing power.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
48 Capture as small of an image as possible, transform.scale() it even smaller,
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
49 and then convert the colorspace to YUV or HSV before doing any processing on it.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
50 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
51
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
52 list_cameras
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
53 returns a list of available cameras
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
54 pygame.camera.list_cameras(): return [cameras]
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
55
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
56 Checks the computer for available cameras and returns a list of strings of
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
57 camera names, ready to be fed into pygame.camera.Camera.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
58 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
59
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
60 Camera
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
61 load a camera
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
62 pygame.camera.Camera(device, (width, height), format): return Camera
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
63
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
64 Loads a v4l2 camera. The device is typically something like "/dev/video0".
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
65 Default width and height are 640 by 480. Format is the desired colorspace of
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
66 the output. This is useful for computer vision purposes. The default
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
67 is RGB. The following are supported:
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
68
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
69 * RGB - Red, Green, Blue
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
70 * YUV - Luma, Blue Chrominance, Red Chrominance
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
71 * HSV - Hue, Saturation, Value
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
72 <SECTION>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
73
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
74
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
75 start
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
76 opens, initializes, and starts capturing
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
77 Camera.start(): return None
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
78
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
79 Opens the camera device, attempts to initialize it, and begins recording
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
80 images to a buffer. The camera must be started before any of the below
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
81 functions can be used.
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
82 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
83
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
84
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
85 stop
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
86 stops, uninitializes, and closes the camera
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
87 Camera.stop(): return None
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
88
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
89 Stops recording, uninitializes the camera, and closes it. Once a camera
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
90 is stopped, the below functions cannot be used until it is started again.
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
91 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
92
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
93
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
94 get_controls
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
95 gets current values of user controls
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
96 Camera.get_controls(): return (hflip = bool, vflip = bool, brightness)
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
97
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
98 If the camera supports it, get_controls will return the current settings for
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
99 horizontal and vertical image flip as bools and brightness as an int. If
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
100 unsupported, it will return the default values of (0, 0, 0).
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
101 Note that the return values here may be different than those returned by
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
102 set_controls, though these are more likely to be correct.
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
103 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
104
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
105 set_controls
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
106 changes camera settings if supported by the camera
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
107 Camera.set_controls(hflip = bool, vflip = bool, brightness): return (hflip = bool, vflip = bool, brightness)
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
108
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
109 Allows you to change camera settings if the camera supports it. The return
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
110 values will be the input values if the camera claims it succeeded or the values
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
111 previously in use if not. Each argument is optional, and the desired one
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
112 can be chosen by supplying the keyword, like hflip. Note that the actual
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
113 settings being used by the camera may not be the same as those returned by
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
114 set_controls.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
115 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
116
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
117
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
118 get_size
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
119 returns the dimensions of the images being recorded
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
120 Camera.get_size(): return (width, height)
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
121
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
122 Returns the current dimensions of the images being captured by the camera.
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
123 This will return the actual size, which may be different than the one
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
124 specified during initialization if the camera did not support that size.
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
125 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
126
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
127 query_image
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
128 checks if a frame is ready
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
129 Camera.query_image(): return bool
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
130
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
131 If an image is ready to get, it returns true. Otherwise it returns false. Note
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
132 that some webcams will always return False and will only queue a frame when
1821
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
133 called with a blocking function like get_image(). This is useful to
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
134 separate the framerate of the game from that of the camera without having to
cfc16dce35e1 cleaning camera module documentation and makeref on transform
Nirav Patel <nrp@eclecti.cc>
parents: 1782
diff changeset
135 use threading.
1323
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
136 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
137
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
138
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
139 get_image
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
140 captures an image as a Surface
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
141 Camera.get_image(Surface = None): return Surface
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
142
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
143 Pulls an image off of the buffer as an RGB Surface. It can optionally reuse an
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
144 existing Surface to save time. The bit depth of the surface is either 24bits or
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
145 the same as the optionally supplied Surface.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
146 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
147
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
148
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
149 get_raw
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
150 returns an unmodified image as a string
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
151 Camera.get_raw(): return string
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
152
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
153 Gets an image from a camera as a string in the native pixelformat of the camera.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
154 Useful for integration with other libraries.
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
155 <END>
1ca45b50f8ea camera module with v4l2 support and colorspace conversion
Nirav Patel <nrp@eclecti.cc>
parents:
diff changeset
156 <END>