Add transform helper functions.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>