If I have an output device, for which I have a known spectrum data for each of it's primaries, I should be able to calculate the CIEXYZ of its primaries using using the integral equations together with the CIE color matching functions. I can then calculate its respective CIExyY values, which for output device are always inside the boundary if the xyY spectral locus - the chromaticity diagram.
My question relates to calculating xyY of primaries of input device.
Suppose I have a known spectrum data for the primaries of some input device - be it a digital scanner or a digital camera or any other input device. It's color filters are not perfect, this means that even a pure spectrum color is represented as non-zero values in its own RGB color space. That means that (if I'm correct) that the whole chromaticity diagram should lie inside of the device RGB color space, and it's primaries lie outside of the diagram and be represented by imaginary colors.
How do I calculate those imaginary primaries for the input device given known spectrum for its primaries? If I'm not mistaken, I cannot simply use the integral formula, because that seems to be only for output devices and the resulting primaries would lie in the locus.