1 /* Copyright (C) 2010-2020 The RetroArch team
3 * ---------------------------------------------------------------------------------------
4 * The following license statement only applies to this file (scaler.h).
5 * ---------------------------------------------------------------------------------------
7 * Permission is hereby granted, free of charge,
8 * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef __LIBRETRO_SDK_SCALER_H__
24 #define __LIBRETRO_SDK_SCALER_H__
31 #include <retro_common_api.h>
37 SCALER_FMT_ARGB8888 = 0,
48 SCALER_TYPE_UNKNOWN = 0,
64 void (*scaler_horiz)(const struct scaler_ctx*,
66 void (*scaler_vert)(const struct scaler_ctx*,
68 void (*scaler_special)(const struct scaler_ctx*,
69 void*, const void*, int, int, int, int, int, int);
71 void (*in_pixconv)(void*, const void*, int, int, int, int);
72 void (*out_pixconv)(void*, const void*, int, int, int, int);
73 void (*direct_pixconv)(void*, const void*, int, int, int, int);
74 struct scaler_filter horiz, vert; /* ptr alignment */
104 enum scaler_pix_fmt in_fmt;
105 enum scaler_pix_fmt out_fmt;
106 enum scaler_type scaler_type;
111 bool scaler_ctx_gen_filter(struct scaler_ctx *ctx);
113 void scaler_ctx_gen_reset(struct scaler_ctx *ctx);
117 * @ctx : pointer to scaler context object.
118 * @output : pointer to output image.
119 * @input : pointer to input image.
121 * Scales an input image to an output image.
123 void scaler_ctx_scale(struct scaler_ctx *ctx,
124 void *output, const void *input);