Esempio n. 1
0
void Character::perform_tests(){				//perform all tests
	calc_bit_quads();
	area = calc_area();
	perimeter = calc_perimeter();
	euler = calc_euler_number();
	calc_spatial_moment(); // calcs the horizontal & vertical centroids
	calc_sym();            // calcs horizontal and vertical symmetry
	aspect = calc_aspect_ratio();
}
float thumbnail_get_aspect_ratio(void *handle)
{
    struct video_frame *frame = (struct video_frame *)handle;
    struct stream *stream = &frame->stream;

    calc_aspect_ratio(&frame->displayAspectRatio, stream);

    if( !frame->displayAspectRatio.num || !frame->displayAspectRatio.den)
        return (float)frame->width / frame->height;
    else
        return (float)frame->displayAspectRatio.num / frame->displayAspectRatio.den;
}