17 std::vector<Color> pixels;
21 [[nodiscard]] Color& operator[](
const Vector2i & p );
22 [[nodiscard]] Color operator[](
const Vector2i & p )
const;
25 [[nodiscard]]
size_t heapBytes()
const {
return MR::heapBytes( pixels ); }
29 [[nodiscard]]
MRMESH_API Color sampleDiscrete(
const UVCoord & pos )
const;
33 [[nodiscard]]
MRMESH_API Color sampleBilinear(
const UVCoord & pos )
const;
37 [[nodiscard]] Color sample( FilterType filter,
const UVCoord & pos )
const
38 {
return filter == FilterType::Discrete ? sampleDiscrete( pos ) : sampleBilinear( pos ); }
41inline Color& Image::operator[](
const Vector2i & p )
43 assert( p.x >= 0 && p.x < resolution.x );
44 assert( p.y >= 0 && p.y < resolution.y );
45 return pixels[p.x + p.y * resolution.x];
48inline Color Image::operator[](
const Vector2i & p )
const
50 assert( p.x >= 0 && p.x < resolution.x );
51 assert( p.y >= 0 && p.y < resolution.y );
52 return pixels[p.x + p.y * resolution.x];
#define MRMESH_API
Definition MRMeshFwd.h:80
size_t heapBytes(const BitSet &bs)
returns the amount of memory given BitSet occupies on heap
Definition MRMesh/MRBitSet.h:298
MRVIEWER_API void Image(const MR::ImGuiImage &image, const ImVec2 &size, const MR::Color &multColor)
draw image with Y-direction inversed up-down
Definition MRCameraOrientationPlugin.h:8