Package rope.core

Class Rope

java.lang.Object
rope.core.Rope
All Implemented Interfaces:
R_Constants, R_Constants_Colour
Direct Known Subclasses:
BigBang, R_Colour, R_Nubo, R_Pix

public class Rope extends Object implements R_Constants, R_Constants_Colour
  • Constructor Details

    • Rope

      public Rope()
  • Method Details

    • map

      public float map(float value, float start1, float stop1, float start2, float stop2)
      map method
      Parameters:
      value - value must be compute
      start1 - min range value of the starting field
      stop1 - max range value of the starting field
      start2 - min range value of the final field
      stop2 - max range value of the final field
      Returns:
      result of the scale map operation
    • random

      public float random(float low, float high)
      Parameters:
      low - define value min for the random
      high - define value max for the random
      Returns:
      random number, this method is a copy of Processing one
    • random_next_gaussian

      public float random_next_gaussian(int n)
      Parameters:
      n - the num of operation must iterate each operation is mult by the previous result
      Returns:
      random value
    • random_next_gaussian

      public float random_next_gaussian(float range)
      Parameters:
      range - define value max for the random
      Returns:
      random value
    • random_next_gaussian

      public float random_next_gaussian(float range, int n)
      Parameters:
      range - represente the max value possible from 0 to this value.
      n - the num of operation must iterate each operation is mult by the previous result
      Returns:
      random value
    • max

      public float max(float... list)
      Parameters:
      list - list of arguments must be sorted
      Returns:
      the max value of the list
    • min

      public float min(float... list)
      Parameters:
      list - list of arguments must be sorted
      Returns:
      the min value of the list
    • mix

      public float mix(float x, float y, float a)
      Parameters:
      x - elem to mix
      y - elem to mix
      a - mixer element
      Returns:
      the mix result
      See Also:
    • mix

      public vec2 mix(vec2 x, vec2 y, vec2 a)
    • mix

      public vec3 mix(vec3 x, vec3 y, vec3 a)
    • mix

      public vec4 mix(vec4 x, vec4 y, vec4 a)
    • fract

      public float fract(float x)
      Parameters:
      x - value to fract
      Returns:
      fract result
      See Also:
    • fract

      public vec2 fract(vec2 v)
    • fract

      public vec3 fract(vec3 v)
    • fract

      public vec4 fract(vec4 v)
    • sign

      public float sign(float x)
      Parameters:
      x - value who find sign
      Returns:
      value -1, 0 or 1
      See Also:
    • sign

      public vec2 sign(vec2 x)
    • sign

      public vec3 sign(vec3 x)
    • sign

      public vec4 sign(vec4 x)
    • sign

      public int sign(int x)
    • sign

      public ivec2 sign(ivec2 x)
    • sign

      public ivec3 sign(ivec3 x)
    • sign

      public ivec4 sign(ivec4 x)
    • step

      public float step(float edge, float x)
      Parameters:
      x - value to smooth
      edge - the smooth edge
      Returns:
      the result of the operation
      See Also:
    • step

      public vec2 step(vec2 edge, vec2 x)
    • step

      public vec3 step(vec3 edge, vec3 x)
    • step

      public vec4 step(vec4 edge, vec4 x)
    • smoothstep

      public float smoothstep(float edge0, float edge1, float x)
      Parameters:
      x - value to smooth
      edge0 - the smooth first edge
      edge1 - the smooth second edge
      Returns:
      the result of the operation
      See Also:
    • smoothstep

      public vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x)
    • smoothstep

      public vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x)
    • smoothstep

      public vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x)
    • mod

      public float mod(float x, float y)
      Parameters:
      x - value to mod
      y - value to mod
      Returns:
      result of operation
      See Also:
    • mod

      public vec2 mod(vec2 x, vec2 y)
    • mod

      public vec3 mod(vec3 x, vec3 y)
    • mod

      public vec4 mod(vec4 x, vec4 y)
    • mod

      public ivec2 mod(ivec2 x, ivec2 y)
    • mod

      public ivec3 mod(ivec3 x, ivec3 y)
    • mod

      public ivec4 mod(ivec4 x, ivec4 y)
    • clamp

      public float clamp(float x, float min, float max)
      Parameters:
      x - value to clamp
      min - the min value available
      max - the max value available
      Returns:
      reslut of operation
      See Also:
    • clamp

      public vec2 clamp(vec2 x, vec2 min, vec2 max)
    • clamp

      public vec3 clamp(vec3 x, vec3 min, vec3 max)
    • clamp

      public vec4 clamp(vec4 x, vec4 min, vec4 max)
    • equal

      public boolean equal(float x, float y)
      Parameters:
      x - float value to test
      y - float value to test
      Returns:
      true if x equal to y
      See Also:
    • equal

      public boolean equal(int x, int y)
    • equal

      public bvec2 equal(vec2 x, vec2 y)
    • equal

      public bvec3 equal(vec3 x, vec3 y)
    • equal

      public bvec4 equal(vec4 x, vec4 y)
    • equal

      public bvec2 equal(ivec2 x, ivec2 y)
    • equal

      public bvec3 equal(ivec3 x, ivec3 y)
    • equal

      public bvec4 equal(ivec4 x, ivec4 y)
    • lessThan

      public boolean lessThan(float x, float y)
      Parameters:
      x - float value to test
      y - float value to test
      Returns:
      true if x inferior to y
      See Also:
    • lessThan

      public boolean lessThan(int x, int y)
    • lessThan

      public bvec2 lessThan(vec2 x, vec2 y)
    • lessThan

      public bvec3 lessThan(vec3 x, vec3 y)
    • lessThan

      public bvec4 lessThan(vec4 x, vec4 y)
    • lessThan

      public bvec2 lessThan(ivec2 x, ivec2 y)
    • lessThan

      public bvec3 lessThan(ivec3 x, ivec3 y)
    • lessThan

      public bvec4 lessThan(ivec4 x, ivec4 y)
    • greaterThan

      public boolean greaterThan(float x, float y)
      Parameters:
      x - float value to test
      y - float value to test
      Returns:
      true if x superior to y
    • greaterThan

      public boolean greaterThan(int x, int y)
    • greaterThan

      public bvec2 greaterThan(vec2 x, vec2 y)
    • greaterThan

      public bvec3 greaterThan(vec3 x, vec3 y)
    • greaterThan

      public bvec4 greaterThan(vec4 x, vec4 y)
    • greaterThan

      public bvec2 greaterThan(ivec2 x, ivec2 y)
    • greaterThan

      public bvec3 greaterThan(ivec3 x, ivec3 y)
    • greaterThan

      public bvec4 greaterThan(ivec4 x, ivec4 y)
    • greaterThanEqual

      public boolean greaterThanEqual(float x, float y)
      Parameters:
      x - float value to test
      y - float value to test
      Returns:
      true if x superior or equal to y
      See Also:
    • greaterThanEqual

      public boolean greaterThanEqual(int x, int y)
    • greaterThanEqual

      public bvec2 greaterThanEqual(vec2 x, vec2 y)
    • greaterThanEqual

      public bvec3 greaterThanEqual(vec3 x, vec3 y)
    • greaterThanEqual

      public bvec4 greaterThanEqual(vec4 x, vec4 y)
    • greaterThanEqual

      public bvec2 greaterThanEqual(ivec2 x, ivec2 y)
    • greaterThanEqual

      public bvec3 greaterThanEqual(ivec3 x, ivec3 y)
    • greaterThanEqual

      public bvec4 greaterThanEqual(ivec4 x, ivec4 y)
    • lessThanEqual

      public boolean lessThanEqual(float x, float y)
      Parameters:
      x - float value to test
      y - float value to test
      Returns:
      true if x inferior or equal to y
      See Also:
    • lessThanEqual

      public boolean lessThanEqual(int x, int y)
    • lessThanEqual

      public bvec2 lessThanEqual(vec2 x, vec2 y)
    • lessThanEqual

      public bvec3 lessThanEqual(vec3 x, vec3 y)
    • lessThanEqual

      public bvec4 lessThanEqual(vec4 x, vec4 y)
    • lessThanEqual

      public bvec2 lessThanEqual(ivec2 x, ivec2 y)
    • lessThanEqual

      public bvec3 lessThanEqual(ivec3 x, ivec3 y)
    • lessThanEqual

      public bvec4 lessThanEqual(ivec4 x, ivec4 y)
    • all

      public boolean all(bvec b)
      Parameters:
      b - bvec value to test
      Returns:
      true only if all components of x are true.
      See Also:
    • all

      public boolean all(boolean... list)
      Parameters:
      list -
      Returns:
      true if all elments of the list is true
    • any

      public boolean any(bvec b)
      Parameters:
      b - bvec value to test https://www.khronos.org/registry/OpenGL/specs/gl
      Returns:
      true if any component of x is true.
    • any

      public boolean any(boolean... list)
      Parameters:
      list - boolean list value to test
      Returns:
      return true if any element of the list is true
    • only

      public boolean only(bvec b)
      Parameters:
      b - bvec value to test
      Returns:
      true is only one elements of the list is true
    • only

      public boolean only(boolean... list)
    • index_pixel_array

      public int index_pixel_array(int x, int y, int width)
      Parameters:
      x - coordinate x
      y - coordinate y
      width - the width of you 2D array pixel
      Returns:
      a linear position from a 2D array tab
    • truncate

      public float truncate(float x)
    • truncate

      public float truncate(float x, int num)
      Parameters:
      x - value to work
      num - after coma to display
      Returns:
      a float number with a number after comma equal to the num arg
    • hex

      public String hex(byte value)
    • hex

      public String hex(char value)
    • hex

      public String hex(int value)
    • hex

      public String hex(int value, int digits)
      Parameters:
      value - value to convert
      digits - the number of digits (maximum 8)
      Returns:
      String hexadecimal value
    • unhex

      public int unhex(String value)
      Converts a Stringrepresentation of a hexadecimal number to its equivalent integer value.
      Parameters:
      value - value to convert
      Returns:
      unhexadecimal int value
    • binary

      public String binary(byte value)
    • binary

      public String binary(char value)
    • binary

      public String binary(int value)
    • binary

      public String binary(int value, int digits)
      Converts an int, byte, char, or color to a String containing the equivalent binary notation. For example, the color value produced by color(0, 102, 153, 255) will convert to the String value "11111111000000000110011010011001". This function can help make your geeky debugging sessions much happier. Note that the maximum number of digits is 32, because an int value can only represent up to 32 bits. Specifying more than 32 digits will have no effect. .
      Parameters:
      value - value to convert
      digits - number of digits to return
      Returns:
      String binary
    • unbinary

      public int unbinary(String value)
    • split

      public String[] split(String value, char delim)
      Parameters:
      value -
      delim -
      Returns:
    • split

      public String[] split(String value, String delim)
      Parameters:
      value - is the sentence must be spited
      delim - is a separator
      Returns:
      array String of the String argument sentence
    • file_name

      public String file_name(String file_path)
      remove the path of your String to return the file name of it.
      Parameters:
      file_path -
      Returns:
    • get_os

      public String get_os()
      Returns:
      the current os
    • get_os_family

      public String get_os_family()
      Returns:
      the current os family
    • extension

      public String extension(String filename)
      Parameters:
      filename - check the last part of String path to return the extension if there is one
      Returns:
      the extension of the file
    • extension_is

      public boolean extension_is(String filename, String... extension)
      Parameters:
      filename - check the last part of String path return true at the first extension who match
      extension - list of extension must be check;
      Returns: