David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | #ifndef IMAGE_H |
| 7 | #define IMAGE_H |
| 8 | |
| 9 | #include <stddef.h> |
| 10 | #include <stdbool.h> |
| 11 | #include <stdint.h> |
| 12 | #include <png.h> |
| 13 | |
Dominik Behr | 83010f8 | 2016-03-18 18:43:08 -0700 | [diff] [blame] | 14 | #include "fb.h" |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 15 | |
Dominik Behr | 92d9e31 | 2016-05-04 20:10:48 -0700 | [diff] [blame] | 16 | #define HIRES_THRESHOLD_HR 1920 |
Brian Norris | b86eb58 | 2017-12-04 12:31:06 -0800 | [diff] [blame] | 17 | #define HIRES_THRESHOLD_VR 1920 |
Dominik Behr | 92d9e31 | 2016-05-04 20:10:48 -0700 | [diff] [blame] | 18 | #define MAX_SCALE_FACTOR 100 |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 19 | |
| 20 | typedef struct _image_t image_t; |
| 21 | |
| 22 | image_t* image_create(); |
| 23 | void image_set_filename(image_t* image, char* filename); |
Dominik Behr | 46755a4 | 2016-04-21 18:08:33 -0700 | [diff] [blame] | 24 | char* image_get_filename(image_t* image); |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 25 | void image_set_offset(image_t* image, int32_t offset_x, int32_t offset_y); |
| 26 | void image_set_location(image_t* image, uint32_t location_x, uint32_t location_y); |
Dominik Behr | 92d9e31 | 2016-05-04 20:10:48 -0700 | [diff] [blame] | 27 | void image_set_scale(image_t* image, uint32_t scale); |
Stéphane Marchesin | 00ff187 | 2015-12-14 13:40:09 -0800 | [diff] [blame] | 28 | int image_load_image_from_file(image_t* image); |
Dominik Behr | 83010f8 | 2016-03-18 18:43:08 -0700 | [diff] [blame] | 29 | int image_show(image_t* image, fb_t* fb); |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 30 | void image_release(image_t* image); |
| 31 | void image_destroy(image_t* image); |
Brian Norris | b86eb58 | 2017-12-04 12:31:06 -0800 | [diff] [blame] | 32 | int image_is_hires(fb_t* fb); |
Dominik Behr | 92d9e31 | 2016-05-04 20:10:48 -0700 | [diff] [blame] | 33 | int32_t image_get_auto_scale(fb_t* fb); |
David Sodman | 8ef2006 | 2015-01-06 09:23:40 -0800 | [diff] [blame] | 34 | |
| 35 | #endif |