Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
rasky
libvncserver
Commits
6273f206
Commit
6273f206
authored
Jan 21, 2005
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented Floyd-Steinberg dither in order to rfbMakeMaskFromAlphaSource
parent
dbc826d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletion
+39
-1
TODO
TODO
+0
-1
cursor.c
libvncserver/cursor.c
+38
-0
rfb.h
rfb/rfb.h
+1
-0
No files found.
TODO
View file @
6273f206
...
@@ -2,7 +2,6 @@ immediate:
...
@@ -2,7 +2,6 @@ immediate:
----------
----------
VisualNaCro testing
VisualNaCro testing
rfbMakeMaskFromAlphaSource
test IRIX -overlay (x11vnc)
test IRIX -overlay (x11vnc)
java vncviewer doesn't do colour cursors?
java vncviewer doesn't do colour cursors?
MinGW32 doesn't do fcntl on sockets; use setsockopt instead...
MinGW32 doesn't do fcntl on sockets; use setsockopt instead...
...
...
libvncserver/cursor.c
View file @
6273f206
...
@@ -306,6 +306,44 @@ char* rfbMakeMaskForXCursor(int width,int height,char* source)
...
@@ -306,6 +306,44 @@ char* rfbMakeMaskForXCursor(int width,int height,char* source)
return
(
mask
);
return
(
mask
);
}
}
/* this function dithers the alpha using Floyd-Steinberg */
char
*
rfbMakeMaskFromAlphaSource
(
int
width
,
int
height
,
unsigned
char
*
alphaSource
)
{
int
*
error
=
(
int
*
)
calloc
(
sizeof
(
int
),
width
);
int
i
,
j
,
currentError
=
0
,
maskStride
=
(
width
+
7
)
/
8
;
unsigned
char
*
result
=
(
unsigned
char
*
)
calloc
(
maskStride
,
height
);
for
(
j
=
0
;
j
<
height
;
j
++
)
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
right
,
middle
,
left
;
currentError
+=
alphaSource
[
i
+
width
*
j
]
+
error
[
i
];
if
(
currentError
<
0x80
)
{
/* set to transparent */
/* alpha was treated as 0 */
}
else
{
/* set to solid */
result
[
i
/
8
+
j
*
maskStride
]
|=
(
0x100
>>
(
i
&
7
));
/* alpha was treated as 0xff */
currentError
-=
0xff
;
}
/* propagate to next row */
right
=
currentError
/
16
;
middle
=
currentError
*
5
/
16
;
left
=
currentError
*
3
/
16
;
currentError
-=
right
+
middle
+
left
;
error
[
i
]
=
right
;
if
(
i
>
0
)
{
error
[
i
-
1
]
=
middle
;
if
(
i
>
1
)
error
[
i
-
2
]
=
left
;
}
}
free
(
error
);
return
result
;
}
void
rfbFreeCursor
(
rfbCursorPtr
cursor
)
void
rfbFreeCursor
(
rfbCursorPtr
cursor
)
{
{
if
(
cursor
)
{
if
(
cursor
)
{
...
...
rfb/rfb.h
View file @
6273f206
...
@@ -639,6 +639,7 @@ extern rfbBool rfbSendCursorPos(rfbClientPtr cl);
...
@@ -639,6 +639,7 @@ extern rfbBool rfbSendCursorPos(rfbClientPtr cl);
extern
void
rfbConvertLSBCursorBitmapOrMask
(
int
width
,
int
height
,
unsigned
char
*
bitmap
);
extern
void
rfbConvertLSBCursorBitmapOrMask
(
int
width
,
int
height
,
unsigned
char
*
bitmap
);
extern
rfbCursorPtr
rfbMakeXCursor
(
int
width
,
int
height
,
char
*
cursorString
,
char
*
maskString
);
extern
rfbCursorPtr
rfbMakeXCursor
(
int
width
,
int
height
,
char
*
cursorString
,
char
*
maskString
);
extern
char
*
rfbMakeMaskForXCursor
(
int
width
,
int
height
,
char
*
cursorString
);
extern
char
*
rfbMakeMaskForXCursor
(
int
width
,
int
height
,
char
*
cursorString
);
extern
char
*
rfbMakeMaskFromAlphaSource
(
int
width
,
int
height
,
unsigned
char
*
alphaSource
);
extern
void
rfbMakeXCursorFromRichCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
rfbMakeXCursorFromRichCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
rfbMakeRichCursorFromXCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
rfbMakeRichCursorFromXCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
rfbFreeCursor
(
rfbCursorPtr
cursor
);
extern
void
rfbFreeCursor
(
rfbCursorPtr
cursor
);
...
...
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