| 30 | {} |
| 31 | |
| 32 | BitMatrix Writer::encode(const std::wstring& contents, int width, int height) const |
| 33 | { |
| 34 | if (contents.empty()) { |
| 35 | throw std::invalid_argument("Found empty contents"); |
| 36 | } |
| 37 | |
| 38 | if (width < 0 || height < 0) { |
| 39 | throw std::invalid_argument("Requested dimensions are invalid"); |
| 40 | } |
| 41 | |
| 42 | EncodeResult code = Encode(contents, _ecLevel, _encoding, _version, _useGs1Format, _maskPattern); |
| 43 | return Inflate(std::move(code.matrix), width, height, _margin); |
| 44 | } |
| 45 | |
| 46 | BitMatrix Writer::encode(const std::string& contents, int width, int height) const |
| 47 | { |