Пример #1
0
    def alloc_single(self):
        rect = self.get_aoi()
        bpp = get_bits_per_pixel(self.get_colormode())

        buff = ImageBuffer()
        ueye.is_AllocImageMem(self.h_cam, rect.width, rect.height, bpp,
                              buff.mem_ptr, buff.mem_id)
        check(ueye.is_SetImageMem(self.h_cam, buff.mem_ptr, buff.mem_id))
        return buff
Пример #2
0
    def alloc(self, buffer_count=3):
        rect = self.get_aoi()
        bpp = get_bits_per_pixel(self.get_colormode())

        for buff in self.img_buffers:
            check(ueye.is_FreeImageMem(self.h_cam, buff.mem_ptr, buff.mem_id))

        for i in range(buffer_count):
            buff = ImageBuffer()
            ueye.is_AllocImageMem(self.h_cam, rect.width, rect.height, bpp,
                                  buff.mem_ptr, buff.mem_id)

            check(ueye.is_AddToSequence(self.h_cam, buff.mem_ptr, buff.mem_id))

            self.img_buffers.append(buff)

        ueye.is_InitImageQueue(self.h_cam, 0)