Support Forum       G3D Web Page     
Public Types | Public Member Functions | Public Attributes | List of all members
G3D::Texture::LoadingInfo Class Reference

All transient information used by image loading and preprocessing of Textures, collected here so that the process can efficiently run on separate threads in a multithreaded environment. More...

Public Types

enum  NextStep {
  UNINITIALIZED,
  LOAD_FROM_DISK,
  PREPROCESS,
  TRANSFER_TO_GPU,
  SET_SAMPLER_PARAMETERS,
  DONE
}
 

Public Member Functions

 LoadingInfo (NextStep s)
 

Public Attributes

BinaryInputbinaryInput = nullptr
 The loaded data for the first image, used in LOAD_FROM_DISK. More...
 
CubeMapConvention::CubeMapInfo cubeMapInfo
 Filled out in Texture::fromFile. More...
 
Encoding desiredEncoding
 Valid from construction. More...
 
String filename [6]
 Filenames on disk. More...
 
bool generateMipMaps = false
 Used during TRANSFER_TO_GPU, set on construction. More...
 
bool lazyLoadable = false
 If true, the ptbArray owns its data and the calls can be threaded or delayed. More...
 
NextStep nextStep = LOAD_FROM_DISK
 Loading can be resumed from discrete steps because different factory methods begin at different points in the pipeline, some already having done preliminary preprocessing steps externally. More...
 
int numFaces = 1
 Set based on m_dimension on construction. More...
 
bool preferSRGBForAuto = true
 Used during PREPROCESS when autodetecting formats. More...
 
Preprocess preprocess
 Used during PREPROCESS. More...
 
MIPCubeFacePTBArray ptbArray
 ptbArray[mip][face] = the buffer with image data. More...
 

Detailed Description

All transient information used by image loading and preprocessing of Textures, collected here so that the process can efficiently run on separate threads in a multithreaded environment.

Using a class for this information works around some MSVC internal compiler errors with lambdas and simplifies the data ownership and collection.

See also
fromFile(), fromMemory(), initFromPixelTransferBuffer

Member Enumeration Documentation

◆ NextStep

Enumerator
UNINITIALIZED 
LOAD_FROM_DISK 
PREPROCESS 
TRANSFER_TO_GPU 
SET_SAMPLER_PARAMETERS 
DONE 

Constructor & Destructor Documentation

◆ LoadingInfo()

G3D::Texture::LoadingInfo::LoadingInfo ( NextStep  s)
inline

Member Data Documentation

◆ binaryInput

BinaryInput* G3D::Texture::LoadingInfo::binaryInput = nullptr

The loaded data for the first image, used in LOAD_FROM_DISK.

Set on construction. This must be loaded before a thread is launched so that the metadata (width, height, and format) can be parsed early.

◆ cubeMapInfo

CubeMapConvention::CubeMapInfo G3D::Texture::LoadingInfo::cubeMapInfo

Filled out in Texture::fromFile.

◆ desiredEncoding

Encoding G3D::Texture::LoadingInfo::desiredEncoding

Valid from construction.

May be mutated if the format is ImageFormat::AUTO() after LOAD_FROM_DISK.

◆ filename

String G3D::Texture::LoadingInfo::filename[6]

Filenames on disk.

Valid on construction, used by LOAD_FROM_DISK.

◆ generateMipMaps

bool G3D::Texture::LoadingInfo::generateMipMaps = false

Used during TRANSFER_TO_GPU, set on construction.

◆ lazyLoadable

bool G3D::Texture::LoadingInfo::lazyLoadable = false

If true, the ptbArray owns its data and the calls can be threaded or delayed.

◆ nextStep

NextStep G3D::Texture::LoadingInfo::nextStep = LOAD_FROM_DISK

Loading can be resumed from discrete steps because different factory methods begin at different points in the pipeline, some already having done preliminary preprocessing steps externally.

◆ numFaces

int G3D::Texture::LoadingInfo::numFaces = 1

Set based on m_dimension on construction.

◆ preferSRGBForAuto

bool G3D::Texture::LoadingInfo::preferSRGBForAuto = true

Used during PREPROCESS when autodetecting formats.

◆ preprocess

Preprocess G3D::Texture::LoadingInfo::preprocess

Used during PREPROCESS.

◆ ptbArray

MIPCubeFacePTBArray G3D::Texture::LoadingInfo::ptbArray

ptbArray[mip][face] = the buffer with image data.

numFaces specifies the number of faces and ptbArray.size() is the number of MIPs (frequently, only one).

Valid after LOAD_FROM_DISK. May be mutated by PREPROCESS.


documentation generated on Wed Nov 24 2021 08:02:01 using doxygen 1.8.15