1 #pragma once 2 /* 3 * Copyright 2016 Nu-book Inc. 4 * Copyright 2016 ZXing authors 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 namespace ZXing { 20 namespace QRCode { 21 22 /** 23 * <p>See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels 24 * defined by the QR code standard.</p> 25 * 26 * @author Sean Owen 27 */ 28 enum class ErrorCorrectionLevel 29 { 30 Low, // L = ~7 % correction 31 Medium, // M = ~15% correction 32 Quality, // Q = ~25% correction 33 High, // H = ~30% correction 34 Invalid, // denotes in invalid/unknown value 35 }; 36 37 const wchar_t* ToString(ErrorCorrectionLevel l); 38 ErrorCorrectionLevel ECLevelFromString(const char* str); 39 ErrorCorrectionLevel ECLevelFromBits(int bits); 40 int BitsFromECLevel(ErrorCorrectionLevel l); 41 42 } // QRCode 43 } // ZXing 44