add stitching to cpp samples