149 def process(self, input_image: Image) -> Image:
152 Converts a packed pixel format image into an unpacked Bayer or monochrome format.
154 This function unpacks the input image from a packed format to its corresponding
155 unpacked Bayer or monochrome format, preserving the input bit depth.
157 This operation disregards any specified image regions and processes the entire image.
159 @param input_image: input The packed input image to unpack.
160 @return The unpacked output image with the downsampled bit depth.
162 @since ids_peak_icv 1.0
164 input_bit_depth = input_image.pixel_format.storage_bits_per_channel
168 if input_image.pixel_format == output_pixel_format:
173 execute_and_map_return_codes(
174 lib_loader.dll().peak_icv_Preprocessing_ImageConverter_Convert, self.
_handle, input_image._handle,
175 ctypes.c_int(output_pixel_format.value),
176 ctypes.pointer(output_image_handle))
178 return Image(_handle=output_image_handle)
301 PixelFormat.YUV420_8_YY_UV_SEMIPLANAR_IDS:
lambda _: PixelFormat.RGB_8,
302 PixelFormat.YUV420_8_YY_VU_SEMIPLANAR_IDS:
lambda _: PixelFormat.RGB_8,
303 PixelFormat.YUV422_8_UYVY:
lambda _: PixelFormat.RGB_8,
307 func = mapping.get(input_pixel_format)
309 return input_pixel_format
310 return func(output_bit_depth)