| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
Classes | Macros | Functions
videoAspectRatio.c File Reference
`#include <ARX/ARVideo/video.h>`
`#include <stdio.h>`
`#include <string.h>`
Include dependency graph for videoAspectRatio.c:

## Classes
struct | _ASPECT_RATIOS_ENTRY

## Macros
#define | _GNU_SOURCE
#define | _ASPECT_RATIOS_COUNT (sizeof(aspectRatios)/sizeof(aspectRatios[0]))
#define | PRIMES_COUNT (sizeof(primes)/sizeof(primes[0]))

## Functions
AR_VIDEO_ASPECT_RATIO | arVideoUtilFindAspectRatio (int w, int h)
| Determine the approximate aspect ratio for a given image resolution.
char * | arVideoUtilFindAspectRatioName (int w, int h)
| Determine the approximate aspect ratio for a given image resolution.

## Macro Definition Documentation

## ◆ _ASPECT_RATIOS_COUNT

#define _ASPECT_RATIOS_COUNT (sizeof(aspectRatios)/sizeof(aspectRatios[0]))

## ◆ _GNU_SOURCE

#define _GNU_SOURCE

## ◆ PRIMES_COUNT [1/2]

#define PRIMES_COUNT (sizeof(primes)/sizeof(primes[0]))

## ◆ PRIMES_COUNT [2/2]

#define PRIMES_COUNT (sizeof(primes)/sizeof(primes[0]))

## Function Documentation

## ◆ arVideoUtilFindAspectRatio()

AR_VIDEO_ASPECT_RATIO arVideoUtilFindAspectRatio | ( | int | w,
|  | int | h
| ) |  |

Determine the approximate aspect ratio for a given image resolution.

A convenience method which makes it easy to determine the approximate aspect ratio of an image with the given resolution (expressed in pixel width and height). Returns a symbolic constant for the aspect ratio, which makes it easy to determine whether two different resolutions have the same aspect ratio. Assumes square pixels.

Parameters

  w | Width in pixels
  h | Height in pixels

Returns
  If a matching commonly-used aspect ratio can be found, returns symbolic constant for that aspect ratio.

## ◆ arVideoUtilFindAspectRatioName()

char * arVideoUtilFindAspectRatioName | ( | int | w,
|  | int | h
| ) |  |

Determine the approximate aspect ratio for a given image resolution.

A convenience method which makes it easy to determine the approximate aspect ratio of an image with the given resolution (expressed in pixel width and height). Returns a string for the aspect ratio. Assumes square pixels.

Parameters

  w | Width in pixels
  h | Height in pixels

Returns
  If a matching commonly-used aspect ratio can be found, returns string name for that aspect ratio. This string must be free'd when finished with.