// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.
namespace Intel.RealSense
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
///
/// Video stream profile instance which contains additional video attributes
///
public class VideoStreamProfile : StreamProfile
{
internal override void Initialize()
{
base.Initialize();
object error;
NativeMethods.rs2_get_video_stream_resolution(Handle, out width, out height, out error);
}
internal VideoStreamProfile(IntPtr ptr)
: base(ptr)
{
this.Initialize();
}
///
/// Returns this profile's
///
/// resulting intrinsics for the video profile
public Intrinsics GetIntrinsics()
{
object error;
Intrinsics intrinsics;
NativeMethods.rs2_get_video_stream_intrinsics(Handle, out intrinsics, out error);
return intrinsics;
}
///
/// Clone current profile and change the type, index and format to input parameters
///
/// will change the stream type from the cloned profile.
/// will change the stream index from the cloned profile.
/// will change the stream format from the cloned profile.
/// will change the width of the profile.
/// will change the height of the profile.
/// will change the intrinsics of the profile.
/// the cloned stream profile.
public StreamProfile Clone(Stream type, int index, Format format, int width, int height, Intrinsics intr)
{
object error;
var ptr = NativeMethods.rs2_clone_video_stream_profile(Handle, type, index, format, width, height, intr, out error);
var p = StreamProfile.Create(ptr);
p.clone = new Base.DeleterHandle(ptr, StreamProfileReleaser);
return p;
}
///
/// Gets the width in pixels of the video stream
///
public int Width
{
get { return width; }
}
///
/// Gets the height in pixels of the video stream
///
public int Height
{
get { return height; }
}
private int width;
private int height;
}
}