public void Bind(object pArgument) { if (pArgument is focalBandFunctionArguments) { focalBandFunctionArguments arg = (focalBandFunctionArguments)pArgument; inrsBands = arg.InRaster; myFunctionHelper.Bind(inrsBands); bandsBefore = arg.BandsBefore; bandsAfter = arg.BandsAfter; tBands = 1 + bandsBefore + bandsAfter; myRasterInfo = myFunctionHelper.RasterInfo; myPixeltype = myRasterInfo.PixelType; myValidFlag = true; } else { throw new System.Exception("Incorrect arguments object. Expected: focalBandArguments"); } }
public IFunctionRasterDataset focalBandfunction(object inRaster, localType op, int bandsBefore, int bandsAfter) { string tempAr = funcDir + "\\" + FuncCnt + ".afr"; IFunctionRasterDataset frDset = new FunctionRasterDatasetClass(); IFunctionRasterDatasetName frDsetName = new FunctionRasterDatasetNameClass(); frDsetName.FullName = tempAr; frDset.FullName = (IName)frDsetName; IRasterFunction rsFunc = null; switch (op) { case localType.MAX: break; case localType.MIN: break; case localType.MAXBAND: break; case localType.MINBAND: break; case localType.SUM: rsFunc = new FunctionRasters.focalBandFunctionDatasetSum(); break; case localType.MULTIPLY: break; case localType.DIVIDE: break; case localType.SUBTRACT: break; case localType.POWER: break; case localType.MEAN: rsFunc = new FunctionRasters.focalBandFunctionDatasetMean(); break; case localType.VARIANCE: break; case localType.STD: rsFunc = new FunctionRasters.focalBandFunctionDatasetStd(); break; case localType.MODE: break; case localType.MEDIAN: break; case localType.UNIQUE: break; case localType.ENTROPY: break; case localType.ASM: break; default: break; } FunctionRasters.focalBandFunctionArguments args = new FunctionRasters.focalBandFunctionArguments(this); IFunctionRasterDataset inRs = createIdentityRaster(inRaster); args.InRaster = inRs; args.BandsBefore = bandsBefore; args.BandsAfter = bandsAfter; frDset.Init(rsFunc, args); return frDset; }