Click or drag to resize
XDL

XDMBandRotate Class

XDMBandRotate 클래스는 영상을 입력 각도만큼 반시계방향으로 회전한다.
Inheritance Hierarchy

Namespace:  Pixoneer.NXDL.NRS
Assembly:  NXDLrs (in NXDLrs.dll) Version: 1.2.817.72
Syntax
C#
public class XDMBandRotate : XDMBand

The XDMBandRotate type exposes the following members.

Constructors
  NameDescription
Public methodXDMBandRotate
XDMBandRotate 클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
  NameDescription
Public methodGetInputParam
영상 회전처리를 위한 입력 파라미터를 얻는다.
Public methodSetInputParam
영상 회전처리를 위한 입력 파라미터를 설정한다.
Top
Remarks

영상에 따라서 Orientation값이 주어지는 경우가 있다. 이를 보정하여 지리적인 위치를 맞추기 위해 영상회전을 할 필요가 있다.

Examples
입력 영상을 반시계방향으로 45도만큼 회전한다. 회전하여 생기는 빈 공간을 -9999로 채우며, 중심좌표를 설정하지 않았기 때문에 영상 중심좌표는 Width/2, Height/2가 된다.
using Pixoneer.NXDL;
using Pixoneer.NXDL.NRS;
using Pixoneer.NXDL.NIO;

// IO initialize to load image file
XRasterIO RasterIO = new XRasterIO();
String strError = "";
if (RasterIO.Initialize(out strError) == false)
{
    return;
}

// Image load
String strFilePathLoad = "D:\\Sample\\IKONOS.xdm";
XRSLoadFile xrsFileInput = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg);

// Set input param
XBandParamRotate InputParam = new XBandParamRotate();
InputParam.SrcBand = xrsFileInput.GetBandAt(0);
InputParam.RotateAngle = XAngle.FromDegree(45);
InputParam.BlankValue = -9999;


// Create New process band and set input param
XDMBandRotate bandProcess = new XDMBandRotate();
if (!bandProcess.SetInputParam(ref InputParam))
{
    return;
}

// create XRSSaveFile to save realtime band(XDMBandXXXX)
// load another file to protect thread lock(it is stable and faster).
XRSLoadFile fileLoad = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg);
XRSSaveFile fileSave = new XRSSaveFile();
for (int i = 0; i < fileLoad.NumBand; i++)
{
    XDMBand bandRaw = fileLoad.GetBandAt(i);
    XBandParamRotate param = new XBandParamRotate(ref InputParam);
    param.SrcBand = bandRaw;

    XDMBandRotate bandTmp = new XDMBandRotate();
    bandTmp.BandName = bandRaw.BandName;
    bandTmp.SetInputParam(ref param);

    XDMBand bandCast = (XDMBand)bandTmp;

    fileSave.AddBand(ref bandCast);
}

// Save output file
XThread thd = null;
String strFilePathSave = "D:\\Sample\\Out_Rotate.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd))
{
    return;
}
See Also