Use grayscale mask to define the alpha transparency on the pixel level

Is it possible to display textures with the use of grayscale (R=G=B) masks to define the alpha transparency on the pixel level with the use of shades of gray?

In pseudocode something like this:

SDL_Render( r, t, m );

Where r is renderer, t is the image and m is the grayscale mask?

Thanks a lot STeN