RetroArch
scaler.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (scaler.h).
5  * ---------------------------------------------------------------------------------------
6  *
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:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
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.
21  */
22 
23 #ifndef __LIBRETRO_SDK_SCALER_H__
24 #define __LIBRETRO_SDK_SCALER_H__
25 
26 #include <stdint.h>
27 #include <stddef.h>
28 #include <boolean.h>
29 #include <clamping.h>
30 
31 #include <retro_common_api.h>
32 
34 
36 {
44 };
45 
47 {
52 };
53 
55 {
59  int *filter_pos;
60 };
61 
62 struct scaler_ctx
63 {
64  int in_width;
65  int in_height;
66  int in_stride;
67 
68  int out_width;
71 
75 
76  void (*scaler_horiz)(const struct scaler_ctx*,
77  const void*, int);
78  void (*scaler_vert)(const struct scaler_ctx*,
79  void*, int);
80  void (*scaler_special)(const struct scaler_ctx*,
81  void*, const void*, int, int, int, int, int, int);
82 
83  void (*in_pixconv)(void*, const void*, int, int, int, int);
84  void (*out_pixconv)(void*, const void*, int, int, int, int);
85  void (*direct_pixconv)(void*, const void*, int, int, int, int);
86 
87  bool unscaled;
88  struct scaler_filter horiz, vert;
89 
90  struct
91  {
93  int stride;
94  } input;
95 
96  struct
97  {
99  int width;
100  int height;
101  int stride;
102  } scaled;
103 
104  struct
105  {
106  uint32_t *frame;
107  int stride;
108  } output;
109 };
110 
111 bool scaler_ctx_gen_filter(struct scaler_ctx *ctx);
112 
113 void scaler_ctx_gen_reset(struct scaler_ctx *ctx);
114 
123 void scaler_ctx_scale(struct scaler_ctx *ctx,
124  void *output, const void *input);
125 
127 
128 #endif
129 
void(* out_pixconv)(void *, const void *, int, int, int, int)
Definition: scaler.h:84
int width
Definition: scaler.h:99
void(* scaler_horiz)(const struct scaler_ctx *, const void *, int)
Definition: scaler.h:76
int filter_len
Definition: scaler.h:57
struct scaler_filter horiz vert
Definition: scaler.h:88
enum scaler_pix_fmt out_fmt
Definition: scaler.h:73
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
int stride
Definition: scaler.h:93
int out_stride
Definition: scaler.h:70
int out_width
Definition: scaler.h:68
void(* scaler_special)(const struct scaler_ctx *, void *, const void *, int, int, int, int, int, int)
Definition: scaler.h:80
int filter_stride
Definition: scaler.h:58
void scaler_ctx_gen_reset(struct scaler_ctx *ctx)
Definition: scaler.c:260
void(* in_pixconv)(void *, const void *, int, int, int, int)
Definition: scaler.h:83
int in_height
Definition: scaler.h:65
Definition: scaler.h:38
int height
Definition: scaler.h:100
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
GLenum GLenum GLenum input
Definition: glext.h:9938
bool unscaled
Definition: scaler.h:87
bool scaler_ctx_gen_filter(struct scaler_ctx *ctx)
Definition: scaler.c:77
Definition: scaler.h:62
struct scaler_ctx::@774 input
Definition: scaler.h:37
scaler_type
Definition: scaler.h:46
int in_stride
Definition: scaler.h:66
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
Definition: scaler.h:54
int * filter_pos
Definition: scaler.h:59
int out_height
Definition: scaler.h:69
signed short int16_t
Definition: stdint.h:122
enum scaler_type scaler_type
Definition: scaler.h:74
Definition: scaler.h:50
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
void(* direct_pixconv)(void *, const void *, int, int, int, int)
Definition: scaler.h:85
Definition: scaler.h:39
int in_width
Definition: scaler.h:64
std::string output
Definition: Config.FromFile.cpp:44
uint64_t * frame
Definition: scaler.h:98
Definition: scaler.h:48
Definition: scaler.h:41
scaler_pix_fmt
Definition: scaler.h:35
Definition: scaler.h:51
Definition: scaler.h:49
Definition: scaler.h:42
void scaler_ctx_scale(struct scaler_ctx *ctx, void *output, const void *input)
Definition: scaler.c:307
Definition: scaler.h:40
enum scaler_pix_fmt in_fmt
Definition: scaler.h:72
struct scaler_ctx::@776 output
unsigned __int64 uint64_t
Definition: stdint.h:136
unsigned int uint32_t
Definition: stdint.h:126
void(* scaler_vert)(const struct scaler_ctx *, void *, int)
Definition: scaler.h:78
struct scaler_ctx::@775 scaled
int16_t * filter
Definition: scaler.h:56
Definition: scaler.h:43
uint32_t * frame
Definition: scaler.h:92