@@ -34,6 +34,50 @@ class image.Image
3434--------------------------------
3535The line object is returned by `camera.snapshot() `.
3636
37+ Basic Methods
38+ --------------------------------
39+
40+ .. method :: width() -> int
41+
42+ Returns the image width in pixels.
43+
44+ UIFlow2.0
45+
46+ |width.png |
47+
48+ .. method :: height() -> int
49+
50+ Returns the image height in pixels.
51+
52+ UIFlow2.0
53+
54+ |height.png |
55+
56+ .. method :: format() -> int
57+
58+ Returns the image format
59+
60+ UIFlow2.0
61+
62+ |format.png |
63+
64+ .. method :: size() -> int
65+
66+ Returns the image size in bytes.
67+
68+ UIFlow2.0
69+
70+ |size.png |
71+
72+ .. method :: bytearray() -> bytearray
73+
74+ Returns a bytearray object that points to the image data for byte-level read/write access.
75+
76+ UIFlow2.0
77+
78+ |bytearray.png |
79+
80+
3781Drawing Methods
3882--------------------------------
3983
@@ -42,9 +86,9 @@ Drawing Methods
4286 Draws a line from (x0, y0) to (x1, y1) on the image. You may either
4387 pass x0, y0, x1, y1 separately or as a tuple (x0, y0, x1, y1).
4488
45- - ``color `` is an RGB888 tuple for Grayscale or RGB565 images. Defaults to
46- white. However, you may also pass the underlying pixel value (0-255) for
47- grayscale images or a RGB565 value for RGB565 images.
89+ - ``color `` is an RGB888 tuple for Grayscale or RGB565 images. Defaults to
90+ white. However, you may also pass the underlying pixel value (0-255) for
91+ grayscale images or a RGB565 value for RGB565 images.
4892
4993 - ``thickness `` controls how thick the line is in pixels.
5094
@@ -60,8 +104,8 @@ Drawing Methods
60104 or as a tuple (x, y, w, h).
61105
62106 - ``color `` is an RGB888 tuple for Grayscale or RGB565 images. Defaults to
63- white. However, you may also pass the underlying pixel value (0-255) for
64- grayscale images or a RGB565 value for RGB565 images.
107+ white. However, you may also pass the underlying pixel value (0-255) for
108+ grayscale images or a RGB565 value for RGB565 images.
65109
66110 - ``thickness `` controls how thick the lines are in pixels.
67111
@@ -79,8 +123,8 @@ Drawing Methods
79123 as a tuple (x, y, radius).
80124
81125 - ``color `` is an RGB888 tuple for Grayscale or RGB565 images. Defaults to
82- white. However, you may also pass the underlying pixel value (0-255) for
83- grayscale images or a RGB565 value for RGB565 images.
126+ white. However, you may also pass the underlying pixel value (0-255) for
127+ grayscale images or a RGB565 value for RGB565 images.
84128
85129 - ``thickness `` controls how thick the edges are in pixels.
86130
@@ -99,19 +143,50 @@ Drawing Methods
99143 x, y separately or as a tuple (x, y).
100144
101145 - ``text `` is a string to write to the image. ``\n ``, ``\r ``, and ``\r\n ``
102- line endings move the cursor to the next line.
146+ line endings move the cursor to the next line.
103147
104148 - ``color `` is an RGB888 tuple for Grayscale or RGB565 images. Defaults to
105- white. However, you may also pass the underlying pixel value (0-255) for
106- grayscale images or a RGB565 value for RGB565 images.
149+ white. However, you may also pass the underlying pixel value (0-255) for
150+ grayscale images or a RGB565 value for RGB565 images.
107151
108152 - ``scale `` may be increased to increase/decrease the size of the text on the
109- image. You can pass greater than 0 integer or floating point values.
153+ image. You can pass greater than 0 integer or floating point values.
110154
111155 Returns the image object so you can call another method using ``. `` notation.
112156
113157
114158 UIFlow2.0
115159
116160 |draw_string.png |
161+
162+ Constants
163+ --------------------------------
164+
165+ .. data :: RGB565
166+ :type: int
167+
168+ RGB565 pixel format. Each pixel is 16-bits, 2-bytes. 5-bits are used for red,
169+ 6-bits are used for green, and 5-bits are used for blue.
170+
171+ .. data :: GRAYSCALE
172+ :type: int
173+
174+ GRAYSCALE pixel format. Each pixel is 8-bits, 1-byte.
175+
176+ .. data :: JPEG
177+ :type: int
178+
179+ A JPEG image.
180+
181+ .. data :: YUV422
182+ :type: int
117183
184+ A pixel format that is very easy to jpeg compress. Each pixel is stored as a grayscale
185+ 8-bit Y value followed by alternating 8-bit U/V color values that are shared between two
186+ Y values (8-bits Y1, 8-bits U, 8-bits Y2, 8-bits V, etc.). Only some image processing
187+ methods work with YUV422.
188+
189+ UIFlow2.0
190+
191+ |format_option.png |
192+
0 commit comments