MeshLib
 
Loading...
Searching...
No Matches
MR::Image Struct Reference

#include <MRImage.h>

+ Inheritance diagram for MR::Image:

Public Member Functions

Coloroperator[] (const Vector2i &p)
 fetches some texture element specified by integer coordinates
 
Color operator[] (const Vector2i &p) const
 
size_t heapBytes () const
 returns the amount of memory this object occupies on heap
 
MRMESH_API Color sampleDiscrete (const UVCoord &pos) const
 
MRMESH_API Color sampleBilinear (const UVCoord &pos) const
 
Color sample (FilterType filter, const UVCoord &pos) const
 

Public Attributes

std::vector< Colorpixels
 
Vector2i resolution
 

Detailed Description

struct to hold Image data

Member Function Documentation

◆ heapBytes()

size_t MR::Image::heapBytes ( ) const
inlinenodiscard

returns the amount of memory this object occupies on heap

◆ operator[]() [1/2]

Color & MR::Image::operator[] ( const Vector2i & p)
inlinenodiscard

fetches some texture element specified by integer coordinates

◆ operator[]() [2/2]

Color MR::Image::operator[] ( const Vector2i & p) const
inlinenodiscard

◆ sample()

Color MR::Image::sample ( FilterType filter,
const UVCoord & pos ) const
inlinenodiscard

Given texture position in [0,1]x[0,1] (which is clamped if necessary), returns sampled color at it according to given filter

◆ sampleBilinear()

MRMESH_API Color MR::Image::sampleBilinear ( const UVCoord & pos) const
nodiscard

Given texture position in [0,1]x[0,1] (which is clamped if necessary), returns bilinear interpolated color at it

◆ sampleDiscrete()

MRMESH_API Color MR::Image::sampleDiscrete ( const UVCoord & pos) const
nodiscard

Given texture position in [0,1]x[0,1] (which is clamped if necessary), returns the color of the closest pixel

Member Data Documentation

◆ pixels

std::vector<Color> MR::Image::pixels

◆ resolution

Vector2i MR::Image::resolution

The documentation for this struct was generated from the following file: