Click or drag to resize
XDL

XDMBandConvDataType Class

XDMBandConvDataType 클래스는 영상의 데이터 형식(Radiometric resolution)을 변환한다.
Inheritance Hierarchy
SystemObject
  Pixoneer.NXDL.NRSXDMBand
    Pixoneer.NXDL.NRSXDMBandConvDataType

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

The XDMBandConvDataType type exposes the following members.

Constructors
 NameDescription
Public methodXDMBandConvDataType XDMBandConvDataType클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
 NameDescription
Public methodGetInputParam 데이터형식을 변환하기 위해 설정한 파라미터를 얻는다.
Public methodSetInputParam 데이터형식을 변환하기 위한 입력 파라미터를 설정.
Top
Example
아래의 예제는 unsigne short(2 bytes) 데이터를 unsigned char(1 byte)로 변환하는 것으로, eConvDataType.Clip 방법을 사용하여 0~255 사이 값만을 저장한다(0보다 작은 경우는 0으로, 255보다 큰 경우는 255로 대응하여 처리한다).
C#
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
XBandParamConvDataType InputParam = new XBandParamConvDataType();
InputParam.SrcBand = xrsFileInput.GetBandAt(0);
InputParam.ConvMethod = eConvDataType.Clip;
InputParam.DataRangeMin = 0.0;
InputParam.DataRangeMax = 255.0;
InputParam.DataType = eDataType.UINT08;

// Create New process band and set input param
XDMBandConvDataType bandProcess = new XDMBandConvDataType();
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);
    XBandParamConvDataType param = new XBandParamConvDataType(ref InputParam);
    param.SrcBand = bandRaw;

    XDMBandConvDataType bandTmp = new XDMBandConvDataType();
    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_ConvDataType.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd))
{
    return;
}
See Also