Skip to content

Commit 4aa75e0

Browse files
committed
Add more comments
1 parent 5c0fcd8 commit 4aa75e0

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

QRCoder/QRCodeGenerator.AlignmentPattern.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@ namespace QRCoder
44
{
55
public partial class QRCodeGenerator
66
{
7+
/// <summary>
8+
/// Represents the alignment pattern used in QR codes, which helps ensure the code remains readable even if it is somewhat distorted.
9+
/// Each QR code version has its own specific alignment pattern locations which this struct encapsulates.
10+
/// </summary>
711
private struct AlignmentPattern
812
{
13+
/// <summary>
14+
/// The version of the QR code. Higher versions have more complex and numerous alignment patterns.
15+
/// </summary>
916
public int Version;
17+
18+
/// <summary>
19+
/// A list of points where alignment patterns are located within the QR code matrix.
20+
/// Each point represents the center of an alignment pattern.
21+
/// </summary>
1022
public List<Point> PatternPositions;
1123
}
1224
}

QRCoder/QRCodeGenerator.CodewordBlock.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,31 @@
22
{
33
public partial class QRCodeGenerator
44
{
5+
/// <summary>
6+
/// Represents a block of codewords in a QR code. QR codes are divided into several blocks for error correction purposes.
7+
/// Each block contains a series of data codewords followed by error correction codewords.
8+
/// </summary>
59
private struct CodewordBlock
610
{
11+
/// <summary>
12+
/// Initializes a new instance of the CodewordBlock struct with specified arrays of code words and error correction (ECC) words.
13+
/// </summary>
14+
/// <param name="codeWords">The array of data codewords for this block. Data codewords carry the actual information.</param>
15+
/// <param name="eccWords">The array of error correction codewords for this block. These codewords help recover the data if the QR code is damaged.</param>
716
public CodewordBlock(byte[] codeWords, byte[] eccWords)
817
{
918
this.CodeWords = codeWords;
1019
this.ECCWords = eccWords;
1120
}
1221

22+
/// <summary>
23+
/// Gets the data codewords associated with this block.
24+
/// </summary>
1325
public byte[] CodeWords { get; }
26+
27+
/// <summary>
28+
/// Gets the error correction codewords associated with this block.
29+
/// </summary>
1430
public byte[] ECCWords { get; }
1531
}
1632
}

0 commit comments

Comments
 (0)