After you file

Sorry, your understanding is incorrect.  The income stacks, and the total income (including capital gains) determines the capital gains rate.

 

For example, suppose your income not including capital gains is $80,000.  The first $9,250 of capital gains is taxed at zero %, but the rest (which brings your income over $89,250) is taxed at 15%.