26 void create(
int SizeX,
int SiezY,
int depth = 1, FieldClamp clampmode = fcWrap);
63 void createFromImageMono(
const comms::cImage& im, Vector3D mask = Vector3D(2.0f/9.0f, 6.0f/9.0f, 1.0f/9.0f));
103 void set(
float value,
int x,
int y,
int channel = 0);
112 void add(
float value,
int x,
int y,
int channel = 0);
121 float get(
int x,
int y,
int channel = 0)
const ;
130 float&
value(
int x,
int y,
int channel = 0);
266 void relax(
ValuesField& destination,
float degree,
float radius,
int x0,
int y0,
int x1,
int y1);
319 float detectPerlin(
int x,
int y,
int channel);
337 void operator += (
float value);
343 void operator -= (
float value);
349 void operator *= (
float value);
355 void operator /= (
float value);
367 void operate(
const std::function<
void(
int,
int) >& f,
bool multithread =
true);
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
void sharpen(ValuesField &destination, float degree, float radius)
sharpen the field
void sharp2X(ValuesField &dest)
Experimental: Increase the image 2X and sharpen.
void toImage(comms::cImage &im)
convert the field to the image
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)
cVec2 get_bicubicV2(float x, float y)
get the bicubic interpolated value as the 2d-vector
cVec4 get_linearV4(float x, float y)
get the linearly interpolated value as 4d-vector
void sharpResize(ValuesField &dest, float scale)
resize to bigger size keeping the edges sharpness
cVec4 get_bicubicV4(float x, float y)
get the bicubic interpolated value as the 4d-vector
int depth()
Get amount of channels.
Definition ValuesField.h:429
void clear()
clear rthe field
void LaplacianInterpolate(const UnlimitedBitset &fixed)
Interpolates the whole field so that it is maximally smooth (laplacian value minimized) and keeps the...
int height()
get height
Definition ValuesField.h:425
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.
void normalmap(ValuesField &dest, int byChannel=0)
calculate the normalmap
int width()
get width
Definition ValuesField.h:421
void toPower2(ValuesField &dest)
resize to the closest power of 2 (may increase, may decrease the size, we choose what is arithmetical...
void recoverBump(ValuesField &dest)
recover the bump from the color/greyscale (heuristic)
float get_linear(float x, float y, int channel=0) const
get the linearly interpolated value
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
cVec2 get_linearV2(float x, float y)
get the linearly interpolated value as 2d-vector
void saveImage(const char *name)
save the field directly to file
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
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
cVec3 get_linearV3(float x, float y)
get the linearly interpolated value as 3d-vector
void monoTo(ValuesField &dest)
convert multiple channels to one as an average-arithmetic
void resizeTo(ValuesField &dest)
resize the field to other size using the bicubic interpolation
void generatePerlin(float Sharpness)
generate the perlin noise
cVec3 get_bicubicV3(float x, float y)
get the bicubic interpolated value as the 3d-vector
void Decrease2X(ValuesField &dest)
Decrease the field 2X times.
void max(ValuesField &other)
calculated the maximum of two fields into hte current
void createFromImageMono(const comms::cImage &im, Vector3D mask=Vector3D(2.0f/9.0f, 6.0f/9.0f, 1.0f/9.0f))
create the monochromatic field from the image (1 channel)
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 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