def get_format_list(self): count = ueye.UINT() check(ueye.is_ImageFormat(self.h_cam, ueye.IMGFRMT_CMD_GET_NUM_ENTRIES, count, ueye.sizeof(count))) format_list = ueye.IMAGE_FORMAT_LIST(ueye.IMAGE_FORMAT_INFO * count.value) format_list.nSizeOfListEntry = ueye.sizeof(ueye.IMAGE_FORMAT_INFO) format_list.nNumListElements = count.value check(ueye.is_ImageFormat(self.h_cam, ueye.IMGFRMT_CMD_GET_LIST, format_list, ueye.sizeof(format_list))) return format_list
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)
def set_colormode(self, colormode): check(ueye.is_SetColorMode(self.h_cam, colormode))