![]() |
Inviwo 0.9.12-pre
Inviwo documentation
|
Public Types | |
using | Config = LayerConfig |
Public Types inherited from inviwo::Data< Layer, LayerRepresentation > | |
using | self |
using | repr |
Public Member Functions | |
Layer (size2_t defaultDimensions=LayerConfig::defaultDimensions, const DataFormatBase *defaultFormat=LayerConfig::defaultFormat, LayerType type=LayerConfig::defaultType, const SwizzleMask &defaultSwizzleMask=LayerConfig::defaultSwizzleMask, InterpolationType interpolation=LayerConfig::defaultInterpolation, const Wrapping2D &wrapping=LayerConfig::defaultWrapping) | |
Layer (const LayerConfig &config) | |
Layer (std::shared_ptr< LayerRepresentation >) | |
Layer (const Layer &)=default | |
Layer (Layer &&)=default | |
Layer & | operator= (const Layer &that)=default |
Layer & | operator= (Layer &&that)=default |
virtual Layer * | clone () const override |
Layer (const Layer &rhs, NoData noData, const LayerConfig &config={}) | |
LayerType | getLayerType () const |
virtual void | setDimensions (const size2_t &dim) |
virtual size2_t | getDimensions () const override |
void | setDataFormat (const DataFormatBase *format) |
const DataFormatBase * | getDataFormat () 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. | |
SwizzleMask | getSwizzleMask () const |
void | setInterpolation (InterpolationType interpolation) |
InterpolationType | getInterpolation () const |
void | setWrapping (const Wrapping2D &wrapping) |
Wrapping2D | getWrapping () const |
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 | |
vec2 | getWorldSpaceGradientSpacing () const |
Computes the spacing to be used for gradient computation. Also works for layers with non-orthogonal basis. | |
virtual const Axis * | getAxis (size_t index) const override |
LayerConfig | config () const |
HistogramCache::Result | calculateHistograms (const std::function< void(const std::vector< Histogram1D > &)> &whenDone) const |
void | discardHistograms () |
Public Member Functions inherited from inviwo::Data< Layer, LayerRepresentation > | |
const T * | getRepresentation () const |
std::shared_ptr< const T > | getRepresentationShared () 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) |
void | updateResource (const ResourceMeta &meta) const |
Public Member Functions inherited from inviwo::StructuredGridEntity< 2 > | |
StructuredGridEntity< N > & | operator= (const StructuredGridEntity< N > &that)=default |
glm::mat4 | getIndexMatrix () const |
virtual const StructuredCoordinateTransformer & | getCoordinateTransformer () const override |
Public Member Functions inherited from inviwo::SpatialEntity | |
SpatialEntity (const glm::mat4 &modelMatrix) | |
SpatialEntity (const glm::mat4 &modelMatrix, const glm::mat4 &worldMatrix) | |
SpatialEntity (const SpatialEntity &rhs) | |
SpatialEntity & | operator= (const SpatialEntity &that) |
glm::vec3 | getOffset () const |
void | setOffset (const glm::vec3 &offset) |
glm::mat3 | getBasis () const |
void | setBasis (const glm::mat3 &basis) |
glm::mat4 | getModelMatrix () const |
void | setModelMatrix (const glm::mat4 &modelMatrix) |
glm::mat4 | getWorldMatrix () const |
void | setWorldMatrix (const glm::mat4 &worldMatrix) |
virtual const SpatialCameraCoordinateTransformer & | getCoordinateTransformer (const Camera &camera) const |
Public Attributes | |
DataMapper | dataMap |
std::array< Axis, 2 > | axes |
Friends | |
class | LayerRepresentation |
Additional Inherited Members | |
Protected Member Functions inherited from inviwo::Data< Layer, LayerRepresentation > | |
Data< Layer, LayerRepresentation > & | operator= (const Data< Layer, LayerRepresentation > &that) |
decltype(auto) | getLastOr (F &&f, T &&fallback) const |
void | setLastAndInvalidateOther (F &&f, T &&value) |
Protected Attributes inherited from inviwo::SpatialEntity | |
std::unique_ptr< SpatialCoordinateTransformer > | transformer_ |
std::unique_ptr< SpatialCameraCoordinateTransformer > | cameraTransformer_ |
glm::mat4 | modelMatrix_ |
glm::mat4 | worldMatrix_ |
inviwo::Layer::Layer | ( | const Layer & | rhs, |
NoData | noData, | ||
const LayerConfig & | config = {} ) |
Create a layer based on rhs
without copying any representations. State from rhs
can be overridden by the config
rhs | source layer providing the necessary information like dimensions, swizzle masks, interpolation, spatial transformations, etc. |
noData | Tag type to indicate that representations should not be copied from rhs |
config | custom parameters overriding values from rhs |
|
overridevirtual |
Implements inviwo::Data< Layer, LayerRepresentation >.
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
fileExtension | file extension of the requested image format |
|
overridevirtual |
returns the axis information corresponding to index
RangeException | if index is out of bounds, i.e. index >= 2 |
Implements inviwo::SpatialEntity.
|
overridevirtual |
Implements inviwo::StructuredGridEntity< 2 >.
vec2 inviwo::Layer::getWorldSpaceGradientSpacing | ( | ) | const |
Computes the spacing to be used for gradient computation. Also works for layers with non-orthogonal basis.
For orthogonal lattices this will be equal to the world space texel spacing. For non-orthogonal lattices it will be the longer of the axes projected onto the world space axes.
World space b ^ ^ / |
y ^ / dy | / texel | | /__________>a \/ | <-—dx---> |____________> x
The actual gradient spacing vectors are given by mat2{ gradientSpacing.x, 0, 0, gradientSpacing.y } However, we do not return the zeroes.
To get the spacing in texture space use: mat3{glm::scale(worldToTextureMatrix, vec3{getWorldSpaceGradientSpacing(), 1.0f})};
void inviwo::Layer::setDataFormat | ( | const DataFormatBase * | format | ) |
|
virtual |
Resize to dimension. This is destructive, the data will not be preserved. Use copyRepresentationsTo to update the data.
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.
mask | new swizzle mask |