HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
TIL_UVEnlarger.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: TIL_UVEnlarger.h (TIL Library, C++)
7
*
8
* COMMENTS: This class is responsible for post-processing of texture maps
9
* in order to help reduce the effects of seams forming at the
10
* border of UV islands. It's currently being used to post-process
11
* UV rendered images (see VGEO_UVUnwrapper).
12
*/
13
#ifndef TIL_UVEnlarger_H
14
#define TIL_UVEnlarger_H
15
16
#include "
TIL_API.h
"
17
#include <
PXL/PXL_Raster.h
>
18
19
#include "
TIL_Defines.h
"
20
#include <set>
21
22
class
TIL_API
TIL_UVEnlarger
23
{
24
public
:
25
enum
Scheme
26
{
27
/// Computes the average value of all the pixels that are a part of
28
/// UV islands, then applies that average value to all empty parts
29
/// of the image.
30
SCHEME_FILL_AVERAGE
,
31
32
/// Does a flood fill on the image and expands the boundary of each
33
/// UV island found by the amount specified by myFillPadding.
34
SCHEME_FLOOD_FILL
,
35
36
/// Does a diffusion fill on empty areas after expanding boundaries
37
/// of UV island specified by myFillPadding.
38
SCHEME_DIFFUSE_FILL
,
39
40
SCHEME_INVALID
41
};
42
43
/// If PXL_Raster is an RGB raster (with no alpha), then the alpha will be
44
/// pulled from the alpha_raster. If there's no alpha, all non-black
45
/// pixels will be considered opaque.
46
TIL_UVEnlarger
(
PXL_Raster
&
raster
,
47
const
PXL_Raster
*alpha_raster,
48
Scheme scheme = SCHEME_FLOOD_FILL,
49
int
fillPadding = 4,
50
bool
island_flood =
true
);
51
52
~
TIL_UVEnlarger
();
53
54
/// How many pixels to pad each UV island with, when using the
55
/// flood filling scheme for enlarging.
56
void
setFillPadding
(
int
fp
)
57
{ myFillPadding =
fp
; }
58
59
/// Sets the scheme to use when enlarging.
60
void
setScheme
(
Scheme
scheme)
61
{ myScheme = scheme; }
62
63
bool
enlarge(
bool
doUnpremult =
true
)
const
;
64
private
:
65
PXL_Raster
&myRaster;
66
const
PXL_Raster
*myAlphaRaster;
67
int
myAttribNum;
68
int
myAlphaRasterSize;
69
70
Scheme myScheme;
71
int
myFillPadding;
72
bool
myIslandFlood;
73
74
/// The average pixel color of every UV island is computed, then the
75
/// background of the image is filled with that average color.
76
bool
fillBackgroundColor()
const
;
77
78
/// Return true if a pixel is on an UV island (filled area).
79
bool
onIsland(
int
x
,
int
y
)
const
;
80
};
81
82
#endif
TIL_UVEnlarger
Definition:
TIL_UVEnlarger.h:22
TIL_API.h
PXL_Raster.h
TIL_UVEnlarger::setFillPadding
void setFillPadding(int fp)
Definition:
TIL_UVEnlarger.h:56
y
GLint y
Definition:
glcorearb.h:103
PXL_Raster
Definition:
PXL_Raster.h:62
TIL_Defines.h
TIL_UVEnlarger::setScheme
void setScheme(Scheme scheme)
Sets the scheme to use when enlarging.
Definition:
TIL_UVEnlarger.h:60
TIL_UVEnlarger::Scheme
Scheme
Definition:
TIL_UVEnlarger.h:25
HUSD_RenderTokens::raster
HUSD_API const char * raster()
TIL_UVEnlarger::SCHEME_DIFFUSE_FILL
Definition:
TIL_UVEnlarger.h:38
x
GLint GLenum GLint x
Definition:
glcorearb.h:409
fp
basic_fp< unsigned long long > fp
Definition:
format.h:1697
basic_fp
Definition:
format.h:1651
TIL_UVEnlarger::SCHEME_FLOOD_FILL
Definition:
TIL_UVEnlarger.h:34
TIL_API
#define TIL_API
Definition:
TIL_API.h:10
TIL_UVEnlarger::SCHEME_FILL_AVERAGE
Definition:
TIL_UVEnlarger.h:30
TIL
TIL_UVEnlarger.h
Generated on Thu Sep 4 2025 02:39:33 for HDK by
1.8.6