Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
fc7cb865
Commit
fc7cb865
authored
Jul 25, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Sep 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pixels.c: scope improvements
parent
f8a1f79b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
21 deletions
+9
-21
Pixels.c
nx-X11/programs/Xserver/hw/nxagent/Pixels.c
+9
-21
No files found.
nx-X11/programs/Xserver/hw/nxagent/Pixels.c
View file @
fc7cb865
...
...
@@ -63,10 +63,6 @@ int nxagentUniquePixels(XImage *image)
int
elements
=
PIXEL_ELEMENTS
;
int
unique
=
0
;
int
total
;
int
ratio
;
int
step
;
int
last
=
-
1
;
const
char
*
next
=
image
->
data
;
...
...
@@ -80,9 +76,9 @@ int nxagentUniquePixels(XImage *image)
* Take at most 256 pixels from the image.
*/
total
=
image
->
width
*
image
->
height
;
int
total
=
image
->
width
*
image
->
height
;
step
=
total
/
elements
;
int
step
=
total
/
elements
;
if
(
step
<
PIXEL_STEP
)
{
...
...
@@ -231,7 +227,7 @@ int nxagentUniquePixels(XImage *image)
#endif
}
ratio
=
unique
*
100
/
elements
;
int
ratio
=
unique
*
100
/
elements
;
#ifdef TEST
fprintf
(
stderr
,
"nxagentUniquePixels: Found [%d] unique pixels out of [%d] with ratio [%d%%].
\n
"
,
...
...
@@ -267,13 +263,11 @@ unsigned int Get16(const char *buffer, int order)
unsigned
int
Get24
(
const
char
*
buffer
,
int
order
)
{
int
i
;
const
char
*
next
=
(
order
==
MSBFirst
?
buffer
:
buffer
+
2
);
unsigned
int
result
=
0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
3
;
i
++
)
{
result
<<=
8
;
...
...
@@ -294,13 +288,11 @@ unsigned int Get24(const char *buffer, int order)
unsigned
int
Get32
(
const
char
*
buffer
,
int
order
)
{
int
i
;
const
char
*
next
=
(
order
==
MSBFirst
?
buffer
:
buffer
+
3
);
unsigned
int
result
=
0
;
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
4
;
i
++
)
{
result
<<=
8
;
...
...
@@ -341,13 +333,11 @@ void Put16(unsigned int value, char *buffer, int order)
void
Put24
(
unsigned
int
value
,
char
*
buffer
,
int
order
)
{
int
i
;
if
(
order
==
MSBFirst
)
{
buffer
+=
2
;
for
(
i
=
3
;
i
>
0
;
i
--
)
for
(
i
nt
i
=
3
;
i
>
0
;
i
--
)
{
*
buffer
--
=
(
unsigned
char
)
(
value
&
0xff
);
...
...
@@ -356,7 +346,7 @@ void Put24(unsigned int value, char *buffer, int order)
}
else
{
for
(
i
=
3
;
i
>
0
;
i
--
)
for
(
i
nt
i
=
3
;
i
>
0
;
i
--
)
{
*
buffer
++
=
(
unsigned
char
)
(
value
&
0xff
);
...
...
@@ -367,13 +357,11 @@ void Put24(unsigned int value, char *buffer, int order)
void
Put32
(
unsigned
int
value
,
char
*
buffer
,
int
order
)
{
int
i
;
if
(
order
==
MSBFirst
)
{
buffer
+=
3
;
for
(
i
=
4
;
i
>
0
;
i
--
)
for
(
i
nt
i
=
4
;
i
>
0
;
i
--
)
{
*
buffer
--
=
(
unsigned
char
)
(
value
&
0xff
);
...
...
@@ -382,7 +370,7 @@ void Put32(unsigned int value, char *buffer, int order)
}
else
{
for
(
i
=
4
;
i
>
0
;
i
--
)
for
(
i
nt
i
=
4
;
i
>
0
;
i
--
)
{
*
buffer
++
=
(
unsigned
char
)
(
value
&
0xff
);
...
...
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