请问大神们这个指针是什么意思啊? 怎么解析啊?指针的内容也不是很懂
static private unsafe PROCESS MakeLine(ref SortedDictionary dicLabelInfo, ref int[,] arriLabel, Bitmap bmpSrc, Bitmap bmpRoi)//MGWork
{
BitmapData bmpdSrc = null, bmpdRoi = null;
byte* pbtSrc = null, pbtRoi = null;
int iLabelVal = 0;
int iLineNum = 0, iGroundNum = 0;
int iRow, iCol, iWidth, iHeight;
PROCESS enRes = PROCESS.FAILED;
int iChannelCnt = 0;
try
{
if (bmpSrc == null || bmpSrc.PixelFormat != PixelFormat.Format8bppIndexed)
throw new Exception("Invalid parameter.");
if (arriLabel == null)
arriLabel = new int[bmpSrc.Height, bmpSrc.Width];
if (dicLabelInfo != null)
dicLabelInfo.Clear();
dicLabelInfo = new SortedDictionary<int, FanoutDefect>();
iHeight = arriLabel.GetLength(0);
iWidth = arriLabel.GetLength(1);
iChannelCnt = _commonImgLib.GetChannelCount(bmpRoi.PixelFormat);
if (iChannelCnt == -1)
throw new Exception("Cannot get count of channels.");
bmpdSrc = bmpSrc.LockBits(new Rectangle(0, 0, bmpSrc.Width, bmpSrc.Height), ImageLockMode.ReadOnly, bmpSrc.PixelFormat);
bmpdRoi = bmpRoi.LockBits(new Rectangle(0, 0, bmpRoi.Width, bmpRoi.Height), ImageLockMode.ReadOnly, bmpRoi.PixelFormat);
pbtSrc = (byte*)bmpdSrc.Scan0.ToPointer();
pbtRoi = (byte*)bmpdRoi.Scan0.ToPointer();
for (iRow = 0; iRow < iHeight; iRow++)
{
for (iCol = 0; iCol < iWidth; iCol++)
{
if (*(pbtRoi + iRow * bmpdRoi.Stride + iCol * iChannelCnt) != 0)
{
iLabelVal = arriLabel[iRow, iCol];
if (iLabelVal == 0)
{
enRes = FOLabeller.LabelOne(ref dicLabelInfo, ref iLineNum, ref iGroundNum, ref arriLabel, pbtSrc, bmpdSrc, iRow, iCol);
if (enRes != PROCESS.SUCCESS)
throw new Exception("Labelling is failed.");
}
}
}
}
return PROCESS.SUCCESS;
}
finally
{
if (bmpdSrc != null) bmpSrc.UnlockBits(bmpdSrc);
}
}