This is asking for QGIS, but just in case anyone wants to know for ArcGIS: You can also use the Euclidean distance tool. more information available here: http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/understanding-euclidean-distance-analysis.htm
The euclidean distance tool is also possible with a line feature. If you are only interested in the distance towards your line feature you can skip the optional Euclidean direction output raster.
Do not forget to set the output cell size. When the input source data is a feature class, the source locations are converted internally to a raster before performing the analysis. The resolution of the raster can be controlled with the Output cell size parameter or the Cell Size environment. By default, the resolution will be determined by the shorter of the width or height of the extent of input feature, in the input spatial reference, divided by 250.
Hereafter you can use a clipping tool or mask.