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
51
~
TIL_UVEnlarger
();
52
53
/// How many pixels to pad each UV island with, when using the
54
/// flood filling scheme for enlarging.
55
void
setFillPadding
(
int
fp)
56
{ myFillPadding = fp; }
57
58
/// Sets the scheme to use when enlarging.
59
void
setScheme
(
Scheme
scheme)
60
{ myScheme = scheme; }
61
62
bool
enlarge(
bool
doUnpremult =
true
)
const
;
63
private
:
64
PXL_Raster
&myRaster;
65
const
PXL_Raster
*myAlphaRaster;
66
int
myAttribNum;
67
int
myAlphaRasterSize;
68
69
Scheme myScheme;
70
int
myFillPadding;
71
72
/// The average pixel color of every UV island is computed, then the
73
/// background of the image is filled with that average color.
74
bool
fillBackgroundColor()
const
;
75
76
/// Return true if a pixel is on an UV island (filled area).
77
bool
onIsland(
int
x
,
int
y
)
const
;
78
};
79
80
#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:55
y
GLint y
Definition:
glcorearb.h:103
PXL_Raster
Definition:
PXL_Raster.h:36
TIL_Defines.h
TIL_UVEnlarger::setScheme
void setScheme(Scheme scheme)
Sets the scheme to use when enlarging.
Definition:
TIL_UVEnlarger.h:59
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 Fri Nov 8 2024 03:41:39 for HDK by
1.8.6