def get_rendering_engine(conn, pixels_id, size_c, c_range):
    """ Initializes the rendering engine for the specified pixels set. """
    rendering_engine = conn.createRenderingEngine()
    rendering_engine.lookupPixels(pixels_id)
    if rendering_engine.lookupRenderingDef(pixels_id) == 0:
        rendering_engine.resetDefaults()
    rendering_engine.lookupRenderingDef(pixels_id)
    rendering_engine.load()
    if len(c_range) == 0:
        for channel in range(size_c):
            rendering_engine.setActive(channel, 1)
    else:
        for channel in range(size_c):
            rendering_engine.setActive(channel, 0)
        for channel in c_range:
            rendering_engine.setActive(channel, 1)
    return rendering_engine
