Replies: 5 comments 11 replies
-
I added 2 changesets:
The shortest possible use case in c++ with the current function based API (the 'fluent interface' is still on the table / in the making) looks like this: auto svg = WriteBarcodeToSVG(CreateBarcodeFromText("hello", BarcodeFormat::QRCode)); A more realistic scenario with an image instead of an SVG string would be: auto cOpts = CreatorOptions(BarcodeFormat::QRCode).ecLevel("M");
auto bcode = CreateBarcodeFromText("hello", cOpts);
auto wOpts = WriterOptions().sizeHint(400).withQuietZones(true).withHRT(true);
auto image = WriteBarcodeToImage(barcode, wOpts);
// write_to_file(image.data(), image.width(), image.height(), image.format()); Looking for feedback... |
Beta Was this translation helpful? Give feedback.
-
Hi @axxel I don't have suggestions or objections whatsoever, just reply to let you know I'm following this :) Though I'd like to kindly request a draft of the API structure in your mind, like what are the fields and values of the r/w Options and Barcode object, what are the names we plan to use, etc. Right now this kind of information is spreaded across several issues and discussions, which takes some time to look forth and behind. It will make it easier for wrapper developers to make an early move and decide how to properly deprecate some properties and refactor their codebases. Please ignore my request if this adds unnecessary burden to you. I appreciate all your work put on this. |
Beta Was this translation helpful? Give feedback.
-
@vkrause you mentioned a while back that there might be some interest from your side to use the writer/creator capabilities of zxing-cpp instead of using separate libraries for individual symbologies. Is that still something of interest? Can you have look at the current API proposal (e.g. see above or here) and tell me if that would fit your bill? Is there something you specifically need or missed with the old writer support? Do you have a use for the |
Beta Was this translation helpful? Give feedback.
-
@axxel using the new API (generating SVG string), if the text passed to |
Beta Was this translation helpful? Give feedback.
-
@axxel i forgot to mention that the new API works great. I tested image generation and svg. I am using svg right now and it is great! |
Beta Was this translation helpful? Give feedback.
-
Given that the "discussion" in #332 is lengthy and mostly outdated and also not in form of a github discussion, I summarize my current state of mind here:
Barcode
class will be the central point of both reading and generating barcodes and can also be written/rendered into an image/svg.zint
c-library is used behind the scenes.zint
API.zint
library, e.g. only the symbologies currently known tozxing-cpp
will be exposed; the segmented ECI block feature will likely not be (maybe later if there is demand); writing directly to png-files will not be, the option to pass non-utf8 text might not be supported, etc.libzint
depending on the tradeoffs of the two solutions.Now is the time to communicate your needs, use cases and wishes with regards to this API. Especially, if it is something that is in conflict with my intentions stated above. The specific "mechanics" of a potential 'fluent interface' API are discussed here.
Beta Was this translation helpful? Give feedback.
All reactions