unsafe public static void ConvertBgrxToGreyByte(byte *ipstart, byte *opstart, int cb) { byte *ip = ipstart + 4, ipe = ipstart + cb, op = opstart + 1; while (ip <= ipe) { byte y = Rec601.LumaFromBgr(ip[-4], ip[-3], ip[-2]); op[-1] = y; ip += 4; op++; } }
unsafe public static void ConvertBgrxToGreyByte(byte *ipstart, byte *opstart, int cb) { byte *ip = ipstart, ipe = ipstart + cb - 4, op = opstart; while (ip <= ipe) { byte y = Rec601.LumaFromBgr(ip[0], ip[1], ip[2]); op[0] = y; ip += 4; op++; } }