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 craster is NULL, then pixels in raster that has zero value will be
44
/// assumed to have zero alpha.
45
TIL_UVEnlarger
(
PXL_Raster
&
raster
,
46
PXL_Raster
*craster,
47
Scheme scheme = SCHEME_FLOOD_FILL,
48
int
fillPadding = 4);
49
50
~
TIL_UVEnlarger
();
51
52
/// How many pixels to pad each UV island with, when using the
53
/// flood filling scheme for enlarging.
54
void
setFillPadding
(
int
fp)
55
{ myFillPadding = fp; }
56
57
/// Sets the scheme to use when enlarging.
58
void
setScheme
(
Scheme
scheme)
59
{ myScheme = scheme; }
60
61
bool
enlarge(
bool
doUnpremult =
true
);
62
private
:
63
PXL_Raster
&myRaster;
64
PXL_Raster
*myCRaster;
65
int
myAttribNum;
66
67
Scheme myScheme;
68
int
myFillPadding;
69
70
/// The average pixel color of every UV island is computed, then the
71
/// background of the image is filled with that average color.
72
bool
fillBackgroundColor();
73
74
/// Return true if a pixel is on an UV island (filled area).
75
bool
onIsland(
const
int
&
x
,
76
const
int
&
y
);
77
};
78
79
#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:54
y
GLint y
Definition:
glcorearb.h:103
PXL_Raster
Definition:
PXL_Raster.h:35
TIL_Defines.h
TIL_UVEnlarger::setScheme
void setScheme(Scheme scheme)
Sets the scheme to use when enlarging.
Definition:
TIL_UVEnlarger.h:58
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
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 Apr 18 2024 03:17:30 for HDK by
1.8.6