From 05cc2023daa57bfdb813e478ddb61c1b2f3156c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sat, 5 Oct 2013 20:43:42 +0200 Subject: Add parts of zxing library to generate qr codes --- OpenPGP-Keychain/src/com/google/zxing/Writer.java | 54 +++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 OpenPGP-Keychain/src/com/google/zxing/Writer.java (limited to 'OpenPGP-Keychain/src/com/google/zxing/Writer.java') diff --git a/OpenPGP-Keychain/src/com/google/zxing/Writer.java b/OpenPGP-Keychain/src/com/google/zxing/Writer.java new file mode 100644 index 000000000..6474ca7e2 --- /dev/null +++ b/OpenPGP-Keychain/src/com/google/zxing/Writer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2008 ZXing authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.zxing; + +import com.google.zxing.common.BitMatrix; + +import java.util.Hashtable; + +/** + * The base class for all objects which encode/generate a barcode image. + * + * @author dswitkin@google.com (Daniel Switkin) + */ +public interface Writer { + + /** + * Encode a barcode using the default settings. + * + * @param contents The contents to encode in the barcode + * @param format The barcode format to generate + * @param width The preferred width in pixels + * @param height The preferred height in pixels + * @return The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + */ + BitMatrix encode(String contents, BarcodeFormat format, int width, int height) + throws WriterException; + + /** + * + * @param contents The contents to encode in the barcode + * @param format The barcode format to generate + * @param width The preferred width in pixels + * @param height The preferred height in pixels + * @param hints Additional parameters to supply to the encoder + * @return The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + */ + BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Hashtable hints) + throws WriterException; + +} -- cgit v1.2.3