Ansel
0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
ansel-cltest/main.c
Go to the documentation of this file.
1
/*
2
This file is part of darktable,
3
Copyright (C) 2009-2011 johannes hanika.
4
Copyright (C) 2012 Richard Wonka.
5
Copyright (C) 2014 Jérémy Rosen.
6
Copyright (C) 2014-2017 Tobias Ellinghaus.
7
Copyright (C) 2015 Roman Lebedev.
8
Copyright (C) 2016, 2019 parafin.
9
Copyright (C) 2020 Hubert Kowalski.
10
Copyright (C) 2020 Pascal Obry.
11
Copyright (C) 2022 Martin Bařinka.
12
13
darktable is free software: you can redistribute it and/or modify
14
it under the terms of the GNU General Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
darktable is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
GNU General Public License for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with darktable. If not, see <http://www.gnu.org/licenses/>.
25
*/
26
27
#include "
darktable.h
"
28
#include "
common/opencl.h
"
29
#include "
system/macros.h
"
30
#include "
system/mem_alloc.h
"
31
32
#ifdef __APPLE__
33
#include "
osx/osx.h
"
34
#endif
35
36
#ifdef _WIN32
37
#include <conio.h>
38
#include "
win/main_wrapper.h
"
39
#endif
40
41
int
main
(
int
argc
,
char
*
arg
[])
42
{
43
#ifdef __APPLE__
44
dt_osx_prepare_environment
();
45
#endif
46
int
result = 1;
47
// only used to force-init opencl, so we want these options:
48
char
*
m_arg
[] = {
"-d"
,
"opencl"
,
"--library"
,
":memory:"
};
49
const
int
m_argc
=
sizeof
(
m_arg
) /
sizeof
(
m_arg
[0]);
50
char
**argv =
malloc
(
sizeof
(
arg
[0]) *
argc
+
sizeof
(
m_arg
));
51
if
(
IS_NULL_PTR
(argv))
goto
end;
52
for
(
int
i
= 0;
i
<
argc
;
i
++)
53
argv[
i
] =
arg
[
i
];
54
for
(
int
i
= 0;
i
<
m_argc
;
i
++)
55
argv[
argc
+
i
] =
m_arg
[
i
];
56
argc
+=
m_argc
;
57
if
(
dt_init
(
argc
, argv,
FALSE
,
FALSE
))
goto
end;
58
dt_cleanup
();
59
dt_free
(argv);
60
61
result = 0;
62
end:
63
64
#ifdef _WIN32
65
printf
(
"\npress any key to exit\n"
);
66
FlushConsoleInputBuffer
(
GetStdHandle
(
STD_INPUT_HANDLE
));
67
getch
();
68
#endif
69
70
exit(result);
71
}
72
73
// clang-format off
74
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
75
// vim: shiftwidth=2 expandtab tabstop=2 cindent
76
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
77
// clang-format on
78
FALSE
#define FALSE
Definition
ashift_lsd.c:158
i
const float i
Definition
colorspaces_inline_conversions.h:441
L
const float L
Definition
colorspaces_inline_conversions.h:494
dt_cleanup
void dt_cleanup()
Definition
darktable.c:1840
dt_init
int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load_data)
Definition
darktable.c:878
darktable.h
macros.h
IS_NULL_PTR
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Definition
macros.h:65
main_wrapper.h
mem_alloc.h
dt_free
#define dt_free(ptr)
Definition
mem_alloc.h:97
opencl.h
osx.h
dt_osx_prepare_environment
void dt_osx_prepare_environment()
Definition
osx.mm:213
main
int main()
Definition
prova.c:47
src
apps
ansel-cltest
main.c
Generated by
1.9.8