/* IMX390 cropping example */ uint32_t resolution_width = 1936u; /*Maximum resolution width IMX390 */ uint32_t resolution_height = 1220u; /*Maximum resolution height IMX390 */ math::Rectui cropRoi = {0, 256, 1936, 964}; /* x,y,width,height of the cropping rectangle */ downscaleCropCfg.ispInputCropEnable = true; downscaleCropCfg.isp0OutputCropEnable = true; downscaleCropCfg.isp1OutputCropEnable = false; downscaleCropCfg.ispInputCrop.x0 = 0u; // horizontal crop not expected here downscaleCropCfg.ispInputCrop.y0 = static_cast(cropRoi.y); downscaleCropCfg.ispInputCrop.x1 = static_cast(resolution_width); // horizontal crop not expected here downscaleCropCfg.ispInputCrop.y1 = static_cast(cropRoi.y + cropRoi.height); // shall be 1220 downscaleCropCfg.isp0OutputCrop.x0 = static_cast(cropRoi.x); downscaleCropCfg.isp0OutputCrop.y0 = static_cast(cropRoi.y - downscaleCropCfg.ispInputCrop.y0); // shall be 0, no cropping here downscaleCropCfg.isp0OutputCrop.x1 = static_cast(cropRoi.x + cropRoi.width); downscaleCropCfg.isp0OutputCrop.y1 = static_cast(cropRoi.y + cropRoi.height - downscaleCropCfg.ispInputCrop.y0); // shall be 964, no cropping here