Matrix-based integral transformations for Stokes imaging with partially polarized and partially coherent light