libam7xxx  0.1
Communication library for Actions Micro AM7XXX based USB projectors and DPFs
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Pages
am7xxx.h
Go to the documentation of this file.
1 /* am7xxx - communication with AM7XXX based USB Pico Projectors and DPFs
2  *
3  * Copyright (C) 2012-2014 Antonio Ospite <ao2@ao2.it>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
24 #ifndef __AM7XXX_H
25 #define __AM7XXX_H
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
37 struct _am7xxx_context;
38 typedef struct _am7xxx_context am7xxx_context;
39 
45 struct _am7xxx_device;
46 typedef struct _am7xxx_device am7xxx_device;
47 
56 typedef struct {
57  unsigned int native_width;
58  unsigned int native_height;
60 
68 typedef enum {
76 
80 typedef enum {
84 
99 typedef enum {
106 
122 typedef enum {
129 
137 int am7xxx_init(am7xxx_context **ctx);
138 
145 
158 
175  am7xxx_device **dev,
176  unsigned int device_index);
177 
189 
202  am7xxx_device_info *device_info);
203 
221  unsigned int upscale,
222  unsigned int original_width,
223  unsigned int original_height,
224  unsigned int *scaled_width,
225  unsigned int *scaled_height);
243  am7xxx_image_format format,
244  unsigned int width,
245  unsigned int height,
246  unsigned char *image,
247  unsigned int image_size);
248 
269  am7xxx_image_format format,
270  unsigned int width,
271  unsigned int height,
272  unsigned char *image,
273  unsigned int image_size);
274 
290 
310 
311 #ifdef __cplusplus
312 }
313 #endif
314 
315 #endif /* __AM7XXX_H */
Zoom test screen, the firmware version is shown as well.
Definition: am7xxx.h:126
Zoom 1: H Scale (changes aspect ratio).
Definition: am7xxx.h:124
struct _am7xxx_context am7xxx_context
An opaque data type representing a context.
Definition: am7xxx.h:38
JPEG format.
Definition: am7xxx.h:81
Zoom Tele: available on some PicoPix models.
Definition: am7xxx.h:127
A struct describing device specific properties.
Definition: am7xxx.h:56
int am7xxx_init(am7xxx_context **ctx)
Initialize the library context and data structures, and scan for devices.
Definition: am7xxx.c:1007
Original Size, as retrieved via am7xxx_device_info.
Definition: am7xxx.h:123
Max brightness and power consumption.
Definition: am7xxx.h:104
Middle level of brightness.
Definition: am7xxx.h:102
am7xxx_image_format
The image formats accepted by the device.
Definition: am7xxx.h:80
am7xxx_power_mode
The device power modes.
Definition: am7xxx.h:99
Warnings about conditions worth mentioning to the user.
Definition: am7xxx.h:71
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:1074
Zoom 2: H/V Scale (changes aspect ratio).
Definition: am7xxx.h:125
More brightness, but more power consumption.
Definition: am7xxx.h:103
Error messages, typically they describe API functions failures.
Definition: am7xxx.h:70
int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode power)
Set the power mode of an am7xxx device.
Definition: am7xxx.c:1307
void am7xxx_set_log_level(am7xxx_context *ctx, am7xxx_log_level log_level)
Set verbosity level of log messages.
Definition: am7xxx.c:1069
int am7xxx_get_device_info(am7xxx_device *dev, am7xxx_device_info *device_info)
Get info about an am7xxx device.
Definition: am7xxx.c:1127
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:1173
unsigned int native_width
The device native width.
Definition: am7xxx.h:57
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.
Informations about the device operations.
Definition: am7xxx.h:72
am7xxx_zoom_mode
The display zoom modes.
Definition: am7xxx.h:122
int am7xxx_set_zoom_mode(am7xxx_device *dev, am7xxx_zoom_mode zoom)
Set the zoom mode of an am7xxx device.
Definition: am7xxx.c:1318
Fatal messages, the user application should stop if it gets one of this.
Definition: am7xxx.h:69
Raw YUV in the NV12 variant.
Definition: am7xxx.h:82
Verbose informations about the communication with the hardware.
Definition: am7xxx.h:74
Informations about the library internals.
Definition: am7xxx.h:73
Low power consumption but also low brightness.
Definition: am7xxx.h:101
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.
unsigned int native_height
The device native height.
Definition: am7xxx.h:58
void am7xxx_shutdown(am7xxx_context *ctx)
Cleanup the library data structures and free the context.
Definition: am7xxx.c:1046
am7xxx_log_level
The verbosity level of logging messages.
Definition: am7xxx.h:68
int am7xxx_close_device(am7xxx_device *dev)
Close an am7xxx_device.
Definition: am7xxx.c:1112
struct _am7xxx_device am7xxx_device
An opaque data type representing an am7xxx device.
Definition: am7xxx.h:46
Display is powered off, no image shown.
Definition: am7xxx.h:100