(String content, int size, int margin)
| 19 | private static final float MODULE_RADIUS_RATIO = 0.45f; |
| 20 | |
| 21 | public static Bitmap getBitmap(String content, int size, int margin) { |
| 22 | try { |
| 23 | int foreground = Color.WHITE; |
| 24 | int finderBackground = Color.BLACK; |
| 25 | BitMatrix matrix = encode(content, size, margin); |
| 26 | int quietZone = detectQuietZone(matrix); |
| 27 | int finderSize = detectFinderPx(matrix, quietZone); |
| 28 | return render(matrix, foreground, finderBackground, quietZone, finderSize); |
| 29 | } catch (Exception e) { |
| 30 | return null; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | private static BitMatrix encode(String content, int size, int margin) throws Exception { |
| 35 | Map<EncodeHintType, Object> hints = new EnumMap<>(EncodeHintType.class); |
no test coverage detected