//*****************************************************************
// .NET Standard QR-Code Font Encoder Version 2024 DEMO
// © Copyright 2024; IDAutomation.com, Inc. 
// All rights reserved. USA Patent 7,637,436
//*****************************************************************
// Limitations of the Demo Version:
// The demo version of this product includes a fully
// functional 2D font and is designed only for the
// purpose of testing the font in various applications
// and point sizes. To generate dynamic symbols,
// a font encoder is required to format the data being
// encoded into the 2D symbol.
// Only static data can be provided for the encoders
// in the demo version, because providing a working
// encoder would reveal the complete source code,
// which is only available in the licensed version.
// To order, please visit:
// https://www.idautomation.com/
//*****************************************************************
//
// Please refer to the User Manual and Included Examples
// https://www.idautomation.com/barcode-components/dotnet-standard/
//
//*****************************************************************

//CONFIGURATION
//#define ENCODER // only use barcode font

using System;
using System.Text;

namespace IDAutomation.NetStandard.QRCode.FontEncoder
{
    /// <summary>
    /// Class constructor. 
    /// </summary>
    public class QRCode
    {
        string Debug = "";

        private StringBuilder _DataToEncode = new StringBuilder("123456789012");
        private bool _ApplyTilde = false;
        private int _EncodingMode = 0;
        private int _ErrorLevel = 0;
        private bool _BestMask = false;
        private int _QuietZone = 0;
        private int _Version = 0;
        private int iFNC1 = 0;
        private int iFNC1_AI = 0;
        private int[][] Matrix;
        private int Size = 0;

