Hi,
Regarding stitching panoramas, one of the best was written by two graduate students at the University of British Columbia: They called it "Autostitch" because it really is Point a block of photographs to it and it will sort them out, combine and create the panorama both horizontal and vertical.
https://en.wikipedia.org/wiki/AutoStitch
You can download a free demo copy for either/both OSX and MS Windows. They do not sell the program as the University is not a business, but you could license the code to include in Affinity Photo from the university.
http://matthewalunbrown.com/autostitch/autostitch.html#licensing
Why not take a look at it. You can download the free demo version here:
http://matthewalunbrown.com/autostitch/autostitch.html
Sparks