Question: Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2) and (x3,y3). What sort of algorithm can I use to return a comprehensive list of ALL (x,y) integer pairs that lie inside the triangle.

Answer: 
The following algorithm should be appropriate:

1. Sort the triangle vertices by x coordinate in increasing order. Now we have two segments (1-2 and 2-3) on the one side (top or bottom), and one segment from the other one (1-3).
2. Compute coefficients of equations of lines (which contain the segments):

```
A * x + B * y + C = 0
A = y2 - y1
B = x1 - x2
C = x2 * y1 - x1 * y2

```

There (x1, y1) and (x2, y2) are two points of the line.
3. For each of ranges [x1, x2), (x2, x3], and x2 (special case) iterate over integer points in ranges and do the following for every x:

	1. Find top bound as y\_top = (- A1 \* x - C1) div B1.
	2. Find bottom bound as y\_bottom = (- A2 \* y - C2 - 1) div B2 + 1.
	3. Add all points between (x, y\_bottom) and (x, y\_top) to the result.

This algorithm is for not strictly internal vertices. For strictly internal vertices items 3.1 and 3.2 slightly differ.
I suppose you have a list of pairs you want to test (if this is not what your problem is about, please specify your question clearly). You should store the pairs into quad-tree or kd-tree structure first, in order to have a set of candidates which is small enough. If you have few points, this is probably not worth the hassle (but it won't scale well if you don't do it).

You can also narrow down candidates further by testing against a bounding box for your triangle.

Then, for each candidate pair `(x, y)`, solve in `a, b, c` the system

```
a + b + c = 1
a x1 + b x2 + c x3 = x
a y2 + b y2 + c y3 = y

```

(I let you work this out), and the point is inside the triangle if `a` `b` and `c` are all positive.