        /// <summary>
        /// Function, which creates an array of bytes, representation of raster QR-Code's image, depending on the various input options chosen. 
        /// </summary>
        /// <param name="DataToEncode">The data that is encoded in the barcode.</param>
        /// <param name="ApplyTilde">Enables processing of tilde and parentheses characters for purposes of encoding ASCII functions and GS1 application identifiers.</param>
        /// <param name="EncodingMode">Various modes used to Data represented in the symbol may be encoded by one of these types.</param>
        /// <param name="Version">Represents the various sizes of the symbol.</param>
        /// <param name="ErrorCorrectionLevel">Four levels of Reed-Solomon error correction, which allow verification of data and recovery in the event that part of the symbol is physically damaged.</param>
        /// <param name="BestMask">Use a best mask for pattern in the QRCode.</param>
        /// <param name="QuietZone">Define the size of a blank zone around the code.</param>
        /// <param name="ModuleSize">Define the size of each module in pixels.</param>
        /// <returns>Encoded text for use with the 2D barcode font.</returns>
        public byte[] EncodeQR(string DataToEncode, bool ApplyTilde = true, EncodingModes EncodingMode = EncodingModes.Byte, Versions Version = Versions.AUTO, ErrorCorrectionLevels ErrorCorrectionLevel = ErrorCorrectionLevels.M, bool BestMask = true, int QuietZone = 2, int ModuleSize = 1)
        {
            Matrix = new int[21][];
            Matrix[0] = new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 };
            Matrix[1]= new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1};
            Matrix[2]= new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1};
            Matrix[3]= new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1};
            Matrix[4]= new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1};
            Matrix[5]= new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1};
            Matrix[6]= new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1};
            Matrix[7]= new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            Matrix[8]= new int[] { 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1};
            Matrix[9]= new int[] { 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1};
            Matrix[10]= new int[] { 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0};
            Matrix[11]= new int[] { 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1};
            Matrix[12]= new int[] { 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1};
            Matrix[13]= new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1};
            Matrix[14]= new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0};
            Matrix[15]= new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1};
            Matrix[16]= new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1};
            Matrix[17]= new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0};
            Matrix[18]= new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1};
            Matrix[19]= new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1};
            Matrix[20]= new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1};
            
            Size = 21;

            int k;
            int intPad = 0;
            int pixels = 0;
            int bit = 0;
            int bWidth = 0;

            bWidth = ((int)((Size * ModuleSize) / 8) + ((Size * ModuleSize) % 8 > 0 ? 1 : 0));
            int intTemp = bWidth % 4;
            if (intTemp != 0)
            {
                intPad = 4 - intTemp;
            }

            byte[] Result = new byte[64 + Size * ModuleSize * (bWidth + intPad)];

            Result[0] = 0x42;
            Result[1] = 0x4d;
            for (k = 0; k < 8; k++)
            {
                Result[2 + k] = 0;
            }
            Result[10] = 0x3E;
            for (k = 0; k < 3; k++)
            {
                Result[11 + k] = 0;
            }
            Result[14] = 0x28;
            for (k = 0; k < 3; k++)
            {
                Result[15 + k] = 0;
            }

            // width
            Result[18] = (byte)((Size * ModuleSize) % 256);
            Result[19] = (byte)(Math.Floor((double)(Size * ModuleSize) / 256));
            Result[20] = 0;
            Result[21] = 0;

            // height
            Result[22] = Result[18];
            Result[23] = Result[19];
            Result[24] = 0; ;
            Result[25] = 0;

            Result[26] = 1;
            Result[27] = 0;
            Result[28] = 1;
            Result[29] = 0;
            for (k = 0; k < 8; k++)
            {
                Result[30 + k] = 0;
            }
            Result[38] = 0x25;
            Result[39] = 0x0e;
            Result[40] = 0;
            Result[41] = 0;

            Result[42] = 0x25;
            Result[43] = 0x0e;
            Result[44] = 0;
            Result[45] = 0;

            for (k = 0; k < 8; k++)
            {
                Result[46 + k] = 0;
            }

            for (k = 0; k < 3; k++)
            {
                Result[54 + k] = 0xff;
            }
            for (k = 0; k < 5; k++)
            {
                Result[57 + k] = 0;
            }

            int pos = 62;
            for (int y = (Size) - 1; y >= 0; y--)
            {

                for (int m = 0; m < ModuleSize; m++)
                {
                    pixels = 0;
                    bit = 8;

                    for (int x = 0; x < (Size); x++)
                    {
                        //                        bit = bit - 1;
                        if ((Matrix[x][y] != 0))
                        {

                            for (int l = 0; l < ModuleSize; l++)
                            {
                                bit = bit - 1;
                                pixels = pixels + (int)Math.Pow(2, bit);
                                if (bit == 0)
                                {
                                    Result[pos] = (byte)pixels;
                                    pos++;
                                    bit = 8;
                                    pixels = 0;
                                }
                            }

                        }
                        else
                        {

                            for (int l = 0; l < ModuleSize; l++)
                            {
                                bit = bit - 1;
                                if (bit == 0)
                                {
                                    Result[pos] = (byte)pixels;
                                    pos++;
                                    bit = 8;
                                    pixels = 0;
                                }
                            }



                        }
                    }
                    if (bit != 8)
                    {
                        Result[pos] = (byte)pixels;
                        pos++;
                    }
                    pos = pos + intPad;
                }
            }

            return Result;
        }

        /// <summary>
        /// Function, which creates a string, representation of SVG QR-Code's image, depending on the various input options chosen. 
        /// </summary>
        /// <param name="DataToEncode">The data that is encoded in the barcode.</param>
        /// <param name="ApplyTilde">Enables processing of tilde and parentheses characters for purposes of encoding ASCII functions and GS1 application identifiers.</param>
        /// <param name="EncodingMode">Various modes used to Data represented in the symbol may be encoded by one of these types.</param>
        /// <param name="Version">Represents the various sizes of the symbol.</param>
        /// <param name="ErrorCorrectionLevel">Four levels of Reed-Solomon error correction, which allow verification of data and recovery in the event that part of the symbol is physically damaged.</param>
        /// <param name="BestMask">Use a best mask for pattern in the QRCode.</param>
        /// <param name="VectorType">Define the type of vector image for output.</param>
        /// <param name="NewLine">String indicating EOL character. Defaults to the operating system EOL character if left NULL.</param>
        /// <param name="QuietZone">Define the size of a blank zone around the code.</param>
        /// <param name="ModuleSize">Define the size of each module.</param>
        /// <returns>Encoded text for use with the 2D barcode font.</returns>
        public string EncodeQR(string DataToEncode, bool ApplyTilde = true, EncodingModes EncodingMode = EncodingModes.Byte, Versions Version = Versions.AUTO, ErrorCorrectionLevels ErrorCorrectionLevel = ErrorCorrectionLevels.M, bool BestMask = true, VectorTypes VectorType = VectorTypes.VecEPS, string NewLine = null, int QuietZone = 2, int ModuleSize = 2)
        {
            Matrix = new int[21][];
            Matrix[0] = new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 };
            Matrix[1] = new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1 };
            Matrix[2] = new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1 };
            Matrix[3] = new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1 };
            Matrix[4] = new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1 };
            Matrix[5] = new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1 };
            Matrix[6] = new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 };
            Matrix[7] = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            Matrix[8] = new int[] { 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1 };
            Matrix[9] = new int[] { 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1 };
            Matrix[10] = new int[] { 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0 };
            Matrix[11] = new int[] { 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1 };
            Matrix[12] = new int[] { 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1 };
            Matrix[13] = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 };
            Matrix[14] = new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0 };
            Matrix[15] = new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1 };
            Matrix[16] = new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1 };
            Matrix[17] = new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 };
            Matrix[18] = new int[] { 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1 };
            Matrix[19] = new int[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1 };
            Matrix[20] = new int[] { 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1 };

            StringBuilder strOut = new StringBuilder("");
            string temp;
            ModuleSize = ModuleSize * 5;
            Size = 21;
            temp = (Size * ModuleSize).ToString();

            if (VectorType == VectorTypes.VecSVG)
            {
                strOut.Append("<?xml version='1.0' standalone='no'?>" + NewLine);
                strOut.Append("<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>" + NewLine);
                strOut.Append("<svg width='" + temp + "' height='" + temp + "' version='1.1' xmlns='http://www.w3.org/2000/svg'>" + NewLine);
                strOut.Append("  <g id='qrcode'>" + NewLine);
                strOut.Append("    <g id='background' fill='#ffffff' stroke='#ffffff'>" + NewLine);
                strOut.Append("      <rect x='0' y='0' width='" + temp + "' height='" + temp + "' />" + NewLine);
                strOut.Append("    </g>" + NewLine);
                strOut.Append("    <g id='pattern' fill='#000000' stroke='#000000'>" + NewLine);

                for (int y = 0; y < Size; y++)
                {
                    for (int x = 0; x < Size; x++)
                    {
                        if (Matrix[x][y] != 0)
                        {
                                strOut.Append("    <g id='R" + y + "C" + x + "' >" + NewLine);
                                strOut.Append("      <rect x='" + (x * ModuleSize).ToString() + "' y='" + (y * ModuleSize).ToString() + "' width='" + (ModuleSize).ToString() + "' height='" + (ModuleSize).ToString() + "' />" + NewLine);
                                strOut.Append("    </g>" + NewLine);
                        }
                    }
                }
                strOut.Append("    </g>" + NewLine);
                strOut.Append("  </g>" + NewLine);
                strOut.Append("</svg>" + NewLine);

            }
            else if (VectorType == VectorTypes.VecEPS)
            {

                strOut.Append("%!PS-Adobe-3.0 EPSF-3.0" + NewLine);
                strOut.Append("%%Creator: vbQRCode 2012.3" + NewLine);
                strOut.Append("%%Title: qrcode" + NewLine);
                strOut.Append("%%CreationDate: " + DateTime.Now.ToString("ddd mmm d hh:mm:ss yyyy") + NewLine);
                strOut.Append("%%BoundingBox: 0 0 " + temp + " " + temp + NewLine);
                strOut.Append("%%DocumentData: Clean7Bit" + NewLine);
                strOut.Append("%%EndComments" + NewLine);
                strOut.Append("%%BeginProlog" + NewLine);
                strOut.Append("/bd { bind def } bind def" + NewLine);
                strOut.Append("/incompound false def" + NewLine);
                strOut.Append("/m { moveto } bd" + NewLine);
                strOut.Append("/l { lineto } bd" + NewLine);
                strOut.Append("/*U { /incompound false def f} bd" + NewLine);
                strOut.Append("/k { setcmykcolor } bd" + NewLine);

                strOut.Append("/c { curveto } bd" + NewLine);
                strOut.Append("/F { incompound not {fill} if } bd" + NewLine);
                strOut.Append("/f { closepath F } bd" + NewLine);
                strOut.Append("/S { stroke } bd" + NewLine);
                strOut.Append("/*u { /incompound true def } bd" + NewLine);
                strOut.Append("/K { k } bd" + NewLine);

                strOut.Append("%%EndProlog" + NewLine);
                strOut.Append("%%BeginSetup" + NewLine);
                strOut.Append("%%EndSetup" + NewLine);
                strOut.Append("0.000 0.000 0.000 0.000 k" + NewLine);
                strOut.Append("0 0 m" + NewLine);
                strOut.Append("0 0 l" + NewLine);
                strOut.Append(temp + " 0 l" + NewLine);
                strOut.Append(temp + " " + temp + " l" + NewLine);
                strOut.Append("0 " + temp + " l" + NewLine);
                strOut.Append("f" + NewLine);
                strOut.Append("*U" + NewLine);

                int n = Size * ModuleSize;
                strOut.Append("0.000 0.000 0.000 1.000 k" + NewLine);
                for (int y = 0; y < Size; y++)
                {
                    for (int x = 0; x < Size; x++)
                    {
                        if (Matrix[x][y] != 0)
                        {
                            strOut.Append((x * ModuleSize).ToString() + " " + (n - y * ModuleSize).ToString() + " m" + NewLine);
                            strOut.Append((x * ModuleSize).ToString() + " " + (n - y * ModuleSize).ToString() + " l" + NewLine);
                            strOut.Append(((x + 1) * ModuleSize).ToString() + " " + (n - y * ModuleSize).ToString() + " l" + NewLine);
                            strOut.Append(((x + 1) * ModuleSize).ToString() + " " + (n - (y + 1) * ModuleSize).ToString() + " l" + NewLine);
                            strOut.Append(((x) * ModuleSize).ToString() + " " + (n - (y + 1) * ModuleSize).ToString() + " l" + NewLine);
                            strOut.Append("f" + NewLine);
                        }
                    }
                }

                strOut.Append("*U" + NewLine);
                strOut.Append("%%Trailer" + NewLine);
                strOut.Append("%%EOF" + NewLine);


            }
            else if (VectorType == VectorTypes.VecHTML)
            {
                strOut.Append("<div style='font-size:0;background-color:#ffffff;position:relative;width:" + temp + "px;height:" + temp + "px;'>" + NewLine);
                for (int y = 0; y < Size; y++)
                {
                    for (int x = 0; x < Size; x++)
                    {
                        if (Matrix[x][y] != 0)
                        {
                            strOut.Append("<div style='background-color:#000000;width:" + ModuleSize.ToString() + "px;height:" + ModuleSize.ToString() + "px;position:absolute;left:" + (x * ModuleSize).ToString() + "px;top:" + (y * ModuleSize).ToString() + "px;'>&nbsp;</div>" + NewLine);
                        }
                    }
                }

                strOut.Append("</div>" + NewLine);

            }

            return strOut.ToString();



        }

        /// <summary>
        /// Function, which creates a QR-Code barcode, depending on the various input options chosen. 
        /// </summary>
        /// <param name="DataToEncode">The data that is encoded in the barcode.</param>
        /// <param name="ApplyTilde">Enables processing of tilde and parentheses characters for purposes of encoding ASCII functions and GS1 application identifiers.</param>
        /// <param name="EncodingMode">Various modes used to Data represented in the symbol may be encoded by one of these types.</param>
        /// <param name="Version">Represents the various sizes of the symbol.</param>
        /// <param name="ErrorCorrectionLevel">Four levels of Reed-Solomon error correction, which allow verification of data and recovery in the event that part of the symbol is physically damaged.</param>
        /// <param name="OutputType">Indicates the encoded text output for the barcode font.</param>
        /// <param name="BestMask">Use a best mask for pattern in the QRCode.</param>
        /// <param name="NewLine">String indicating EOL character. Defaults to the operating system EOL character if left NULL.</param>
        /// <param name="EndSymbolReturn">If TRUE, adds extra Newline character to output.</param>
        /// <returns>Encoded text for use with the 2D barcode font.</returns>
        public string EncodeQR(string DataToEncode, bool ApplyTilde = true, EncodingModes EncodingMode = EncodingModes.Byte, Versions Version = Versions.AUTO, ErrorCorrectionLevels ErrorCorrectionLevel = ErrorCorrectionLevels.M, OutputTypes OutputType = OutputTypes.IDA2DFont, bool BestMask = true, string NewLine = null, bool EndSymbolReturn = false)
        {
            //allows user to set an end-of-line (EOL) string
            if (NewLine == null)
            {
                NewLine = Environment.NewLine; //default
            }

            switch (OutputType)
            {

#if !ENCODER
                case OutputTypes.IDAMonospaceFont:
                    return "█▀▀▀▀▀█ ▄▄▄█▄ █▀▀▀▀▀█" + NewLine + "█ ███ █  ▄▀   █ ███ █" + NewLine + "█ ▀▀▀ █ ▀▀ █▀ █ ▀▀▀ █" + NewLine + "▀▀▀▀▀▀▀ ▀▄▀ ▀ ▀▀▀▀▀▀▀" + NewLine + "█ █▄▀▄▀  ▄ ▄▀▄▄▄▀▄ ▀▄" + NewLine + "▄▀▀▄▄▄▀▀▄▀▀█▄▀█ ▄▀▄▀█" + NewLine + " ▀ ▀▀▀▀ ▄█▄█ ▀▄▄▄▄▀ █" + NewLine + "█▀▀▀▀▀█    ▄▀██ ▀▀▀▄▀" + NewLine + "█ ███ █ ▀█▀▄▀█▄█▀ █▄ " + NewLine + "█ ▀▀▀ █ ▀█  █▄ ▀█ ▀▄█" + NewLine + "▀▀▀▀▀▀▀ ▀  ▀▀  ▀ ▀▀ ▀" + NewLine + "";

                case OutputTypes.IDAProportionalFont:
                    return "█▀▀▀▀▀█░▄▄▄█▄░█▀▀▀▀▀█" + NewLine + "█░███░█░░▄▀░░░█░███░█" + NewLine + "█░▀▀▀░█░▀▀░█▀░█░▀▀▀░█" + NewLine + "▀▀▀▀▀▀▀░▀▄▀░▀░▀▀▀▀▀▀▀" + NewLine + "█░█▄▀▄▀░░▄░▄▀▄▄▄▀▄░▀▄" + NewLine + "▄▀▀▄▄▄▀▀▄▀▀█▄▀█░▄▀▄▀█" + NewLine + "░▀░▀▀▀▀░▄█▄█░▀▄▄▄▄▀░█" + NewLine + "█▀▀▀▀▀█░░░░▄▀██░▀▀▀▄▀" + NewLine + "█░███░█░▀█▀▄▀█▄█▀░█▄░" + NewLine + "█░▀▀▀░█░▀█░░█▄░▀█░▀▄█" + NewLine + "▀▀▀▀▀▀▀░▀░░▀▀░░▀░▀▀░▀" + NewLine;
#endif


                default:
                    return "AHEEEHAPLKJDLPAHEEEHA" + NewLine + "BNFFFNBPFGNDFPBNFFFNB" + NewLine + "CNBKGKFNOJNIGJILGJOFI" + NewLine + "MFNFFFEPLDLCNEILJJFOB" + NewLine + "APBBBPAPFAHLECLBEPBKM" + NewLine + "HHHHHHHPHPPHHPPHPHHPH" + NewLine;
            }

            }

        }

}

