Arducam 64MP Hawkeye Zoom pre-set for images

Purchased the:
Arducam 64MP Hawkeye

Using it to automate a microscope setup and need to preset the zoom level before I click an image. I know the camera has 10x digital zoom. I referred to this link that allows me to control the zoom factor
RPi 4

This is the zoom control code:

# Or play around with digital zoom:
libcamera-still -t 0 --viewfinder-width 2312 --viewfinder-height 1736 -k
# While preview is showing, go back to terminal and press:
# W: Zoom in
# S: Zoom out
# I: Move upward
# K: Move downward
# J: Move left
# L: Move right
# R: Reset
# M: 10x Zoom
# You have to press the character, then press 'Enter' for it to register.

My challenge is that I want to pre-set the zooming factor to 5x zoom and then click an image. I am not able to find any resources to do this.

you would need to directly use libcamera c++ or python API instead of command line tool. simple example is here GitHub - henrihallik/libcamera-cpp-demo-dual-cam: libcamera c++ demo
and then user control named ScaleCrop to implement digital zoom.

            std::optional<Rectangle> sensor_area = props.get(libcamera::properties::ScalerCropMaximum);
            qDebug() <<"sensor "<<sensor_area->width<<" "<<sensor_area->height;
            int x = 0.25 * sensor_area->width;
            int y = 0.25 * sensor_area->height;
            int w = 0.5 * sensor_area->width;
            int h = 0.5 * sensor_area->height;

            Rectangle crop(x, y, w, h);
            controls_.set(libcamera::controls::ScalerCrop, crop);

you could also modify the libcamera-still source code that u can get from arducam github, add the default zoom there and then rebuilt the source.