blob: 2dd7b180fc169ff2ad47e5180a60c93066442866 [file] [log] [blame]
David Sodman8ef20062015-01-06 09:23:40 -08001/*
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 Behr83010f82016-03-18 18:43:08 -070014#include "fb.h"
David Sodman8ef20062015-01-06 09:23:40 -080015
Dominik Behr92d9e312016-05-04 20:10:48 -070016#define HIRES_THRESHOLD_HR 1920
Brian Norrisb86eb582017-12-04 12:31:06 -080017#define HIRES_THRESHOLD_VR 1920
Dominik Behr92d9e312016-05-04 20:10:48 -070018#define MAX_SCALE_FACTOR 100
David Sodman8ef20062015-01-06 09:23:40 -080019
20typedef struct _image_t image_t;
21
22image_t* image_create();
23void image_set_filename(image_t* image, char* filename);
Dominik Behr46755a42016-04-21 18:08:33 -070024char* image_get_filename(image_t* image);
David Sodman8ef20062015-01-06 09:23:40 -080025void image_set_offset(image_t* image, int32_t offset_x, int32_t offset_y);
26void image_set_location(image_t* image, uint32_t location_x, uint32_t location_y);
Dominik Behr92d9e312016-05-04 20:10:48 -070027void image_set_scale(image_t* image, uint32_t scale);
Stéphane Marchesin00ff1872015-12-14 13:40:09 -080028int image_load_image_from_file(image_t* image);
Dominik Behr83010f82016-03-18 18:43:08 -070029int image_show(image_t* image, fb_t* fb);
David Sodman8ef20062015-01-06 09:23:40 -080030void image_release(image_t* image);
31void image_destroy(image_t* image);
Brian Norrisb86eb582017-12-04 12:31:06 -080032int image_is_hires(fb_t* fb);
Dominik Behr92d9e312016-05-04 20:10:48 -070033int32_t image_get_auto_scale(fb_t* fb);
David Sodman8ef20062015-01-06 09:23:40 -080034
35#endif