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

Several small improvements #3

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
24 changes: 23 additions & 1 deletion lens_shading_analyse.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int main(int argc, char *argv[])
int width, height, stride;
int grid_width, grid_height;
int single_channel_width, single_channel_height;
unsigned int black_level = 16;
unsigned int black_level = 0;

if (argc < 2)
{
Expand Down Expand Up @@ -194,6 +194,28 @@ int main(int argc, char *argv[])
goto unmap;
}

char model[ 7 ];
memcpy( model, &in_buf[ 16 ], 6 );
model[ 6 ] = '\0';
if (strncmp(model, "imx219", 6) == 0)
{
printf("Sensor type: %s\n", model);
if (black_level == 0)
{
black_level = 66;
}
} else if (strncmp(model, "ov5647", 6) == 0)
{
printf("Sensor type: %s\n", model);
if (black_level == 0)
{
black_level = 16;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

}
} else if (black_level == 0 ){
black_level = 16; // Default value
}
printf( "Black level: %d\n", black_level );

hdr = (struct brcm_raw_header*) (in_buf+0xB0);
printf("Header decoding: mode %s, width %u, height %u, padding %u %u\n",
hdr->name, hdr->width, hdr->height, hdr->padding_right, hdr->padding_down);
Expand Down