ruby-zint 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.standard.yml +2 -0
- data/Gemfile +2 -0
- data/README.md +30 -8
- data/Rakefile +12 -0
- data/ext/ruby-zint/extconf.rb +86 -0
- data/lib/zint/aus_post.rb +1 -0
- data/lib/zint/aus_redirect.rb +1 -0
- data/lib/zint/aus_reply.rb +1 -0
- data/lib/zint/aus_route.rb +1 -0
- data/lib/zint/azrune.rb +1 -0
- data/lib/zint/aztec.rb +1 -0
- data/lib/zint/barcode.rb +439 -47
- data/lib/zint/{noascii.rb → bc_412.rb} +3 -2
- data/lib/zint/c25iata.rb +1 -0
- data/lib/zint/c25ind.rb +1 -0
- data/lib/zint/c25inter.rb +1 -0
- data/lib/zint/c25logic.rb +1 -0
- data/lib/zint/c25matrix.rb +1 -0
- data/lib/zint/c25standard.rb +1 -0
- data/lib/zint/{box.rb → cep_net.rb} +3 -2
- data/lib/zint/channel.rb +1 -0
- data/lib/zint/codabar.rb +1 -0
- data/lib/zint/codablock_f.rb +1 -0
- data/lib/zint/code11.rb +1 -0
- data/lib/zint/code128.rb +1 -0
- data/lib/zint/{dotty_mode.rb → code128ab.rb} +3 -2
- data/lib/zint/code128b.rb +2 -4
- data/lib/zint/code16k.rb +1 -0
- data/lib/zint/code32.rb +1 -0
- data/lib/zint/code39.rb +1 -0
- data/lib/zint/code49.rb +1 -0
- data/lib/zint/code93.rb +1 -0
- data/lib/zint/code_one.rb +1 -0
- data/lib/zint/constants/capability_flags.rb +14 -11
- data/lib/zint/constants/input_data_types.rb +8 -7
- data/lib/zint/constants/output_options.rb +14 -11
- data/lib/zint/constants/symbologies.rb +13 -6
- data/lib/zint/constants/warn_levels.rb +1 -1
- data/lib/zint/daft.rb +1 -0
- data/lib/zint/data_matrix.rb +1 -0
- data/lib/zint/dbarexp.rb +1 -0
- data/lib/zint/dbarexpstk.rb +1 -0
- data/lib/zint/dbarltd.rb +1 -0
- data/lib/zint/dbaromn.rb +1 -0
- data/lib/zint/dbaromnstk.rb +1 -0
- data/lib/zint/dbarstk.rb +1 -0
- data/lib/zint/dependencies.rb +8 -0
- data/lib/zint/dot_code.rb +1 -0
- data/lib/zint/dpd.rb +1 -0
- data/lib/zint/dpident.rb +1 -0
- data/lib/zint/dpleit.rb +1 -0
- data/lib/zint/ean128.rb +1 -0
- data/lib/zint/ean14.rb +1 -0
- data/lib/zint/eanx.rb +1 -0
- data/lib/zint/eanxchk.rb +1 -0
- data/lib/zint/excode39.rb +1 -0
- data/lib/zint/fim.rb +1 -0
- data/lib/zint/flat.rb +1 -0
- data/lib/zint/grid_matrix.rb +1 -0
- data/lib/zint/gs1_128.rb +1 -0
- data/lib/zint/hanxin.rb +1 -0
- data/lib/zint/hibc128.rb +1 -0
- data/lib/zint/hibc39.rb +1 -0
- data/lib/zint/hibcaztec.rb +1 -0
- data/lib/zint/hibcblockf.rb +1 -0
- data/lib/zint/hibcdm.rb +1 -0
- data/lib/zint/hibcmicpdf.rb +1 -0
- data/lib/zint/hibcpdf.rb +1 -0
- data/lib/zint/hibcqr.rb +1 -0
- data/lib/zint/isbnx.rb +1 -0
- data/lib/zint/itf14.rb +1 -0
- data/lib/zint/japan_post.rb +1 -0
- data/lib/zint/kix.rb +1 -0
- data/lib/zint/korea_post.rb +1 -0
- data/lib/zint/logmars.rb +1 -0
- data/lib/zint/mailmark.rb +1 -0
- data/lib/zint/mailmark_2d.rb +8 -0
- data/lib/zint/mailmark_4s.rb +8 -0
- data/lib/zint/maxi_code.rb +1 -0
- data/lib/zint/micro_pdf417.rb +1 -0
- data/lib/zint/micro_qr.rb +1 -0
- data/lib/zint/msiplessey.rb +1 -0
- data/lib/zint/native.rb +87 -0
- data/lib/zint/nve18.rb +1 -0
- data/lib/zint/one_code.rb +1 -0
- data/lib/zint/pdf417.rb +1 -0
- data/lib/zint/pdf417comp.rb +1 -0
- data/lib/zint/pdf417trunc.rb +1 -0
- data/lib/zint/pharma.rb +1 -0
- data/lib/zint/pharmatwo.rb +1 -0
- data/lib/zint/planet.rb +1 -0
- data/lib/zint/plessey.rb +1 -0
- data/lib/zint/postnet.rb +1 -0
- data/lib/zint/pzn.rb +1 -0
- data/lib/zint/qr.rb +1 -0
- data/lib/zint/rmqr.rb +1 -0
- data/lib/zint/rss14.rb +1 -0
- data/lib/zint/rss14stack.rb +1 -0
- data/lib/zint/rss14stackomni.rb +1 -0
- data/lib/zint/rssexp.rb +1 -0
- data/lib/zint/rssexpstack.rb +1 -0
- data/lib/zint/rssltd.rb +1 -0
- data/lib/zint/structs/structapp.rb +25 -0
- data/lib/zint/structs/symbol.rb +44 -36
- data/lib/zint/structs/vector.rb +47 -5
- data/lib/zint/structs/vector_circle.rb +32 -0
- data/lib/zint/structs/vector_hexagon.rb +31 -0
- data/lib/zint/structs/vector_rect.rb +37 -0
- data/lib/zint/structs/vector_string.rb +43 -8
- data/lib/zint/telepen.rb +1 -0
- data/lib/zint/telepennum.rb +1 -0
- data/lib/zint/ultra.rb +1 -0
- data/lib/zint/upc_a.rb +1 -0
- data/lib/zint/upc_a_chk.rb +1 -0
- data/lib/zint/upc_e.rb +1 -0
- data/lib/zint/upc_e_chk.rb +1 -0
- data/lib/zint/upnqr.rb +1 -0
- data/lib/zint/{bind.rb → upu_s10.rb} +3 -2
- data/lib/zint/uspsimail.rb +1 -0
- data/lib/zint/version.rb +1 -1
- data/lib/zint/vin.rb +1 -0
- data/lib/zint/zint_recipe.rb +27 -0
- data/lib/zint.rb +15 -83
- data/ports/archives/zint-2.12.0-src.tar.gz +0 -0
- metadata +34 -12
- data/Gemfile.lock +0 -79
- data/lib/zint/stdout.rb +0 -7
- data/lib/zint/structs/circle.rb +0 -11
- data/lib/zint/structs/hexagon.rb +0 -11
- data/lib/zint/structs/rect.rb +0 -12
data/lib/zint/code49.rb
CHANGED
data/lib/zint/code93.rb
CHANGED
data/lib/zint/code_one.rb
CHANGED
|
@@ -2,17 +2,20 @@ module Zint
|
|
|
2
2
|
module Constants
|
|
3
3
|
# Capability flags (ZBarcode_Cap() `cap_flag`)
|
|
4
4
|
module CapabilityFlags
|
|
5
|
-
ZINT_CAP_HRT = 0x0001 # Prints Human Readable Text?
|
|
6
|
-
ZINT_CAP_STACKABLE = 0x0002 # Is stackable?
|
|
7
|
-
ZINT_CAP_EXTENDABLE = 0x0004 # Is extendable with add-on data? (Is UPC
|
|
8
|
-
ZINT_CAP_COMPOSITE = 0x0008 # Can have composite data?
|
|
9
|
-
ZINT_CAP_ECI = 0x0010 # Supports Extended Channel Interpretations?
|
|
10
|
-
ZINT_CAP_GS1 = 0x0020 # Supports GS1 data?
|
|
11
|
-
ZINT_CAP_DOTTY = 0x0040 # Can be output as dots?
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
ZINT_CAP_HRT = 0x0001 # Prints Human Readable Text? */
|
|
6
|
+
ZINT_CAP_STACKABLE = 0x0002 # Is stackable? */
|
|
7
|
+
ZINT_CAP_EXTENDABLE = 0x0004 # Is extendable with add-on data? (Is EAN/UPC?) */
|
|
8
|
+
ZINT_CAP_COMPOSITE = 0x0008 # Can have composite data? */
|
|
9
|
+
ZINT_CAP_ECI = 0x0010 # Supports Extended Channel Interpretations? */
|
|
10
|
+
ZINT_CAP_GS1 = 0x0020 # Supports GS1 data? */
|
|
11
|
+
ZINT_CAP_DOTTY = 0x0040 # Can be output as dots? */
|
|
12
|
+
ZINT_CAP_QUIET_ZONES = 0x0080 # Has default quiet zones? */
|
|
13
|
+
ZINT_CAP_FIXED_RATIO = 0x0100 # Has fixed width-to-height (aspect) ratio? */
|
|
14
|
+
ZINT_CAP_READER_INIT = 0x0200 # Supports Reader Initialisation? */
|
|
15
|
+
ZINT_CAP_FULL_MULTIBYTE = 0x0400 # Supports full-multibyte option? */
|
|
16
|
+
ZINT_CAP_MASK = 0x0800 # Is mask selectable? */
|
|
17
|
+
ZINT_CAP_STRUCTAPP = 0x1000 # Supports Structured Append? */
|
|
18
|
+
ZINT_CAP_COMPLIANT_HEIGHT = 0x2000 # Has compliant height? */
|
|
16
19
|
end
|
|
17
20
|
end
|
|
18
21
|
end
|
|
@@ -2,13 +2,14 @@ module Zint
|
|
|
2
2
|
module Constants
|
|
3
3
|
# Input data types (`symbol->input_mode`)
|
|
4
4
|
module InputDataTypes
|
|
5
|
-
DATA_MODE = 0
|
|
6
|
-
UNICODE_MODE = 1
|
|
7
|
-
GS1_MODE = 2
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
DATA_MODE = 0 # Binary
|
|
6
|
+
UNICODE_MODE = 1 # UTF-8
|
|
7
|
+
GS1_MODE = 2 # GS1
|
|
8
|
+
ESCAPE_MODE = 0x0008 # Process escape sequences
|
|
9
|
+
GS1PARENS_MODE = 0x0010 # Process parentheses as GS1 AI delimiters (instead of square brackets)
|
|
10
|
+
GS1NOCHECK_MODE = 0x0020 # Do not check validity of GS1 data (except that printable ASCII only)
|
|
11
|
+
HEIGHTPERROW_MODE = 0x0040 # Interpret `height` as per-row rather than as overall height
|
|
12
|
+
FAST_MODE = 0x0080 # Use faster if less optimal encodation or other shortcuts if available (affects DATAMATRIX, MICROPDF417, PDF417, QRCODE & UPNQR only)
|
|
12
13
|
end
|
|
13
14
|
end
|
|
14
15
|
end
|
|
@@ -2,17 +2,20 @@ module Zint
|
|
|
2
2
|
module Constants
|
|
3
3
|
# Output options (`symbol->output_options`)
|
|
4
4
|
module OutputOptions
|
|
5
|
-
|
|
6
|
-
BARCODE_BIND =
|
|
7
|
-
BARCODE_BOX =
|
|
8
|
-
BARCODE_STDOUT =
|
|
9
|
-
READER_INIT =
|
|
10
|
-
SMALL_TEXT =
|
|
11
|
-
BOLD_TEXT =
|
|
12
|
-
CMYK_COLOUR =
|
|
13
|
-
BARCODE_DOTTY_MODE =
|
|
14
|
-
GS1_GS_SEPARATOR =
|
|
15
|
-
OUT_BUFFER_INTERMEDIATE =
|
|
5
|
+
BARCODE_BIND_TOP = 0x0001 # Boundary bar above the symbol only (not below), does not affect stacking */
|
|
6
|
+
BARCODE_BIND = 0x0002 # Boundary bars above & below the symbol and between stacked symbols */
|
|
7
|
+
BARCODE_BOX = 0x0004 # Box around symbol */
|
|
8
|
+
BARCODE_STDOUT = 0x0008 # Output to stdout */
|
|
9
|
+
READER_INIT = 0x0010 # Reader Initialisation (Programming) */
|
|
10
|
+
SMALL_TEXT = 0x0020 # Use smaller font */
|
|
11
|
+
BOLD_TEXT = 0x0040 # Use bold font */
|
|
12
|
+
CMYK_COLOUR = 0x0080 # CMYK colour space (Encapsulated PostScript and TIF) */
|
|
13
|
+
BARCODE_DOTTY_MODE = 0x0100 # Plot a matrix symbol using dots rather than squares */
|
|
14
|
+
GS1_GS_SEPARATOR = 0x0200 # Use GS instead of FNC1 as GS1 separator (Data Matrix) */
|
|
15
|
+
OUT_BUFFER_INTERMEDIATE = 0x0400 # Return ASCII values in bitmap buffer (OUT_BUFFER only) */
|
|
16
|
+
BARCODE_QUIET_ZONES = 0x0800 # Add compliant quiet zones (additional to any specified whitespace); Note: CODE16K, CODE49, CODABLOCKF, ITF14, EAN/UPC have default quiet zones */
|
|
17
|
+
BARCODE_NO_QUIET_ZONES = 0x1000 # Disable quiet zones, notably those with defaults as listed above */
|
|
18
|
+
COMPLIANT_HEIGHT = 0x2000 # Warn if height not compliant and use standard height (if any) as default */
|
|
16
19
|
end
|
|
17
20
|
end
|
|
18
21
|
end
|
|
@@ -35,25 +35,27 @@ module Zint
|
|
|
35
35
|
BARCODE_UPCA_CHK = 35 # UPC-A + Check Digit
|
|
36
36
|
BARCODE_UPCE = 37 # UPC-E
|
|
37
37
|
BARCODE_UPCE_CHK = 38 # UPC-E + Check Digit
|
|
38
|
-
BARCODE_POSTNET = 40 #
|
|
38
|
+
BARCODE_POSTNET = 40 # USPS (U.S. Postal Service) POSTNET
|
|
39
39
|
BARCODE_MSI_PLESSEY = 47 # MSI Plessey
|
|
40
40
|
BARCODE_FIM = 49 # Facing Identification Mark
|
|
41
41
|
BARCODE_LOGMARS = 50 # LOGMARS
|
|
42
42
|
BARCODE_PHARMA = 51 # Pharmacode One-Track
|
|
43
43
|
BARCODE_PZN = 52 # Pharmazentralnummer
|
|
44
44
|
BARCODE_PHARMA_TWO = 53 # Pharmacode Two-Track
|
|
45
|
+
BARCODE_CEPNET = 54 # Brazilian CEPNet Postal Code
|
|
45
46
|
BARCODE_PDF417 = 55 # PDF417
|
|
46
47
|
BARCODE_PDF417COMP = 56 # Compact PDF417 (Truncated PDF417)
|
|
47
48
|
BARCODE_PDF417TRUNC = 56 # Legacy
|
|
48
49
|
BARCODE_MAXICODE = 57 # MaxiCode
|
|
49
50
|
BARCODE_QRCODE = 58 # QR Code
|
|
50
|
-
|
|
51
|
+
BARCODE_CODE128AB = 60 # Code 128 (Suppress subset C)
|
|
52
|
+
BARCODE_CODE128B = 60 # Legacy
|
|
51
53
|
BARCODE_AUSPOST = 63 # Australia Post Standard Customer
|
|
52
54
|
BARCODE_AUSREPLY = 66 # Australia Post Reply Paid
|
|
53
55
|
BARCODE_AUSROUTE = 67 # Australia Post Routing
|
|
54
56
|
BARCODE_AUSREDIRECT = 68 # Australia Post Redirection
|
|
55
57
|
BARCODE_ISBNX = 69 # ISBN
|
|
56
|
-
BARCODE_RM4SCC = 70 # Royal Mail 4
|
|
58
|
+
BARCODE_RM4SCC = 70 # Royal Mail 4-State Customer Code
|
|
57
59
|
BARCODE_DATAMATRIX = 71 # Data Matrix (ECC200)
|
|
58
60
|
BARCODE_EAN14 = 72 # EAN-14
|
|
59
61
|
BARCODE_VIN = 73 # Vehicle Identification Number
|
|
@@ -71,7 +73,7 @@ module Zint
|
|
|
71
73
|
BARCODE_MICROPDF417 = 84 # MicroPDF417
|
|
72
74
|
BARCODE_USPS_IMAIL = 85 # USPS Intelligent Mail (OneCode)
|
|
73
75
|
BARCODE_ONECODE = 85 # Legacy
|
|
74
|
-
BARCODE_PLESSEY = 86 # Plessey
|
|
76
|
+
BARCODE_PLESSEY = 86 # UK Plessey
|
|
75
77
|
|
|
76
78
|
# Tbarcode 8 codes
|
|
77
79
|
BARCODE_TELEPEN_NUM = 87 # Telepen Numeric
|
|
@@ -83,7 +85,7 @@ module Zint
|
|
|
83
85
|
BARCODE_MICROQR = 97 # Micro QR Code
|
|
84
86
|
|
|
85
87
|
# Tbarcode 9 codes
|
|
86
|
-
BARCODE_HIBC_128 = 98 # HIBC Code 128
|
|
88
|
+
BARCODE_HIBC_128 = 98 # HIBC (Health Industry Barcode) Code 128
|
|
87
89
|
BARCODE_HIBC_39 = 99 # HIBC Code 39
|
|
88
90
|
BARCODE_HIBC_DM = 102 # HIBC Data Matrix
|
|
89
91
|
BARCODE_HIBC_QR = 104 # HIBC QR Code
|
|
@@ -97,7 +99,10 @@ module Zint
|
|
|
97
99
|
BARCODE_HANXIN = 116 # Han Xin (Chinese Sensible) Code
|
|
98
100
|
|
|
99
101
|
# Tbarcode 11 codes
|
|
100
|
-
|
|
102
|
+
BARCODE_MAILMARK_2D = 119 # Royal Mail 2D Mailmark (CMDM) (Data Matrix)
|
|
103
|
+
BARCODE_UPU_S10 = 120 # Universal Postal Union S10
|
|
104
|
+
BARCODE_MAILMARK_4S = 121 # Royal Mail 4-State Mailmark
|
|
105
|
+
BARCODE_MAILMARK = 121 # Legacy
|
|
101
106
|
|
|
102
107
|
# Zint specific
|
|
103
108
|
BARCODE_AZRUNE = 128 # Aztec Runes
|
|
@@ -125,6 +130,8 @@ module Zint
|
|
|
125
130
|
BARCODE_UPNQR = 143 # UPNQR (Univerzalnega Plačilnega Naloga QR)
|
|
126
131
|
BARCODE_ULTRA = 144 # Ultracode
|
|
127
132
|
BARCODE_RMQR = 145 # Rectangular Micro QR Code (rMQR)
|
|
133
|
+
BARCODE_BC412 = 146 # IBM BC412 (SEMI T1-95)
|
|
134
|
+
BARCODE_LAST = 146 # Max barcode number marker, not barcode
|
|
128
135
|
end
|
|
129
136
|
end
|
|
130
137
|
end
|
data/lib/zint/daft.rb
CHANGED
data/lib/zint/data_matrix.rb
CHANGED
data/lib/zint/dbarexp.rb
CHANGED
data/lib/zint/dbarexpstk.rb
CHANGED
data/lib/zint/dbarltd.rb
CHANGED
data/lib/zint/dbaromn.rb
CHANGED
data/lib/zint/dbaromnstk.rb
CHANGED
data/lib/zint/dbarstk.rb
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
ZINT_VERSION = ENV["ZINT_VERSION"] || "2.12.0"
|
|
3
|
+
# ZINT_SOURCE_URI = "file://#{File.join(File.expand_path("../../../", __FILE__))}/ports/archives/zint-#{ZINT_VERSION}-src.tar.gz"
|
|
4
|
+
ZINT_SOURCE_URI = "https://downloads.sourceforge.net/zint/zint-#{ZINT_VERSION}-src.tar.gz"
|
|
5
|
+
ZINT_SOURCE_SHA1 = "6e16036d9822895edededd96e65da755ef3fdb69"
|
|
6
|
+
|
|
7
|
+
MINI_PORTILE_VERSION = "~> 2.1"
|
|
8
|
+
end
|
data/lib/zint/dot_code.rb
CHANGED
data/lib/zint/dpd.rb
CHANGED
data/lib/zint/dpident.rb
CHANGED
data/lib/zint/dpleit.rb
CHANGED
data/lib/zint/ean128.rb
CHANGED
data/lib/zint/ean14.rb
CHANGED
data/lib/zint/eanx.rb
CHANGED
data/lib/zint/eanxchk.rb
CHANGED
data/lib/zint/excode39.rb
CHANGED
data/lib/zint/fim.rb
CHANGED
data/lib/zint/flat.rb
CHANGED
data/lib/zint/grid_matrix.rb
CHANGED
data/lib/zint/gs1_128.rb
CHANGED
data/lib/zint/hanxin.rb
CHANGED
data/lib/zint/hibc128.rb
CHANGED
data/lib/zint/hibc39.rb
CHANGED
data/lib/zint/hibcaztec.rb
CHANGED
data/lib/zint/hibcblockf.rb
CHANGED
data/lib/zint/hibcdm.rb
CHANGED
data/lib/zint/hibcmicpdf.rb
CHANGED
data/lib/zint/hibcpdf.rb
CHANGED
data/lib/zint/hibcqr.rb
CHANGED
data/lib/zint/isbnx.rb
CHANGED
data/lib/zint/itf14.rb
CHANGED
data/lib/zint/japan_post.rb
CHANGED
data/lib/zint/kix.rb
CHANGED
data/lib/zint/korea_post.rb
CHANGED
data/lib/zint/logmars.rb
CHANGED
data/lib/zint/mailmark.rb
CHANGED
data/lib/zint/maxi_code.rb
CHANGED
data/lib/zint/micro_pdf417.rb
CHANGED
data/lib/zint/micro_qr.rb
CHANGED
data/lib/zint/msiplessey.rb
CHANGED
data/lib/zint/native.rb
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
module Native
|
|
3
|
+
extend FFI::Library
|
|
4
|
+
|
|
5
|
+
root_path = File.expand_path("../../..", __FILE__)
|
|
6
|
+
prefix = FFI::Platform::LIBPREFIX.empty? ? "lib" : FFI::Platform::LIBPREFIX
|
|
7
|
+
bundled_dll = File.join(root_path, "lib/#{prefix}zint.#{FFI::Platform::LIBSUFFIX}")
|
|
8
|
+
ffi_lib [bundled_dll, "libzint.so.2.12", "libzint", "zint"]
|
|
9
|
+
|
|
10
|
+
# Error codes (API return values)
|
|
11
|
+
enum :error_code, [Constants::Warnings::WARNINGS, Constants::Errors::ERRORS].map { |h| h.to_a }.flatten
|
|
12
|
+
|
|
13
|
+
# Aliases for better method signatures
|
|
14
|
+
typedef Structs::Symbol.by_ref, :zint_symbol
|
|
15
|
+
typedef :pointer, :filename
|
|
16
|
+
typedef :int32, :length
|
|
17
|
+
typedef :int32, :rotate_angle
|
|
18
|
+
typedef :int32, :symbol_id
|
|
19
|
+
typedef :uint32, :cap_flag
|
|
20
|
+
typedef :string, :source
|
|
21
|
+
|
|
22
|
+
# Create and initialize a symbol structure
|
|
23
|
+
attach_function(:ZBarcode_Create, [], :zint_symbol)
|
|
24
|
+
|
|
25
|
+
# Free any output buffers that may have been created and initialize output fields
|
|
26
|
+
attach_function(:ZBarcode_Clear, [:zint_symbol], :void)
|
|
27
|
+
|
|
28
|
+
# Free a symbol structure, including any output buffers
|
|
29
|
+
#
|
|
30
|
+
# For use with ruby's garbage collector ZBarcode_Delete must be called with a plain :pointer and not an :zint_symbol.
|
|
31
|
+
attach_function(:ZBarcode_Delete, [:pointer], :void)
|
|
32
|
+
|
|
33
|
+
# Encode a barcode. If `length` is 0, `source` must be NUL-terminated.
|
|
34
|
+
attach_function(:ZBarcode_Encode, [:zint_symbol, :source, :length], :error_code)
|
|
35
|
+
|
|
36
|
+
# Encode a barcode using input data from file `filename`
|
|
37
|
+
attach_function(:ZBarcode_Encode_File, [:zint_symbol, :filename], :error_code)
|
|
38
|
+
|
|
39
|
+
# Output a previously encoded symbol to file `symbol->outfile`
|
|
40
|
+
attach_function(:ZBarcode_Print, [:zint_symbol, :rotate_angle], :error_code)
|
|
41
|
+
|
|
42
|
+
# Encode and output a symbol to file `symbol->outfile`
|
|
43
|
+
attach_function(:ZBarcode_Encode_and_Print, [:zint_symbol, :source, :length, :rotate_angle], :error_code)
|
|
44
|
+
|
|
45
|
+
# Encode a symbol using input data from file `filename` and output to file `symbol->outfile`
|
|
46
|
+
attach_function(:ZBarcode_Encode_File_and_Print, [:zint_symbol, :filename, :rotate_angle], :error_code)
|
|
47
|
+
|
|
48
|
+
# Output a previously encoded symbol to memory as raster (`symbol->bitmap`)
|
|
49
|
+
attach_function(:ZBarcode_Buffer, [:zint_symbol, :rotate_angle], :error_code)
|
|
50
|
+
|
|
51
|
+
# Encode and output a symbol to memory as raster (`symbol->bitmap`)
|
|
52
|
+
attach_function(:ZBarcode_Encode_and_Buffer, [:zint_symbol, :source, :length, :rotate_angle], :error_code)
|
|
53
|
+
|
|
54
|
+
# Encode a symbol using input data from file `filename` and output to memory as raster (`symbol->bitmap`)
|
|
55
|
+
attach_function(:ZBarcode_Encode_File_and_Buffer, [:zint_symbol, :filename, :rotate_angle], :error_code)
|
|
56
|
+
|
|
57
|
+
# Output a previously encoded symbol to memory as vector (`symbol->vector`)
|
|
58
|
+
attach_function(:ZBarcode_Buffer_Vector, [:zint_symbol, :rotate_angle], :error_code)
|
|
59
|
+
|
|
60
|
+
# Encode and output a symbol to memory as vector (`symbol->vector`)
|
|
61
|
+
attach_function(:ZBarcode_Encode_and_Buffer_Vector, [:zint_symbol, :source, :length, :rotate_angle], :error_code)
|
|
62
|
+
|
|
63
|
+
# Encode a symbol using input data from file `filename` and output to memory as vector (`symbol->vector`)
|
|
64
|
+
attach_function(:ZBarcode_Encode_File_and_Buffer_Vector, [:zint_symbol, :filename, :rotate_angle], :error_code)
|
|
65
|
+
|
|
66
|
+
# Is `symbol_id` a recognized symbology?
|
|
67
|
+
attach_function(:ZBarcode_ValidID, [:symbol_id], :bool)
|
|
68
|
+
|
|
69
|
+
# Return the capability flags for symbology `symbol_id` that match `cap_flag`
|
|
70
|
+
attach_function(:ZBarcode_Cap, [:symbol_id, :cap_flag], :uint32)
|
|
71
|
+
|
|
72
|
+
# Return the version of Zint linked to
|
|
73
|
+
attach_function(:ZBarcode_Version, [], :int32)
|
|
74
|
+
|
|
75
|
+
# Raises specific error for API return code
|
|
76
|
+
#
|
|
77
|
+
# @param res [Symbol, Integer] API return code
|
|
78
|
+
# @param text [String] error text
|
|
79
|
+
# @raise [Error]
|
|
80
|
+
def self.raise_error(res, text)
|
|
81
|
+
klass = ERROR_CLASS_FOR_RESULT[res.is_a?(Symbol) ? Zint::ERRORS[res] : res]
|
|
82
|
+
raise klass, text
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
private_constant :Native
|
|
87
|
+
end
|
data/lib/zint/nve18.rb
CHANGED
data/lib/zint/one_code.rb
CHANGED
data/lib/zint/pdf417.rb
CHANGED