//ENUMERATIONS:


    /// <summary>
    /// Various modes used to Data represented in the symbol may be encoded by one of these types.
    /// </summary>
    public enum EncodingModes
    {
        /// <summary>
        /// Encodes data from the decimal set 0-9,
        /// Normally, 3 data characters are represented by 10 bits.
        /// </summary>
        Numeric,

        /// <summary>
        /// In this mode data is encoded at 8 bits per character.
        /// </summary>
        Byte,

        /// <summary>
        /// Encodes data from a set of 45 characters 10 numeric digits 0-9, 26 capital alpha characters A-Z,
        /// and 9 symbols ( space, $, %, *, +, -, ., :, / ) 
        /// Normally, two input characters are represented by 11 bits.
        /// </summary>
        Alphanumeric

    }
    /// <summary>
    /// Four levels of Reed-Solomon error correction, which allow verification of data and recovery in the event that part of the symbol is physically damaged. 
    /// </summary>

    public enum ErrorCorrectionLevels
    {
        /// <summary>
        /// Level M, 15% recovery capacity.
        /// </summary>
        M,

        /// <summary>
        /// Level H, 30% recovery capacity.
        /// </summary>
        H,

        /// <summary>
        /// Level L, 7% recovery capacity.
        /// </summary>
        L,

        /// <summary>
        /// Level Q, 25% recovery capacity.
        /// </summary>
        Q
    }

    /// <summary>
    /// Represent the various sizes of the symbol.
    /// </summary>
    public enum Versions
    {
        /// <summary>
        /// 11 x 11 Format (Micro QR-Code).
        /// </summary>
        M1 = -4,

        /// <summary>
        /// 13 x 13 Format (Micro QR-Code).
        /// </summary>
        M2 = -3,

        /// <summary>
        /// 15 x 15 Format (Micro QR-Code).
        /// </summary>
        M3 = -2,

        /// <summary>
        /// 17 x 17 Format (Micro QR-Code).
        /// </summary>
        M4 = -1,

        /// <summary>
        /// Auto (QR-Code).
        /// </summary>
        AUTO = 0,

        /// <summary>
        /// 21 x 21 Format (QR-Code).
        /// </summary>
        V01,
        /// <summary>
        /// 25 x 25 Format (QR-Code).
        /// </summary>
        V02,
        /// <summary>
        /// 29 x 29 Format (QR-Code).
        /// </summary>
        V03,
        /// <summary>
        /// 33 x 33 Format (QR-Code).
        /// </summary>
        V04,
        /// <summary>
        /// 37 x 37 Format (QR-Code).
        /// </summary>
        V05,
        /// <summary>
        /// 41 x 41 Format (QR-Code).
        /// </summary>
        V06,
        /// <summary>
        /// 45 x 45 Format (QR-Code).
        /// </summary>
        V07,
        /// <summary>
        /// 49 x 49 Format (QR-Code).
        /// </summary>
        V08,
        /// <summary>
        /// 53 x 53 Format (QR-Code).
        /// </summary>
        V09,
        /// <summary>
        /// 57 x 57 Format (QR-Code).
        /// </summary>
        V10,
        /// <summary>
        /// 61 x 61 Format (QR-Code).
        /// </summary>
        V11,
        /// <summary>
        /// 65 x 65 Format (QR-Code).
        /// </summary>
        V12,
        /// <summary>
        /// 69 x 69 Format (QR-Code).
        /// </summary>
        V13,
        /// <summary>
        /// 73 x 73 Format (QR-Code).
        /// </summary>
        V14,
        /// <summary>
        /// 77 x 77 Format (QR-Code).
        /// </summary>
        V15,
        /// <summary>
        /// 81 x 81 Format (QR-Code).
        /// </summary>
        V16,
        /// <summary>
        /// 85 x 85 Format (QR-Code).
        /// </summary>
        V17,
        /// <summary>
        /// 89 x 89 Format (QR-Code).
        /// </summary>
        V18,
        /// <summary>
        /// 93 x 93 Format (QR-Code).
        /// </summary>
        V19,
        /// <summary>
        /// 97 x 97 Format (QR-Code).
        /// </summary>
        V20,
        /// <summary>
        /// 101 x 101 Format (QR-Code).
        /// </summary>
        V21,
        /// <summary>
        /// 105 x 105 Format (QR-Code).
        /// </summary>
        V22,
        /// <summary>
        /// 109 x 109 Format (QR-Code).
        /// </summary>
        V23,
        /// <summary>
        /// 113 x 113 Format (QR-Code).
        /// </summary>
        V24,
        /// <summary>
        /// 117 x 117 Format (QR-Code).
        /// </summary>
        V25,
        /// <summary>
        /// 121 x 121 Format (QR-Code).
        /// </summary>
        V26,
        /// <summary>
        /// 125 x 125 Format (QR-Code).
        /// </summary>
        V27,
        /// <summary>
        /// 129 x 129 Format (QR-Code).
        /// </summary>
        V28,
        /// <summary>
        /// 133 x 133 Format (QR-Code).
        /// </summary>
        V29,
        /// <summary>
        /// 137 x 137 Format (QR-Code).
        /// </summary>
        V30,
        /// <summary>
        /// 141 x 141 Format (QR-Code).
        /// </summary>
        V31,
        /// <summary>
        /// 145 x 145 Format (QR-Code).
        /// </summary>
        V32,
        /// <summary>
        /// 149 x 149 Format (QR-Code).
        /// </summary>
        V33,
        /// <summary>
        /// 153 x 153 Format (QR-Code).
        /// </summary>
        V34,
        /// <summary>
        /// 157 x 157 Format (QR-Code).
        /// </summary>
        V35,
        /// <summary>
        /// 161 x 161 Format (QR-Code).
        /// </summary>
        V36,
        /// <summary>
        /// 165 x 165 Format (QR-Code).
        /// </summary>
        V37,
        /// <summary>
        /// 169 x 169 Format (QR-Code).
        /// </summary>
        V38,
        /// <summary>
        /// 173 x 173 Format (QR-Code).
        /// </summary>
        V39,
        /// <summary>
        /// 177 x 177 Format (QR-Code).
        /// </summary>
        V40
    }
    /// <summary>
    /// Various types of output.
    /// </summary>
    public enum OutputTypes
    {
        
        /// <summary>
        /// For use with IDAutomation QR-Code or 2D Barcode Fonts. Returns QR-Code encoded text. 
        /// </summary>
        IDA2DFont,


#if !ENCODER
        /// <summary>
        /// Returns QR-Code native object. For use with monospaced fonts.
        /// </summary>
        IDAMonospaceFont,

        /// <summary>
        /// Returns QR-Code native object. For use with standard (proportional) fonts.
        /// </summary>

        IDAProportionalFont
#endif


    }

/// <summary>
/// Various types of vector image output.
/// </summary>
public enum VectorTypes
{

    /// <summary>
    /// Returns a string with the SVG representation. 
    /// </summary>
    VecSVG,

    /// <summary>
    /// Return a string with the EPS representation.
    /// </summary>
    VecEPS,

    /// <summary>
    /// Return a string with the HTML representation.
    /// </summary>
    VecHTML,

}