MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / main

Function main

external/astc-encoder/Utils/astc_blend_test.cpp:64–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64int main(int argc, char **argv)
65{
66 // Parse command line
67 if (argc != 6)
68 {
69 printf("Usage: astc_blend_test <source> <dest> <format> <blend_mode> <filter>\n");
70 exit(1);
71 }
72
73 const char* src_file = argv[1];
74 const char* dst_file = argv[2];
75
76 bool use_linear = false;
77 if (!strcmp(argv[3], "linear"))
78 {
79 use_linear = true;
80 }
81 else if (!strcmp(argv[3], "srgb"))
82 {
83 use_linear = false;
84 }
85 else
86 {
87 printf("<format> must be either 'linear' or 'srgb'\n");
88 exit(1);
89 }
90
91 bool use_post_blend = false;
92 if (!strcmp(argv[4], "post"))
93 {
94 use_post_blend = true;
95 }
96 else if (!strcmp(argv[4], "pre"))
97 {
98 use_post_blend = false;
99 }
100 else
101 {
102 printf("<blend_mode> must be either 'post' or 'pre'\n");
103 exit(1);
104 }
105
106 bool use_filter = false;
107 if (!strcmp(argv[5], "on"))
108 {
109 use_filter = true;
110 }
111 else if (!strcmp(argv[5], "off"))
112 {
113 use_filter = false;
114 }
115 else
116 {
117 printf("<filter> must be either 'on' or 'off'\n");
118 exit(1);
119 }
120
121 // Load the input image

Callers

nothing calls this directly

Calls 6

printfFunction · 0.85
stbi_loadFunction · 0.85
stbi_write_pngFunction · 0.85
srgb_to_linearFunction · 0.70
linear_to_srgbFunction · 0.70
minFunction · 0.50

Tested by

no test coverage detected