Make function inline to avoid duplicated names when linking statically

Based on https://github.com/ros-perception/image_pipeline/pull/113