camera.py 文件源码

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

项目:ivport-v2 作者: ivmech 项目源码 文件源码
def _set_annotate_foreground(self, value):
        self._check_camera_open()
        if not isinstance(value, Color):
            raise PiCameraValueError(
                'annotate_foreground must be a Color')
        elif not self._annotate_v3:
            if value.rgb_bytes != (255, 255, 255):
                warnings.warn(
                    PiCameraFallback(
                        "Firmware does not support setting a custom foreground "
                        "annotation color; using white instead"))
            return
        mp = self._get_annotate_settings()
        mp.custom_text_color = True
        (
            mp.custom_text_Y,
            mp.custom_text_U,
            mp.custom_text_V,
            ) = value.yuv_bytes
        mmal_check(
            mmal.mmal_port_parameter_set(self._camera[0].control, mp.hdr),
            prefix="Failed to set annotation foreground")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号