libam7xxx
0.1
Communication library for Actions Micro AM7XXX based USB projectors and DPFs
|
Public libam7xxx API. More...
Go to the source code of this file.
Data Structures | |
struct | am7xxx_device_info |
A struct describing device specific properties. More... | |
Typedefs | |
typedef struct _am7xxx_context | am7xxx_context |
An opaque data type representing a context. | |
typedef struct _am7xxx_device | am7xxx_device |
An opaque data type representing an am7xxx device. | |
Enumerations | |
enum | am7xxx_log_level { AM7XXX_LOG_FATAL = 0, AM7XXX_LOG_ERROR = 1, AM7XXX_LOG_WARNING = 2, AM7XXX_LOG_INFO = 3, AM7XXX_LOG_DEBUG = 4, AM7XXX_LOG_TRACE = 5 } |
The verbosity level of logging messages. More... | |
enum | am7xxx_image_format { AM7XXX_IMAGE_FORMAT_JPEG = 1, AM7XXX_IMAGE_FORMAT_NV12 = 2 } |
The image formats accepted by the device. More... | |
enum | am7xxx_power_mode { AM7XXX_POWER_OFF = 0, AM7XXX_POWER_LOW = 1, AM7XXX_POWER_MIDDLE = 2, AM7XXX_POWER_HIGH = 3, AM7XXX_POWER_TURBO = 4 } |
The device power modes. More... | |
enum | am7xxx_zoom_mode { AM7XXX_ZOOM_ORIGINAL = 0, AM7XXX_ZOOM_H = 1, AM7XXX_ZOOM_H_V = 2, AM7XXX_ZOOM_TEST = 3, AM7XXX_ZOOM_TELE = 4 } |
The display zoom modes. More... | |
Functions | |
int | am7xxx_init (am7xxx_context **ctx) |
Initialize the library context and data structures, and scan for devices. More... | |
void | am7xxx_shutdown (am7xxx_context *ctx) |
Cleanup the library data structures and free the context. More... | |
void | am7xxx_set_log_level (am7xxx_context *ctx, am7xxx_log_level log_level) |
Set verbosity level of log messages. More... | |
int | am7xxx_open_device (am7xxx_context *ctx, am7xxx_device **dev, unsigned int device_index) |
Open an am7xxx_device according to a index. More... | |
int | am7xxx_close_device (am7xxx_device *dev) |
Close an am7xxx_device. More... | |
int | am7xxx_get_device_info (am7xxx_device *dev, am7xxx_device_info *device_info) |
Get info about an am7xxx device. More... | |
int | am7xxx_calc_scaled_image_dimensions (am7xxx_device *dev, unsigned int upscale, unsigned int original_width, unsigned int original_height, unsigned int *scaled_width, unsigned int *scaled_height) |
Calculate the dimensions of an image to be shown on an am7xxx device. More... | |
int | am7xxx_send_image (am7xxx_device *dev, am7xxx_image_format format, unsigned int width, unsigned int height, unsigned char *image, unsigned int image_size) |
Send an image for display on an am7xxx device. More... | |
int | am7xxx_send_image_async (am7xxx_device *dev, am7xxx_image_format format, unsigned int width, unsigned int height, unsigned char *image, unsigned int image_size) |
Queue transfer of an image for display on an am7xxx device and return immediately. More... | |
int | am7xxx_set_power_mode (am7xxx_device *dev, am7xxx_power_mode power) |
Set the power mode of an am7xxx device. More... | |
int | am7xxx_set_zoom_mode (am7xxx_device *dev, am7xxx_zoom_mode zoom) |
Set the zoom mode of an am7xxx device. More... | |
Public libam7xxx API.
Definition in file am7xxx.h.
enum am7xxx_image_format |
The image formats accepted by the device.
Enumerator | |
---|---|
AM7XXX_IMAGE_FORMAT_JPEG | JPEG format. |
AM7XXX_IMAGE_FORMAT_NV12 | Raw YUV in the NV12 variant. |
Definition at line 80 of file am7xxx.h.
enum am7xxx_log_level |
The verbosity level of logging messages.
This can be set with am7xxx_set_log_level() and the level will be used internally by libam7xxx to adjust the granularity of the information exposed to the user about the internal library operations.
Definition at line 68 of file am7xxx.h.
enum am7xxx_power_mode |
The device power modes.
An am7xxx device can operate in several power modes. A certain power mode may have effect on the display brightness or on the device power consumption.
Definition at line 99 of file am7xxx.h.
enum am7xxx_zoom_mode |
The display zoom modes.
An am7xxx device can display images using several zoom modes.
Enumerator | |
---|---|
AM7XXX_ZOOM_ORIGINAL | Original Size, as retrieved via am7xxx_device_info. |
AM7XXX_ZOOM_H | Zoom 1: H Scale (changes aspect ratio). |
AM7XXX_ZOOM_H_V | Zoom 2: H/V Scale (changes aspect ratio). |
AM7XXX_ZOOM_TEST | Zoom test screen, the firmware version is shown as well. |
AM7XXX_ZOOM_TELE | Zoom Tele: available on some PicoPix models. |
Definition at line 122 of file am7xxx.h.
int am7xxx_calc_scaled_image_dimensions | ( | am7xxx_device * | dev, |
unsigned int | upscale, | ||
unsigned int | original_width, | ||
unsigned int | original_height, | ||
unsigned int * | scaled_width, | ||
unsigned int * | scaled_height | ||
) |
Calculate the dimensions of an image to be shown on an am7xxx device.
Before sending images bigger than the device native dimensions the user needs to rescale them, this utility function does the calculation in a way that the original image aspect ratio is preserved.
[in] | dev | A pointer to the structure representing the device to get info of |
[in] | upscale | Whether to calculate scaled dimensions for images smaller than the native dimensions |
[in] | original_width | The width of the original image |
[in] | original_height | The height of the original image |
[out] | scaled_width | The width the rescaled image should have |
[out] | scaled_height | The height the rescaled image should have |
Definition at line 1269 of file am7xxx.c.
int am7xxx_close_device | ( | am7xxx_device * | dev | ) |
Close an am7xxx_device.
Close an am7xxx_device so that it becomes available for some other user/process to open it.
[in] | dev | A pointer to the structure representing the device to close |
Definition at line 1206 of file am7xxx.c.
int am7xxx_get_device_info | ( | am7xxx_device * | dev, |
am7xxx_device_info * | device_info | ||
) |
Get info about an am7xxx device.
Get information about a device, in the form of a am7xxx_device_info structure.
[in] | dev | A pointer to the structure representing the device to get info of |
[out] | device_info | A pointer to the structure where to store the device info (see am7xxx_device_info) |
Definition at line 1221 of file am7xxx.c.
int am7xxx_init | ( | am7xxx_context ** | ctx | ) |
Initialize the library context and data structures, and scan for devices.
[out] | ctx | A pointer to the context the library will be used in. |
Definition at line 1100 of file am7xxx.c.
int am7xxx_open_device | ( | am7xxx_context * | ctx, |
am7xxx_device ** | dev, | ||
unsigned int | device_index | ||
) |
Open an am7xxx_device according to a index.
The semantics of the 'device_index' argument follows the order of the devices as found when scanning the bus at am7xxx_init() time.
[in] | ctx | The context to open the device in |
[out] | dev | A pointer to the structure representing the device to open |
[in] | device_index | The index of the device on the bus |
Definition at line 1168 of file am7xxx.c.
int am7xxx_send_image | ( | am7xxx_device * | dev, |
am7xxx_image_format | format, | ||
unsigned int | width, | ||
unsigned int | height, | ||
unsigned char * | image, | ||
unsigned int | image_size | ||
) |
Send an image for display on an am7xxx device.
This is the function that actually makes the device display something. Static pictures can be sent just once and the device will keep showing them until another image get sent or some command resets or turns off the display.
[in] | dev | A pointer to the structure representing the device to get info of |
[in] | format | The format the image is in (see am7xxx_image_format enum) |
[in] | width | The width of the image |
[in] | height | The height of the image |
[in] | image | A buffer holding data in the format specified by the format parameter |
[in] | image_size | The size in bytes of the image buffer |
int am7xxx_send_image_async | ( | am7xxx_device * | dev, |
am7xxx_image_format | format, | ||
unsigned int | width, | ||
unsigned int | height, | ||
unsigned char * | image, | ||
unsigned int | image_size | ||
) |
Queue transfer of an image for display on an am7xxx device and return immediately.
This is the function that actually makes the device display something. Static pictures can be sent just once and the device will keep showing them until another image get sent or some command resets or turns off the display.
[in] | dev | A pointer to the structure representing the device to get info of |
[in] | format | The format the image is in (see am7xxx_image_format enum) |
[in] | width | The width of the image |
[in] | height | The height of the image |
[in] | image | A buffer holding data in the format specified by the format parameter |
[in] | image_size | The size in bytes of the image buffer |
void am7xxx_set_log_level | ( | am7xxx_context * | ctx, |
am7xxx_log_level | log_level | ||
) |
Set verbosity level of log messages.
[in] | ctx | The context to set the log level for |
[in] | log_level | The verbosity level to use in the context (see am7xxx_log_level) |
int am7xxx_set_power_mode | ( | am7xxx_device * | dev, |
am7xxx_power_mode | power | ||
) |
Set the power mode of an am7xxx device.
[in] | dev | A pointer to the structure representing the device to set power mode to |
[in] | power | The power mode to put the device in (see am7xxx_power_mode enum) |
int am7xxx_set_zoom_mode | ( | am7xxx_device * | dev, |
am7xxx_zoom_mode | zoom | ||
) |
Set the zoom mode of an am7xxx device.
[in] | dev | A pointer to the structure representing the device to set zoom mode to |
[in] | zoom | The zoom mode to put the device in (see am7xxx_zoom_mode enum) |
void am7xxx_shutdown | ( | am7xxx_context * | ctx | ) |
Cleanup the library data structures and free the context.
[in,out] | ctx | The context to free. |
Definition at line 1140 of file am7xxx.c.