Loading...
Searching...
No Matches
am7xxx.h
Go to the documentation of this file.
/* am7xxx - communication with AM7XXX based USB Pico Projectors and DPFs
*
* Copyright (C) 2012-2014 Antonio Ospite <ao2@ao2.it>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AM7XXX_H
#define __AM7XXX_H
#ifdef __cplusplus
extern "C" {
#endif
struct _am7xxx_context;
typedef struct _am7xxx_context am7xxx_context;
struct _am7xxx_device;
typedef struct _am7xxx_device am7xxx_device;
typedef struct {
unsigned int native_width;
unsigned int native_height;
} am7xxx_device_info;
typedef enum {
AM7XXX_LOG_FATAL = 0,
AM7XXX_LOG_ERROR = 1,
AM7XXX_LOG_WARNING = 2,
AM7XXX_LOG_INFO = 3,
AM7XXX_LOG_DEBUG = 4,
AM7XXX_LOG_TRACE = 5,
} am7xxx_log_level;
typedef enum {
AM7XXX_IMAGE_FORMAT_JPEG = 1,
AM7XXX_IMAGE_FORMAT_NV12 = 2,
} am7xxx_image_format;
typedef enum {
AM7XXX_POWER_OFF = 0,
AM7XXX_POWER_LOW = 1,
AM7XXX_POWER_MIDDLE = 2,
AM7XXX_POWER_HIGH = 3,
AM7XXX_POWER_TURBO = 4,
} am7xxx_power_mode;
typedef enum {
AM7XXX_ZOOM_ORIGINAL = 0,
AM7XXX_ZOOM_H = 1,
AM7XXX_ZOOM_H_V = 2,
AM7XXX_ZOOM_TEST = 3,
AM7XXX_ZOOM_TELE = 4,
} am7xxx_zoom_mode;
int am7xxx_init(am7xxx_context **ctx);
void am7xxx_shutdown(am7xxx_context *ctx);
void am7xxx_set_log_level(am7xxx_context *ctx, am7xxx_log_level log_level);
int am7xxx_open_device(am7xxx_context *ctx,
am7xxx_device **dev,
unsigned int device_index);
int am7xxx_close_device(am7xxx_device *dev);
int am7xxx_get_device_info(am7xxx_device *dev,
am7xxx_device_info *device_info);
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);
int am7xxx_send_image(am7xxx_device *dev,
am7xxx_image_format format,
unsigned int width,
unsigned int height,
unsigned char *image,
unsigned int image_size);
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);
int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode power);
int am7xxx_set_zoom_mode(am7xxx_device *dev, am7xxx_zoom_mode zoom);
#ifdef __cplusplus
}
#endif
#endif /* __AM7XXX_H */
am7xxx_zoom_mode
am7xxx_zoom_mode
The display zoom modes.
Definition am7xxx.h:122
AM7XXX_ZOOM_H
@ AM7XXX_ZOOM_H
Zoom 1: H Scale (changes aspect ratio).
Definition am7xxx.h:124
AM7XXX_ZOOM_ORIGINAL
@ AM7XXX_ZOOM_ORIGINAL
Original Size, as retrieved via am7xxx_device_info.
Definition am7xxx.h:123
AM7XXX_ZOOM_TELE
@ AM7XXX_ZOOM_TELE
Zoom Tele: available on some PicoPix models.
Definition am7xxx.h:127
AM7XXX_ZOOM_TEST
@ AM7XXX_ZOOM_TEST
Zoom test screen, the firmware version is shown as well.
Definition am7xxx.h:126
AM7XXX_ZOOM_H_V
@ AM7XXX_ZOOM_H_V
Zoom 2: H/V Scale (changes aspect ratio).
Definition am7xxx.h:125
am7xxx_log_level
am7xxx_log_level
The verbosity level of logging messages.
Definition am7xxx.h:68
AM7XXX_LOG_ERROR
@ AM7XXX_LOG_ERROR
Error messages, typically they describe API functions failures.
Definition am7xxx.h:70
AM7XXX_LOG_INFO
@ AM7XXX_LOG_INFO
Informations about the device operations.
Definition am7xxx.h:72
AM7XXX_LOG_DEBUG
@ AM7XXX_LOG_DEBUG
Informations about the library internals.
Definition am7xxx.h:73
AM7XXX_LOG_WARNING
@ AM7XXX_LOG_WARNING
Warnings about conditions worth mentioning to the user.
Definition am7xxx.h:71
AM7XXX_LOG_FATAL
@ AM7XXX_LOG_FATAL
Fatal messages, the user application should stop if it gets one of this.
Definition am7xxx.h:69
AM7XXX_LOG_TRACE
@ AM7XXX_LOG_TRACE
Verbose informations about the communication with the hardware.
Definition am7xxx.h:74
am7xxx_calc_scaled_image_dimensions
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.
Definition am7xxx.c:1269
am7xxx_power_mode
am7xxx_power_mode
The device power modes.
Definition am7xxx.h:99
AM7XXX_POWER_HIGH
@ AM7XXX_POWER_HIGH
More brightness, but more power consumption.
Definition am7xxx.h:103
AM7XXX_POWER_OFF
@ AM7XXX_POWER_OFF
Display is powered off, no image shown.
Definition am7xxx.h:100
AM7XXX_POWER_TURBO
@ AM7XXX_POWER_TURBO
Max brightness and power consumption.
Definition am7xxx.h:104
AM7XXX_POWER_LOW
@ AM7XXX_POWER_LOW
Low power consumption but also low brightness.
Definition am7xxx.h:101
AM7XXX_POWER_MIDDLE
@ AM7XXX_POWER_MIDDLE
Middle level of brightness.
Definition am7xxx.h:102
am7xxx_get_device_info
int am7xxx_get_device_info(am7xxx_device *dev, am7xxx_device_info *device_info)
Get info about an am7xxx device.
Definition am7xxx.c:1221
am7xxx_send_image_async
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.
am7xxx_image_format
am7xxx_image_format
The image formats accepted by the device.
Definition am7xxx.h:80
AM7XXX_IMAGE_FORMAT_JPEG
@ AM7XXX_IMAGE_FORMAT_JPEG
JPEG format.
Definition am7xxx.h:81
AM7XXX_IMAGE_FORMAT_NV12
@ AM7XXX_IMAGE_FORMAT_NV12
Raw YUV in the NV12 variant.
Definition am7xxx.h:82
am7xxx_context
struct _am7xxx_context am7xxx_context
An opaque data type representing a context.
Definition am7xxx.h:38
am7xxx_shutdown
void am7xxx_shutdown(am7xxx_context *ctx)
Cleanup the library data structures and free the context.
Definition am7xxx.c:1140
am7xxx_set_log_level
void am7xxx_set_log_level(am7xxx_context *ctx, am7xxx_log_level log_level)
Set verbosity level of log messages.
Definition am7xxx.c:1163
am7xxx_set_power_mode
int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode power)
Set the power mode of an am7xxx device.
Definition am7xxx.c:1402
am7xxx_close_device
int am7xxx_close_device(am7xxx_device *dev)
Close an am7xxx_device.
Definition am7xxx.c:1206
am7xxx_set_zoom_mode
int am7xxx_set_zoom_mode(am7xxx_device *dev, am7xxx_zoom_mode zoom)
Set the zoom mode of an am7xxx device.
Definition am7xxx.c:1413
am7xxx_init
int am7xxx_init(am7xxx_context **ctx)
Initialize the library context and data structures, and scan for devices.
Definition am7xxx.c:1100
am7xxx_device
struct _am7xxx_device am7xxx_device
An opaque data type representing an am7xxx device.
Definition am7xxx.h:46
am7xxx_send_image
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.
am7xxx_open_device
int am7xxx_open_device(am7xxx_context *ctx, am7xxx_device **dev, unsigned int device_index)
Open an am7xxx_device according to a index.
Definition am7xxx.c:1168
am7xxx_device_info
A struct describing device specific properties.
Definition am7xxx.h:56
am7xxx_device_info::native_height
unsigned int native_height
The device native height.
Definition am7xxx.h:58
am7xxx_device_info::native_width
unsigned int native_width
The device native width.
Definition am7xxx.h:57