37 void create(
int SizeX,
int SiezY,
int depth = 1, FieldClamp clampmode = fcWrap);
119 void set(
float value,
int x,
int y,
int channel = 0);
128 void add(
float value,
int x,
int y,
int channel = 0);
137 float get(
int x,
int y,
int channel = 0)
const ;
146 float&
value(
int x,
int y,
int channel = 0);
155 Vector3D getV3(
int x,
int y)
const;
164 Vector4D getV4(
int x,
int y)
const;
173 cVec2 getV2(
int x,
int y)
const;
359 void relax(
ValuesField& destination,
float degree,
float radius,
int x0,
int y0,
int x1,
int y1);
412 float detectPerlin(
int x,
int y,
int channel);
430 void operator += (
float value);
436 void operator -= (
float value);
442 void operator *= (
float value);
448 void operator /= (
float value);
454 void operate(
const std::function<
void(
int,
int) >& f,
bool multithread =
true);
498 comms::cVec3
averageColor(
int x = 0,
int y = 0,
int w = 0,
int h = 0,
float alpha_threshold = 200)
const;
543 void rect(
int x0,
int y0,
int x1,
int y1,
const cVec4& color);
545 void calc_featuremap(
ValuesField& dest,
int radius);
547 void local_normalisation(
ValuesField& dest,
int size);
549 void find_local_minmax(std::vector<comms::cVec2>& minmax);
551 void getEllipse(
int x,
int y,
cVec2& center,
cVec2& longer_axis,
float& relation);
The class to operate over the 2D fields.
Definition ValuesField.h:11
void relax(ValuesField &destination, float degree, float radius)
relax the field
float get_bicubic(float x, float y, int channel=0) const
get the bicubic interpolated value
cVec2 get_linearV2(float x, float y) const
get the linearly interpolated value as 2d-vector
comms::cBounds blendImage(const ValuesField &other, const cMat3 &transform, const cVec4 &modulator=cVec4::One)
blend the image with the other image
void sharpen(ValuesField &destination, float degree, float radius)
sharpen the field
void sharp2X(ValuesField &dest)
Experimental: Increase the image 2X and sharpen.
ValuesField(const ValuesField &vf, int x=0, int y=0, int w=0, int h=0)
construct the field from the other cropped field
void toImage(comms::cImage &im)
convert the field to the image
float get_bicubic_mip(float x, float y, int channel, float mip_level) const
get the bicubic interpolated value using the mipmaps
cVec2 get_bicubicV2(float x, float y) const
get the bicubic interpolated value as the 2d-vector
void LaplacianInterpolate(const cList< Vector3D > &lines)
Interpolates the whole field so that it is maximally smooth (laplacian value minimized) and gets the ...
float get(int x, int y, int channel=0) const
get the value of the field by the integer coordinates
void swap(ValuesField &dest)
swap two fields (dimensions may be different)
comms::cBounds blendImageM4(const ValuesField &other, const comms::cMat4 &transform, const cVec4 &modulator=cVec4::One)
blend the image with the other image using the 4x4 matrix transformation
cVec4 get_linearV4(float x, float y) const
get the linearly interpolated value as 4d-vector
void sharpResize(ValuesField &dest, float scale)
resize to bigger size keeping the edges sharpness
cVec2 get_linearV2_mip(float x, float y, float mip_level) const
get the linearly interpolated value as 2d-vector using the mipmaps
cVec3 get_linearV3_mip(float x, float y, float mip_level) const
get the linearly interpolated value as 3d-vector using the mipmaps
void clear()
clear rthe field
void rect(int x0, int y0, int x1, int y1, const cVec4 &color)
draw the filled rectangle
void LaplacianInterpolate(const UnlimitedBitset &fixed)
Interpolates the whole field so that it is maximally smooth (laplacian value minimized) and keeps the...
void sharpEdges2X1(ValuesField &dest)
Experimental, variation of the previous function: Increase the image 2X and sharpen (sharpening edges...
void create(int SizeX, int SiezY, int depth=1, FieldClamp clampmode=fcWrap)
Create the field.
void setClampMode(FieldClamp cl)
set the field clamp mode - how it acts beyond the boundaries
void NormalizeColors(bool monochromatic=false, int mipsize=64)
Normalize the texture to be (128, 128, 128) in average using the mip-mapping algorithm.
cVec4 get_linearV4_mip(float x, float y, float mip_level) const
get the linearly interpolated value as 4d-vector using the mipmaps
void normalmap(ValuesField &dest, int byChannel=0)
calculate the normalmap
void toPower2(ValuesField &dest)
resize to the closest power of 2 (may increase, may decrease the size, we choose what is arithmetical...
void createFromImageMono(const comms::cImage &im, Vector3D mask=Vector3D::Zero)
create the monochromatic field from the image (1 channel)
void createMips()
create the mipmaps, decreasing twice with each level until it is possible
void recoverBump(ValuesField &dest)
recover the bump from the color/greyscale (heuristic)
int depth() const
Get amount of channels.
Definition ValuesField.h:562
int height() const
get height
Definition ValuesField.h:558
cVec4 get_bicubicV4(float x, float y) const
get the bicubic interpolated value as the 4d-vector
float get_linear(float x, float y, int channel=0) const
get the linearly interpolated value
cVec4 get_bicubicV4_mip(float x, float y, float mip_level) const
get the bicubic interpolated value as the 4d-vector using the mipmaps
void set(float value, int x, int y, int channel=0)
set teh value to the field
cVec2 & getV2(int x, int y)
get the reference to the values as 2d - vector. It has sense only if there are at least 2 channels
void normalmap3(ValuesField &dest, float heightmod=1.0, int channel=0)
calculate the normalmap as the 3d-vectors set
void curvature(ValuesField &dest)
calculate the curvature of the 2d-field
float & value(int x, int y, int channel=0)
get the value reference of the field by the integer coordinates
void saveImage(const char *name)
save the field directly to file
cVec3 get_bicubicV3_mip(float x, float y, float mip_level) const
get the bicubic interpolated value as the 3d-vector using the mipmaps
void curvatureDir(ValuesField &dest)
calculate the curvature principal directions
void sharpEdges2X(ValuesField &dest)
Experimental: Increase the image 2X and sharpen (sharpening edges so that edge width will be kept des...
bool torange(int &x, int &y) const
converts the (x,y) to range [0..Lx-1, 0..Ly-1]
void createFromImage(const comms::cImage &im)
create the field form the image
cVec3 get_linearV3(float x, float y) const
get the linearly interpolated value as 3d-vector
void gradientValue(ValuesField &dest)
calculate the gradient length
void add(float value, int x, int y, int channel=0)
add the value to the field
void operate(const std::function< void(int, int) > &f, bool multithread=true)
operate over the field with the lambda
void monoTo(ValuesField &dest)
convert multiple channels to one as an average-arithmetic
int width() const
get width
Definition ValuesField.h:554
cVec2 get_bicubicV2_mip(float x, float y, float mip_level) const
get the bicubic interpolated value as the 2d-vector using the mipmaps
comms::cVec3 averageColor(int x=0, int y=0, int w=0, int h=0, float alpha_threshold=200) const
get the average color of the texture piece
cVec3 get_bicubicV3(float x, float y) const
get the bicubic interpolated value as the 3d-vector
void resizeTo(ValuesField &dest)
resize the field to other size using the bicubic interpolation
float get_linear_mip(float x, float y, int channel, float mip_level) const
get the linearly interpolated value using the mipmaps
void Decrease2X(ValuesField &dest)
Decrease the field 2X times.
void max(ValuesField &other)
calculated the maximum of two fields into hte current
Vector3D & getV3(int x, int y)
get the reference to the values as 3d - vector. It has sense only if there are at least 3 channels
Vector4D & getV4(int x, int y)
get the reference to the values as 4d - vector. It has sense only if there are at least 4 channels
void loadImage(const char *name)
read the image directly from the file
The array template, refer it as coat::list <...> if you are using the Core API.
Definition cList.h:133
The 3D-matrix, refer it as coat::mat3 in the Core API.
Definition cMat3.h:6
The 2D-vector, refer it as coat::vec2 in the Core API.
Definition cVec2.h:9
The 3D-vector, refer it as coat::vec3 in the Core API.
Definition cVec3.h:10
The 4D-vector, refer it as coat::vec4 in the Core API.
Definition cVec4.h:9