CoreAR icon indicating copy to clipboard operation
CoreAR copied to clipboard

how to change the thickness of BlackFrame

Open Roveeen opened this issue 11 years ago • 1 comments

hello, I want to change the thickness of the blackframe,like the following picture: code01

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.

Roveeen avatar Feb 13 '14 05:02 Roveeen

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.

sonsongithub avatar Feb 13 '14 22:02 sonsongithub