Inviwo  0.9.10.1
Inviwo documentation
inviwo::Layer Class Reference
+ Inheritance diagram for inviwo::Layer:

Public Member Functions

 Layer (size2_t defaultDimensions=size2_t(8, 8), const DataFormatBase *defaultFormat=DataVec4UInt8::get(), LayerType type=LayerType::Color, const SwizzleMask &defaultSwizzleMask=swizzlemasks::rgba)
 
 Layer (std::shared_ptr< LayerRepresentation >)
 
 Layer (const Layer &)=default
 
Layeroperator= (const Layer &that)=default
 
virtual Layerclone () const override
 
LayerType getLayerType () const
 
virtual void setDimensions (const size2_t &dim)
 
virtual size2_t getDimensions () const override
 
void setDataFormat (const DataFormatBase *format)
 
const DataFormatBasegetDataFormat () const
 
void setSwizzleMask (const SwizzleMask &mask)
 update the swizzle mask of the channels for sampling color layers The swizzle mask is only affecting Color layers. More...
 
SwizzleMask getSwizzleMask () const
 
void copyRepresentationsTo (Layer *target)
 
std::unique_ptr< std::vector< unsigned char > > getAsCodedBuffer (const std::string &fileExtension) const
 encode the layer contents to a buffer considering the requested image format More...
 
- Public Member Functions inherited from inviwo::Data< Layer, LayerRepresentation >
const T * getRepresentation () const
 
T * getEditableRepresentation ()
 
bool hasRepresentation () const
 
bool hasRepresentations () const
 
void addRepresentation (std::shared_ptr< LayerRepresentation > representation)
 
void removeRepresentation (const LayerRepresentation *representation)
 
void removeOtherRepresentations (const LayerRepresentation *representation)
 
void clearRepresentations ()
 
void invalidateAllOther (const LayerRepresentation *repr)
 
- Public Member Functions inherited from inviwo::StructuredGridEntity< 2 >
 StructuredGridEntity (const StructuredGridEntity< N > &rhs)=default
 
 StructuredGridEntity (const Vector< N, size_t > &dimensions, const Vector< N, float > &spacing)
 
 StructuredGridEntity (const Matrix< N+1, float > &modelMatrix)
 
 StructuredGridEntity (const Matrix< N+1, float > &modelMatrix, const Matrix< N+1, float > &worldMatrix)
 
StructuredGridEntity< N > & operator= (const StructuredGridEntity< N > &that)=default
 
Matrix< N+1, float > getIndexMatrix () const
 
virtual const StructuredCoordinateTransformer< N > & getCoordinateTransformer () const
 
virtual const StructuredCameraCoordinateTransformer< N > & getCoordinateTransformer (const CameraND< N > &camera) const
 
- Public Member Functions inherited from inviwo::SpatialEntity< N >
 SpatialEntity (const SpatialEntity< N > &rhs)
 
 SpatialEntity (const Matrix< N+1, float > &modelMatrix)
 
 SpatialEntity (const Matrix< N+1, float > &modelMatrix, const Matrix< N+1, float > &worldMatrix)
 
SpatialEntity< N > & operator= (const SpatialEntity< N > &that)
 
Vector< N, float > getOffset () const
 
void setOffset (const Vector< N, float > &offset)
 
Matrix< N, float > getBasis () const
 
void setBasis (const Matrix< N, float > &basis)
 
Matrix< N+1, float > getModelMatrix () const
 
void setModelMatrix (const Matrix< N+1, float > &modelMatrix)
 
Matrix< N+1, float > getWorldMatrix () const
 
void setWorldMatrix (const Matrix< N+1, float > &worldMatrix)
 

Friends

class LayerRepresentation
 

Additional Inherited Members

- Public Types inherited from inviwo::Data< Layer, LayerRepresentation >
using self = Layer
 
using repr = LayerRepresentation
 
- Protected Member Functions inherited from inviwo::Data< Layer, LayerRepresentation >
 Data (const Data< Layer, LayerRepresentation > &rhs)
 
Data< Layer, LayerRepresentation > & operator= (const Data< Layer, LayerRepresentation > &rhs)
 
const T * getValidRepresentation () const
 
void copyRepresentationsTo (Data< Layer, LayerRepresentation > *targetData) const
 
std::shared_ptr< LayerRepresentationaddRepresentationInternal (std::shared_ptr< LayerRepresentation > representation) const
 
- Protected Attributes inherited from inviwo::Data< Layer, LayerRepresentation >
std::mutex mutex_
 
std::unordered_map< std::type_index, std::shared_ptr< LayerRepresentation > > representations_
 
std::shared_ptr< LayerRepresentationlastValidRepresentation_
 
- Protected Attributes inherited from inviwo::SpatialEntity< N >
SpatialCoordinateTransformer< N > * transformer_
 
SpatialCameraCoordinateTransformer< N > * cameraTransformer_
 
Matrix< N+1, float > modelMatrix_
 
Matrix< N+1, float > worldMatrix_
 

Member Function Documentation

◆ copyRepresentationsTo()

void inviwo::Layer::copyRepresentationsTo ( Layer target)

Copy and resize the representation of this onto the representations of target. Does not change the dimensions of target.

◆ getAsCodedBuffer()

std::unique_ptr< std::vector< unsigned char > > inviwo::Layer::getAsCodedBuffer ( const std::string &  fileExtension) const

encode the layer contents to a buffer considering the requested image format

Parameters
fileExtensionfile extension of the requested image format
Returns
encoded layer contents as std::vector

◆ setDataFormat()

void inviwo::Layer::setDataFormat ( const DataFormatBase format)

Set the format of the data.

See also
DataFormatBase
Parameters
formatThe format of the data.

◆ setDimensions()

void inviwo::Layer::setDimensions ( const size2_t &  dim)
virtual

Resize to dimension. This is destructive, the data will not be preserved. Use copyRepresentationsTo to update the data.

Note
Resizes the last valid representation and erases all other representations. Last valid representation will remain valid after changing the dimension.

◆ setSwizzleMask()

void inviwo::Layer::setSwizzleMask ( const SwizzleMask &  mask)

update the swizzle mask of the channels for sampling color layers The swizzle mask is only affecting Color layers.

Parameters
masknew swizzle mask

The documentation for this class was generated from the following files: