MeshLib C Docs
Loading...
Searching...
No Matches
MRImage.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRColor.h>
4#include <MRCMesh/MREnums.h>
5#include <MRCMesh/MRVector2.h>
6#include <MRCMisc/common.h>
7#include <MRCMisc/exports.h>
8
9#include <stddef.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct MR_MeshTexture MR_MeshTexture; // Defined in `#include <MRCMesh/MRMeshTexture.h>`.
16typedef struct MR_Vector2f MR_Vector2f; // Defined in `#include <MRCMesh/MRVector2.h>`.
17typedef struct MR_std_vector_MR_Color MR_std_vector_MR_Color; // Defined in `#include <MRCMisc/std_vector_MR_Color.h>`.
18
19
26typedef struct MR_Image MR_Image;
27
33
38MRC_API void MR_Image_Set_pixels(MR_Image *_this, MR_PassBy value_pass_by, MR_std_vector_MR_Color *value);
39
45
50MRC_API const MR_Vector2i *MR_Image_Get_resolution(const MR_Image *_this);
51
56MRC_API void MR_Image_Set_resolution(MR_Image *_this, MR_Vector2i value);
57
63
67
71MRC_API MR_Image *MR_Image_DefaultConstructArray(size_t num_elems);
72
78MRC_API MR_Image *MR_Image_ConstructFrom(MR_PassBy pixels_pass_by, MR_std_vector_MR_Color *pixels, MR_Vector2i resolution);
79
82MRC_API const MR_Image *MR_Image_OffsetPtr(const MR_Image *ptr, ptrdiff_t i);
83
86MRC_API MR_Image *MR_Image_OffsetMutablePtr(MR_Image *ptr, ptrdiff_t i);
87
93
98
102MRC_API MR_Image *MR_Image_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Image *_other);
103
105MRC_API void MR_Image_Destroy(const MR_Image *_this);
106
108MRC_API void MR_Image_DestroyArray(const MR_Image *_this);
109
115MRC_API MR_Image *MR_Image_AssignFromAnother(MR_Image *_this, MR_PassBy _other_pass_by, MR_Image *_other);
116
123
127MRC_API MR_Color MR_Image_index(const MR_Image *_this, const MR_Vector2i *p);
128
132MRC_API MR_uint64_t MR_Image_heapBytes(const MR_Image *_this);
133
139MRC_API MR_Color MR_Image_sampleDiscrete(const MR_Image *_this, const MR_Vector2f *pos);
140
146MRC_API MR_Color MR_Image_sampleBilinear(const MR_Image *_this, const MR_Vector2f *pos);
147
153MRC_API MR_Color MR_Image_sample(const MR_Image *_this, MR_FilterType filter, const MR_Vector2f *pos);
154
155#ifdef __cplusplus
156} // extern "C"
157#endif
struct MR_std_vector_MR_Color MR_std_vector_MR_Color
Definition MRCtm.h:33
struct MR_MeshTexture MR_MeshTexture
Definition MRCtm.h:18
char MR_FilterType
Definition MREnums.h:12
MRC_API MR_Image * MR_Image_DefaultConstruct(void)
MRC_API MR_MeshTexture * MR_Image_MutableStaticDowncastTo_MR_MeshTexture(MR_Image *object)
MRC_API MR_Image * MR_Image_DefaultConstructArray(size_t num_elems)
MRC_API void MR_Image_Set_resolution(MR_Image *_this, MR_Vector2i value)
MRC_API MR_uint64_t MR_Image_heapBytes(const MR_Image *_this)
MRC_API const MR_std_vector_MR_Color * MR_Image_Get_pixels(const MR_Image *_this)
MRC_API MR_Color * MR_Image_index_mut(MR_Image *_this, const MR_Vector2i *p)
MRC_API MR_Image * MR_Image_OffsetMutablePtr(MR_Image *ptr, ptrdiff_t i)
MRC_API MR_std_vector_MR_Color * MR_Image_GetMutable_pixels(MR_Image *_this)
MRC_API const MR_Vector2i * MR_Image_Get_resolution(const MR_Image *_this)
MRC_API MR_Vector2i * MR_Image_GetMutable_resolution(MR_Image *_this)
MRC_API MR_Color MR_Image_sampleDiscrete(const MR_Image *_this, const MR_Vector2f *pos)
MRC_API MR_Color MR_Image_sampleBilinear(const MR_Image *_this, const MR_Vector2f *pos)
MRC_API MR_Image * MR_Image_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Image *_other)
MRC_API void MR_Image_DestroyArray(const MR_Image *_this)
Destroys a heap-allocated array of MR_Image. Does nothing if the pointer is null.
MRC_API void MR_Image_Set_pixels(MR_Image *_this, MR_PassBy value_pass_by, MR_std_vector_MR_Color *value)
MRC_API const MR_Image * MR_Image_OffsetPtr(const MR_Image *ptr, ptrdiff_t i)
MRC_API MR_Image * MR_Image_ConstructFrom(MR_PassBy pixels_pass_by, MR_std_vector_MR_Color *pixels, MR_Vector2i resolution)
MRC_API MR_Image * MR_Image_AssignFromAnother(MR_Image *_this, MR_PassBy _other_pass_by, MR_Image *_other)
MRC_API MR_Color MR_Image_sample(const MR_Image *_this, MR_FilterType filter, const MR_Vector2f *pos)
MRC_API const MR_MeshTexture * MR_Image_StaticDowncastTo_MR_MeshTexture(const MR_Image *object)
MRC_API MR_Color MR_Image_index(const MR_Image *_this, const MR_Vector2i *p)
MRC_API void MR_Image_Destroy(const MR_Image *_this)
Destroys a heap-allocated instance of MR_Image. Does nothing if the pointer is null.
struct MR_Image MR_Image
Definition MRJpeg.h:12
Generated from class MR::Color.
Definition MRColor.h:18
Generated from class MR::Vector2f.
Definition MRVector2.h:36
Generated from class MR::Vector2i.
Definition MRVector2.h:50