public byte PackFields() { PackedField field = default; field.SetBit(0, this.GlobalColorTableFlag); // 0 : Global Color Table Flag | 1 bit field.SetBits(1, 3, this.GlobalColorTableSize); // 1-3 : Color Resolution | 3 bits field.SetBit(4, false); // 4 : Sort Flag | 1 bits field.SetBits(5, 3, this.GlobalColorTableSize); // 5-7 : Size of Global Color Table | 3 bits return(field.Byte); }
public byte PackField() { PackedField field = default; field.SetBits(3, 3, (int)this.DisposalMethod); // 1-3 : Reserved, 4-6 : Disposal // TODO: Allow this as an option. field.SetBit(6, false); // 7 : User input - 0 = none field.SetBit(7, this.TransparencyFlag); // 8: Has transparent. return(field.Byte); }