CoreAR
CoreAR copied to clipboard
how to change the thickness of BlackFrame
hello, I want to change the thickness of the blackframe,like the following picture:

it's 1/10 of the width (default is 1/4 ).
i cannot really understand CoreAR lib, I had do something like : in "codeImageTemplate.c"
CRCodeImageTemplate *CRCreateCodeImageTemplate(unsigned char *pixel, int width, int height) {
CRCodeImageTemplate *p = (CRCodeImageTemplate*)malloc(sizeof(CRCodeImageTemplate));
float offsetX = width *1/ 10;
float offsetY = height *1/ 10;
int decodePixelBuff = CRGetDecodePixelBuffWidthHeight();
float samplingWidth = (float)width *8/ 10 / (decodePixelBuff);
float samplingHeight = (float)height*8/ 10 / (decodePixelBuff);
....
original:
CRCodeImageTemplate *CRCreateCodeImageTemplate(unsigned char *pixel, int width, int height) {
CRCodeImageTemplate *p = (CRCodeImageTemplate*)malloc(sizeof(CRCodeImageTemplate));
float offsetX = width *1/ 4;
float offsetY = height *1/ 4;
int decodePixelBuff = CRGetDecodePixelBuffWidthHeight();
float samplingWidth = (float)width *1/ 2 / (decodePixelBuff);
float samplingHeight = (float)height*1/ 2 / (decodePixelBuff);
....
but it does not work.
can you tell me , how to do?
I'm very grateful.
Uu.. I think that your code is almost OK. But I don't know what kind of error is happened on your code. I recommend you should write down raw "decodePixelBuff" value as bitmap file.