private static Color CodeBitDataToPixelColor(Color pixelColor, BitmapCodeDataConfig config, int savedBitsInByte, int readedData, ref PixelRGBValue selectedPixel, ref int savedBits, ref bool shouldIncreaseRowAndColumn) { pixelColor = SetColorValue(pixelColor, config, selectedPixel, savedBitsInByte, readedData, ref savedBits); if (config.GetBitsCount(selectedPixel) == savedBits) { selectedPixel = IncreasePixelRGBValue(selectedPixel, ref shouldIncreaseRowAndColumn); savedBits = 0; } return(pixelColor); }
private byte EncodeBitDataFromPixelColor(Color pixelColor, BitmapCodeDataConfig config, byte result, ref PixelRGBValue selectedPixel, ref int readedBitsInPixelSegment, ref bool shouldIncreaseRowAndColumn) { result = AddBitToResultFromColor(pixelColor, config, selectedPixel, result, ref readedBitsInPixelSegment); if (config.GetBitsCount(selectedPixel) == readedBitsInPixelSegment) { selectedPixel = IncreasePixelRGBValue(selectedPixel, ref shouldIncreaseRowAndColumn); readedBitsInPixelSegment = 0; } return(result); }