Get color tuple of pixel (x, y). Last item is the alpha if Pixmap.alpha is true.
(self, x, y)
| 13789 | return bytes_out.getvalue() |
| 13790 | |
| 13791 | def pixel(self, x, y): |
| 13792 | """Get color tuple of pixel (x, y). |
| 13793 | Last item is the alpha if Pixmap.alpha is true.""" |
| 13794 | if g_use_extra: |
| 13795 | return extra.pixmap_pixel(self.this.m_internal, x, y) |
| 13796 | if (0 |
| 13797 | or x < 0 |
| 13798 | or x >= self.this.m_internal.w |
| 13799 | or y < 0 |
| 13800 | or y >= self.this.m_internal.h |
| 13801 | ): |
| 13802 | RAISEPY(MSG_PIXEL_OUTSIDE, PyExc_ValueError) |
| 13803 | n = self.this.m_internal.n |
| 13804 | stride = self.this.m_internal.stride |
| 13805 | i = stride * y + n * x |
| 13806 | ret = tuple( self.samples_mv[ i: i+n]) |
| 13807 | return ret |
| 13808 | |
| 13809 | @property |
| 13810 | def samples(self)->bytes: |