pixelaccess.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:py-sdl2 作者: marcusva 项目源码 文件源码
def _getitem(self, start, end):
        if self.itemsize == 1:
            # byte-wise access
            return self.source[start:end]
        # move the pointer to the correct location
        src = ctypes.byref(self.source.contents, start)
        casttype = ctypes.c_ubyte
        if self.itemsize == 2:
            casttype = ctypes.c_ushort
        elif self.itemsize == 3:
            # TODO
            raise NotImplementedError("unsupported bpp")
        elif self.itemsize == 4:
            casttype = ctypes.c_uint
        return ctypes.cast(src, ctypes.POINTER(casttype)).contents.value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号