A touchscreen has no relation to the display it is attached to, and has no concept of pixels. Its driver receives analog signals from the matrix and produces X and Y coordinates which are float values between 0 and 1, and sometimes (depending on the device type and the driver) a byte encoding the pressure. If you know the underlying screen resolution, you can convert X and Y coordinates to pixels.
You can read "raw" touchscreen data using libinput
. You will get a new input event every time the coordinates (and the pressure) change.