154 def process(self, input_image: Image) -> Image:
157 Converts a packed pixel format image into an unpacked Bayer or monochrome format.
159 This function unpacks the input image from a packed format to its corresponding
160 unpacked Bayer or monochrome format.
162 @note This operation disregards any specified image regions
163 and processes the entire image.
165 @param input_image: The packed input image to unpack.
166 @return The unpacked output image with the downsampled bit depth.
168 @since ids_peak_icv 1.0
170 input_bit_depth = input_image.pixel_format.storage_bits_per_channel
174 if input_image.pixel_format == output_pixel_format:
179 execute_and_map_return_codes(
180 lib_loader.dll().peak_icv_Preprocessing_ImageConverter_Convert, self.
_handle, input_image._handle,
181 ctypes.c_int(output_pixel_format.value),
182 ctypes.pointer(output_image_handle))
184 return Image(_handle=output_image_handle)
299 PixelFormat.RGB_10_PACKED_32:
lambda _: PixelFormat.RGB_10,
300 PixelFormat.BGR_10_PACKED_32:
lambda _: PixelFormat.BGR_10,
303 PixelFormat.YUV420_8_YY_UV_SEMIPLANAR_IDS:
lambda _: PixelFormat.RGB_8,
304 PixelFormat.YUV420_8_YY_VU_SEMIPLANAR_IDS:
lambda _: PixelFormat.RGB_8,
305 PixelFormat.YUV422_8_UYVY:
lambda _: PixelFormat.RGB_8,
309 func = mapping.get(input_pixel_format)
311 return input_pixel_format
312 return func(output_bit_depth)