Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
IceT
IceT
Commits
8f744038
Commit
8f744038
authored
May 13, 2011
by
Kenneth Moreland
Browse files
Added icetClearImageTrueBackground.
Use it to correct some background correction problems with blank tiles.
parent
83288578
Changes
7
Hide whitespace changes
Inline
Side-by-side
Changes.txt
View file @
8f744038
...
...
@@ -112,5 +112,6 @@ not done automatically. icetSingleImageCollect does it for you, though.
Added internal state variables ICET_NEED_BACKGROUND_CORRECTION,
ICET_TRUE_BACKGROUND_COLOR, and ICET_TRUE_BACKGROUND_COLOR_WORD.
icetImageCorrectBackground, icetDecompressImageCorrectBackground, and
icetImageCorrectBackground, icetClearImageTrueBackground,
icetDecompressImageCorrectBackground, and
icetDecompressSubImageCorrectBackground functions.
src/ice-t/image.c
View file @
8f744038
...
...
@@ -2275,6 +2275,28 @@ void icetImageCorrectBackground(IceTImage image)
icetTimingBlendEnd
();
}
void
icetClearImageTrueBackground
(
IceTImage
image
)
{
IceTFloat
true_background
[
4
];
IceTInt
true_background_word
;
IceTFloat
original_background
[
4
];
IceTInt
original_background_word
;
icetGetFloatv
(
ICET_TRUE_BACKGROUND_COLOR
,
true_background
);
icetGetIntegerv
(
ICET_TRUE_BACKGROUND_COLOR_WORD
,
&
true_background_word
);
icetGetFloatv
(
ICET_BACKGROUND_COLOR
,
original_background
);
icetGetIntegerv
(
ICET_BACKGROUND_COLOR_WORD
,
&
original_background_word
);
icetStateSetFloatv
(
ICET_BACKGROUND_COLOR
,
4
,
true_background
);
icetStateSetInteger
(
ICET_BACKGROUND_COLOR_WORD
,
true_background_word
);
icetClearImage
(
image
);
icetStateSetFloatv
(
ICET_BACKGROUND_COLOR
,
4
,
original_background
);
icetStateSetInteger
(
ICET_BACKGROUND_COLOR_WORD
,
original_background_word
);
}
static
IceTImage
renderTile
(
int
tile
,
IceTInt
*
screen_viewport
,
IceTInt
*
target_viewport
,
...
...
src/include/IceTDevImage.h
View file @
8f744038
...
...
@@ -181,6 +181,7 @@ ICET_EXPORT void icetCompressedCompressedComposite(
IceTSparseImage
dest_buffer
);
ICET_EXPORT
void
icetImageCorrectBackground
(
IceTImage
image
);
ICET_EXPORT
void
icetClearImageTrueBackground
(
IceTImage
image
);
#define ICET_BLEND_UBYTE(front, back, dest) \
{ \
...
...
src/strategies/direct.c
View file @
8f744038
...
...
@@ -71,21 +71,24 @@ IceTImage icetDirectCompose(void)
outSparseImage
,
tile_image_dest
);
if
((
display_tile
>=
0
)
&&
(
num_contributors
<
1
))
{
/* Must be displaying a blank tile. */
const
IceTInt
*
tile_viewports
=
icetUnsafeStateGetInteger
(
ICET_TILE_VIEWPORTS
);
const
IceTInt
*
display_tile_viewport
=
tile_viewports
+
4
*
display_tile
;
IceTInt
display_tile_width
=
display_tile_viewport
[
2
];
IceTInt
display_tile_height
=
display_tile_viewport
[
3
];
icetRaiseDebug
(
"Returning blank tile."
);
icetImageSetDimensions
(
image
,
display_tile_width
,
display_tile_height
);
icetClearImage
(
image
);
}
if
(
display_tile
>=
0
)
{
icetImageCorrectBackground
(
image
);
if
(
num_contributors
>
0
)
{
icetImageCorrectBackground
(
image
);
}
else
{
/* Must be displaying a blank tile. */
const
IceTInt
*
tile_viewports
=
icetUnsafeStateGetInteger
(
ICET_TILE_VIEWPORTS
);
const
IceTInt
*
display_tile_viewport
=
tile_viewports
+
4
*
display_tile
;
IceTInt
display_tile_width
=
display_tile_viewport
[
2
];
IceTInt
display_tile_height
=
display_tile_viewport
[
3
];
icetRaiseDebug
(
"Returning blank tile."
);
icetImageSetDimensions
(
image
,
display_tile_width
,
display_tile_height
);
icetClearImageTrueBackground
(
image
);
}
}
return
image
;
...
...
src/strategies/reduce.c
View file @
8f744038
...
...
@@ -515,7 +515,7 @@ IceTImage reduceCollect(const IceTSparseImage composited_image,
if
((
tile_displayed
>=
0
)
&&
(
tile_displayed
!=
compose_tile
))
{
/* Return empty image if nothing in this tile. */
icetRaiseDebug
(
"Clearing pixels"
);
icetClearImage
(
result_image
);
icetClearImage
TrueBackground
(
result_image
);
}
return
result_image
;
...
...
src/strategies/split.c
View file @
8f744038
...
...
@@ -124,7 +124,7 @@ static void icetCollectImage(IceTImage imageFragment,
}
}
}
else
{
icetClearImage
(
fullImage
);
icetClearImage
TrueBackground
(
fullImage
);
}
}
...
...
@@ -202,7 +202,7 @@ IceTImage icetSplitCompose(void)
my_height
=
tile_viewports
[
4
*
tile_displayed
+
3
];
fullImage
=
icetGetStateBufferImage
(
SPLIT_FULL_IMAGE_BUFFER
,
my_width
,
my_height
);
icetClearImage
(
fullImage
);
icetClearImage
TrueBackground
(
fullImage
);
}
return
fullImage
;
}
...
...
src/strategies/vtree.c
View file @
8f744038
...
...
@@ -226,13 +226,35 @@ IceTImage icetVtreeCompose(void)
/* Hacks for when "this" tile was not rendered. */
if
((
tile_displayed
>=
0
)
&&
(
tile_displayed
!=
tile_held
))
{
if
(
all_contained_tmasks
[
rank
*
num_tiles
+
tile_displayed
])
{
/* Only "this" node draws "this" tile. Because the image never */
/* needed to be transferred, it was never rendered above. Just */
/* render it now. */
/* Only "this" node draws "this" tile. Because the image never needed
to be transferred, it was never rendered above. Just render it
now. We might save some time by rendering with the true
background color rather than correcting it later. */
IceTFloat
true_background
[
4
];
IceTInt
true_background_word
;
IceTFloat
original_background
[
4
];
IceTInt
original_background_word
;
icetGetFloatv
(
ICET_TRUE_BACKGROUND_COLOR
,
true_background
);
icetGetIntegerv
(
ICET_TRUE_BACKGROUND_COLOR_WORD
,
&
true_background_word
);
icetGetFloatv
(
ICET_BACKGROUND_COLOR
,
original_background
);
icetGetIntegerv
(
ICET_BACKGROUND_COLOR_WORD
,
&
original_background_word
);
icetStateSetFloatv
(
ICET_BACKGROUND_COLOR
,
4
,
true_background
);
icetStateSetInteger
(
ICET_BACKGROUND_COLOR_WORD
,
true_background_word
);
icetRaiseDebug
(
"Rendering tile to display."
);
/* This may uncessarily read a buffer if not outputing an input
buffer */
icetGetTileImage
(
tile_displayed
,
image
);
icetStateSetFloatv
(
ICET_BACKGROUND_COLOR
,
4
,
original_background
);
icetStateSetInteger
(
ICET_BACKGROUND_COLOR_WORD
,
original_background_word
);
}
else
{
/* "This" tile is blank. */
const
IceTInt
*
display_tile_viewport
...
...
@@ -243,11 +265,9 @@ IceTImage icetVtreeCompose(void)
icetRaiseDebug
(
"Returning blank image."
);
icetImageSetDimensions
(
image
,
display_tile_width
,
display_tile_height
);
icetClearImage
(
image
);
icetClearImage
TrueBackground
(
image
);
}
}
if
(
tile_displayed
>=
0
)
{
}
else
if
(
tile_displayed
>=
0
)
{
icetImageCorrectBackground
(
image
);
}
...
...
Write
Preview
Supports
Markdown
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