Navigation
API > API/Runtime > API/Runtime/GeometryCore
ImageOccupancyMap calculates and stores coverage information for a 2D image/texture, for example coverage derived from UV islands of a mesh, 2D polygons, etc.
An optional set of gutter texels can be calculated, and correspondence between gutter texels and the nearest interior texel is stored.
In addition, a 2D coordinate (eg UV) and integer ID (eg Triangle ID) of each texel can be calculated/stored. This is not just a cache. For 'border' texels where the texel center is technically outside the mesh/polygon, but the texel rectangle may still overlap the shape, the nearest UV/Triangle is stored. This simplifies computing samples around the borders such that the shape is covered under linear interpolatione/etc.
TODO Some of the names in this class are misleading because the name mentions "Texel" but should actually say "Sample" this is because the class initially supported only one sample per texel but later multi-sampling was added
| Name | FImageOccupancyMap |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Image/ImageOccupancyMap.h |
| Include Path | #include "Image/ImageOccupancyMap.h" |
Syntax
class FImageOccupancyMap
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FGridSampler | TGridSampler< double > | Image/ImageOccupancyMap.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| BorderTexel | int8 | Image/ImageOccupancyMap.h | |
| EmptyTexel | int8 | Texel types | Image/ImageOccupancyMap.h |
| GutterTexel | int8 | Image/ImageOccupancyMap.h | |
| InteriorTexel | int8 | Image/ImageOccupancyMap.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BorderTexels | TArray64< TTuple< int64, int64 > > | Set of Border Texels, Pair is |
Image/ImageOccupancyMap.h | |
| bParallel | bool | Image/ImageOccupancyMap.h | ||
| Dimensions | FImageDimensions | Image Dimensions | Image/ImageOccupancyMap.h | |
| GutterSize | int32 | Width of the gutter. | Image/ImageOccupancyMap.h | |
| GutterTexels | TArray64< TTuple< int64, int64 > > | Set of Gutter Texels. | Image/ImageOccupancyMap.h | |
| PixelSampler | FGridSampler | Image/ImageOccupancyMap.h | ||
| TexelInteriorSamples | TArray64< int32 > | Count of interior samples for each texel in Tile. Size = Tile.GetWidth() x Tile.GetHeight(). | Image/ImageOccupancyMap.h | |
| TexelQueryTriangle | TArray64< int32 > | Integer/Triangle ID for each sample in Tile. | Image/ImageOccupancyMap.h | |
| TexelQueryUV | TArray64< FVector2f > | UV for each sample in Tile. Size = Tile.GetWidth() x Tile.GetHeight() x SamplesPerPixel. | Image/ImageOccupancyMap.h | |
| TexelQueryUVChart | TArray64< int32 > | UV Chart ID for each texel in Tile. | Image/ImageOccupancyMap.h | |
| TexelType | TArray64< int8 > | Classification of each sample in Tile. Size = Tile.GetWidth() x Tile.GetHeight() x SamplesPerPixel. | Image/ImageOccupancyMap.h | |
| Tile | FImageTile | Image/ImageOccupancyMap.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ClassifySamplesFromUVSpaceMesh
(
const MeshType& UVSpaceMesh, |
Void SetTexelType(int64 X, int64 Y, int8 Type) | Image/ImageOccupancyMap.h | |
bool ClassifySamplesFromUVSpaceMesh
(
const MeshType& UVSpaceMesh, |
Image/ImageOccupancyMap.h | ||
bool ComputeFromUVSpaceMesh
(
const MeshType& UVSpaceMesh, |
Computes the image occupancy map from a UV space mesh. | Image/ImageOccupancyMap.h | |
bool ComputeGutterTexelsFromGutterSamples() |
Image/ImageOccupancyMap.h | ||
void Initialize
(
FImageDimensions DimensionsIn, |
Image/ImageOccupancyMap.h | ||
void Initialize
(
FImageDimensions DimensionsIn, |
Image/ImageOccupancyMap.h | ||
bool IsInterior
(
int64 LinearIndex |
Image/ImageOccupancyMap.h | ||
void ParallelProcessingPass
(
TFunctionRef< TexelValueType(int64 LinearIdx)> BeginTexel, |
Image/ImageOccupancyMap.h | ||
int32 TexelNumSamples
(
int64 LinearIndex |
Image/ImageOccupancyMap.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void InitializePixelSampler
(
const int32 SamplesPerPixelIn |
Initialize the pixel sampler. | Image/ImageOccupancyMap.h |