|
107 | 107 | #define rustg_cnoise_generate(percentage, smoothing_iterations, birth_limit, death_limit, width, height) \ |
108 | 108 | RUSTG_CALL(RUST_G, "cnoise_generate")(percentage, smoothing_iterations, birth_limit, death_limit, width, height) |
109 | 109 |
|
| 110 | +/** |
| 111 | + * This proc generates a grid of perlin-like noise |
| 112 | + * |
| 113 | + * Returns a single string that goes row by row, with values of 1 representing an turned on cell, and a value of 0 representing a turned off cell. |
| 114 | + * |
| 115 | + * Arguments: |
| 116 | + * * seed: seed for the function |
| 117 | + * * accuracy: how close this is to the original perlin noise, as accuracy approaches infinity, the noise becomes more and more perlin-like |
| 118 | + * * stamp_size: Size of a singular stamp used by the algorithm, think of this as the same stuff as frequency in perlin noise |
| 119 | + * * world_size: size of the returned grid. |
| 120 | + * * lower_range: lower bound of values selected for. (inclusive) |
| 121 | + * * upper_range: upper bound of values selected for. (exclusive) |
| 122 | + */ |
| 123 | +#define rustg_dbp_generate(seed, accuracy, stamp_size, world_size, lower_range, upper_range) \ |
| 124 | + RUSTG_CALL(RUST_G, "dbp_generate")(seed, accuracy, stamp_size, world_size, lower_range, upper_range) |
| 125 | + |
| 126 | + |
110 | 127 | #define rustg_dmi_strip_metadata(fname) RUSTG_CALL(RUST_G, "dmi_strip_metadata")(fname) |
111 | 128 | #define rustg_dmi_create_png(path, width, height, data) RUSTG_CALL(RUST_G, "dmi_create_png")(path, width, height, data) |
112 | 129 | #define rustg_dmi_resize_png(path, width, height, resizetype) RUSTG_CALL(RUST_G, "dmi_resize_png")(path, width, height, resizetype) |
|
159 | 176 |
|
160 | 177 | #define rustg_noise_get_at_coordinates(seed, x, y) RUSTG_CALL(RUST_G, "noise_get_at_coordinates")(seed, x, y) |
161 | 178 |
|
| 179 | +/* |
| 180 | + * Takes in a string and json_encode()"d lists to produce a sanitized string. |
| 181 | + * This function operates on whitelists, there is currently no way to blacklist. |
| 182 | + * Args: |
| 183 | + * * text: the string to sanitize. |
| 184 | + * * attribute_whitelist_json: a json_encode()'d list of HTML attributes to allow in the final string. |
| 185 | + * * tag_whitelist_json: a json_encode()'d list of HTML tags to allow in the final string. |
| 186 | + */ |
| 187 | +#define rustg_sanitize_html(text, attribute_whitelist_json, tag_whitelist_json) RUSTG_CALL(RUST_G, "sanitize_html")(text, attribute_whitelist_json, tag_whitelist_json) |
| 188 | + |
162 | 189 | #define rustg_sql_connect_pool(options) RUSTG_CALL(RUST_G, "sql_connect_pool")(options) |
163 | 190 | #define rustg_sql_query_async(handle, query, params) RUSTG_CALL(RUST_G, "sql_query_async")(handle, query, params) |
164 | 191 | #define rustg_sql_query_blocking(handle, query, params) RUSTG_CALL(RUST_G, "sql_query_blocking")(handle, query, params) |
|
0 commit comments