Beispiel #1
0
int color_m_rotate_cmd(lua_State *L)
{
	GRLUA_DEBUG_CALL;

	TextureColorMap *c = get_texture_map(L);
	double angle = luaL_checknumber(L,2);

	c->rotate(angle);
	return 0;
}
Beispiel #2
0
int color_m_bump_cmd(lua_State *L)
{
	GRLUA_DEBUG_CALL;

	double mag;
	TextureColorMap *c = get_texture_map(L);
	mag = luaL_checknumber(L,2);

	c->set_bump_magnitude(mag);
	return 0;
}
Beispiel #3
0
int color_m_scale_cmd(lua_State *L)
{
	GRLUA_DEBUG_CALL;

	double x, y;
	TextureColorMap *c = get_texture_map(L);
	x = luaL_checknumber(L,2);
	y = luaL_checknumber(L,3);

	c->scale(x,y);
	return 0;
}
    rs2::frame pointcloud::process_depth_frame(const rs2::frame_source& source, const rs2::depth_frame& depth)
    {
        auto res = allocate_points(source, depth);
        auto pframe = (librealsense::points*)(res.get());

        auto depth_data = (const uint16_t*)depth.get_data();
        float2* tex_ptr = pframe->get_texture_coordinates();

        const float3* points;

        points = depth_to_points(res, (uint8_t*)pframe->get_vertices(), *_depth_intrinsics, depth_data, *_depth_units);

        auto vid_frame = depth.as<rs2::video_frame>();

        // Pixels calculated in the mapped texture. Used in post-processing filters
        float2* pixels_ptr = _pixels_map.data();
        rs2_intrinsics mapped_intr;
        rs2_extrinsics extr;
        bool map_texture = false;
        {
            if (_extrinsics && _other_intrinsics)
            {
                mapped_intr = *_other_intrinsics;
                extr = *_extrinsics;
                map_texture = true;
            }
        }

        if (map_texture)
        {
            auto height = vid_frame.get_height();
            auto width = vid_frame.get_width();

            get_texture_map(res, points, width, height, mapped_intr, extr, tex_ptr, pixels_ptr);

            if (_occlusion_filter->active())
            {
                _occlusion_filter->process(pframe->get_vertices(), pframe->get_texture_coordinates(), _pixels_map);
            }
        }
        return res;
    }