Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
7d5863ae
Commit
7d5863ae
authored
Aug 30, 2013
by
Sebastian Ramacher
Browse files
Clean up includes
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
08a87f67
Changes
3
Hide whitespace changes
Inline
Side-by-side
render.c
View file @
7d5863ae
...
...
@@ -3,8 +3,6 @@
#include <math.h>
#include <girara/datastructures.h>
#include <girara/utils.h>
#include <girara/session.h>
#include <girara/settings.h>
#include "glib-compat.h"
#include "render.h"
#include "zathura.h"
...
...
@@ -264,13 +262,11 @@ zathura_renderer_get_recolor_colors(ZathuraRenderer* renderer,
light
->
red
=
priv
->
recolor
.
light_gdk
.
red
;
light
->
blue
=
priv
->
recolor
.
light_gdk
.
blue
;
light
->
green
=
priv
->
recolor
.
light_gdk
.
green
;
color2double
(
light
,
priv
->
recolor
.
light
);
}
if
(
dark
!=
NULL
)
{
dark
->
red
=
priv
->
recolor
.
dark_gdk
.
red
;
dark
->
blue
=
priv
->
recolor
.
dark_gdk
.
blue
;
dark
->
green
=
priv
->
recolor
.
dark_gdk
.
green
;
color2double
(
dark
,
priv
->
recolor
.
dark
);
}
}
...
...
@@ -504,6 +500,12 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer)
const
double
l1
=
(
a
[
0
]
*
rgb1
[
0
]
+
a
[
1
]
*
rgb1
[
1
]
+
a
[
2
]
*
rgb1
[
2
]);
const
double
l2
=
(
a
[
0
]
*
rgb2
[
0
]
+
a
[
1
]
*
rgb2
[
1
]
+
a
[
2
]
*
rgb2
[
2
]);
const
double
rgb_diff
[]
=
{
rgb2
[
0
]
-
rgb1
[
0
],
rgb2
[
1
]
-
rgb1
[
1
],
rgb2
[
2
]
-
rgb1
[
2
]
};
for
(
unsigned
int
y
=
0
;
y
<
page_height
;
y
++
)
{
unsigned
char
*
data
=
image
+
y
*
rowstride
;
...
...
@@ -549,9 +551,9 @@ render(ZathuraRenderRequest* request, ZathuraRenderer* renderer)
}
else
{
/* linear interpolation between dark and light with color ligtness as
* a parameter */
data
[
2
]
=
(
unsigned
char
)
round
(
255
.
*
(
t
*
(
rgb
2
[
0
]
-
rgb1
[
0
]
)
+
rgb1
[
0
]));
data
[
1
]
=
(
unsigned
char
)
round
(
255
.
*
(
t
*
(
rgb
2
[
1
]
-
rgb1
[
1
]
)
+
rgb1
[
1
]));
data
[
0
]
=
(
unsigned
char
)
round
(
255
.
*
(
t
*
(
rgb
2
[
2
]
-
rgb1
[
2
]
)
+
rgb1
[
2
]));
data
[
2
]
=
(
unsigned
char
)
round
(
255
.
*
(
t
*
rgb
_diff
[
0
]
+
rgb1
[
0
]));
data
[
1
]
=
(
unsigned
char
)
round
(
255
.
*
(
t
*
rgb
_diff
[
1
]
+
rgb1
[
1
]));
data
[
0
]
=
(
unsigned
char
)
round
(
255
.
*
(
t
*
rgb
_diff
[
2
]
+
rgb1
[
2
]));
}
}
}
...
...
render.h
View file @
7d5863ae
...
...
@@ -5,6 +5,8 @@
#include <stdbool.h>
#include <stdlib.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <girara/types.h>
#include "types.h"
...
...
zathura.c
View file @
7d5863ae
...
...
@@ -717,6 +717,7 @@ document_open(zathura_t* zathura, const char* path, const char* password,
goto
error_free
;
}
/* set up recolor info in ZathuraRenderer */
char
*
recolor_dark
=
NULL
;
char
*
recolor_light
=
NULL
;
girara_setting_get
(
zathura
->
ui
.
session
,
"recolor-darkcolor"
,
&
recolor_dark
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment