Okay, so the Bresenham's algorithm is attractive because it uses integer math (it makes the simplifying assumption that pixels are located at integer x,y coordinates).
An algorithm to solve the number of pixels for some row at an integer y would do something like this:
count = 1
y_query = your query row
x_intercept = intercept of your line at y_query.
round x_intercept to the nearest integer.
(x_intercept, y_query) now define a pixel in the row
The idea is to go left and right from this coordinate and see if you are still in the y_query row:
//going left
x_new = x_intercept - 1
y_new = the y intercept for the line given x_new
round y_new to the nearest integer
if (y_new == y_query), add 1 to our count of pixels in this row, else break;
Do the same for x_new = x_intercept + 1