What are the inputs?
I can get the following from querying the filter:
inputkeys: inputBarcodeDescriptor
How do you define a barcode generator using the InputBarcodeDescriptor?
Does it support code 3 of 9?
What are the inputs?
I can get the following from querying the filter:
inputkeys: inputBarcodeDescriptor
How do you define a barcode generator using the InputBarcodeDescriptor?
Does it support code 3 of 9?
I guess you've figured it out, but for anyone else... I was just working on the Aztec code, but it's the same principle.
if let filter = CIFilter(name: "CIAztecCodeGenerator") {
print(filter.attributes)
}
and this prints:
["CIAttributeFilterAvailable_iOS": 8, "CIAttributeFilterDisplayName": Aztec Code Generator, "inputCorrectionLevel": {
CIAttributeClass = NSNumber;
CIAttributeDefault = 23;
CIAttributeDescription = "Aztec error correction value between 5 and 95";
CIAttributeDisplayName = CorrectionLevel;
CIAttributeMax = 95;
CIAttributeMin = 5;
CIAttributeSliderMax = 95;
CIAttributeSliderMin = 5;
}, "inputLayers": {
CIAttributeClass = NSNumber;
CIAttributeDescription = "Aztec layers value between 1 and 32. Set to nil for automatic.";
CIAttributeDisplayName = Layers;
CIAttributeMax = 32;
CIAttributeMin = 1;
CIAttributeSliderMax = 32;
CIAttributeSliderMin = 1;
}, "inputMessage": {
CIAttributeClass = NSData;
CIAttributeDisplayName = Message;
}, "CIAttributeFilterAvailable_Mac": 10.10, "CIAttributeFilterName": CIAztecCodeGenerator, "inputCompactStyle": {
CIAttributeClass = NSNumber;
CIAttributeDescription = "Aztec force compact style @YES or @NO. Set to nil for automatic.";
CIAttributeDisplayName = CompactStyle;
CIAttributeMax = 1;
CIAttributeMin = 0;
CIAttributeSliderMax = 1;
CIAttributeSliderMin = 0;
}, "CIAttributeReferenceDocumentation": http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/e/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/
so...
guard let myData = myString.data(using: String.Encoding.utf8) else {
return nil
}
if let filter = CIFilter(name: "CIAztecCodeGenerator") {
print(filter.attributes)
filter.setValue(myData, forKey: "inputMessage")
filter.setValue(26, forKey: "inputLayers")
if let barcodeCIImage = filter.outputImage {
// do stuff....
}
}