Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change the thickness of BlackFrame #9

Open
Roveeen opened this issue Feb 13, 2014 · 1 comment
Open

how to change the thickness of BlackFrame #9

Roveeen opened this issue Feb 13, 2014 · 1 comment

Comments

@Roveeen
Copy link

Roveeen commented Feb 13, 2014

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.

@sonsongithub
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants