Cleanup
This commit is contained in:
@@ -73,7 +73,7 @@ function inpaint_node_get_as_image(self: inpaint_node_t, from: i32): image_t {
|
||||
console_progress(tr("Processing") + " - " + tr("Inpaint"));
|
||||
|
||||
g2_begin(inpaint_node_image);
|
||||
g2_draw_scaled_image(source, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(source, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
|
||||
if (inpaint_node_auto) {
|
||||
@@ -146,7 +146,7 @@ function inpaint_node_sd_inpaint(image: image_t, mask: image_t): image_t {
|
||||
|
||||
g2_begin(inpaint_node_temp);
|
||||
// g2_drawImage(image, -x * 512, -y * 512);
|
||||
g2_draw_scaled_image(image, 0, 0, 512, 512);
|
||||
draw_scaled_image(image, 0, 0, 512, 512);
|
||||
g2_end();
|
||||
|
||||
bytes_img = image_get_pixels(inpaint_node_temp);
|
||||
|
||||
@@ -58,13 +58,13 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
|
||||
let y: i32 = math_floor(i / tiles_x);
|
||||
|
||||
g2_begin(photo_to_pbr_node_temp);
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, -config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, config_get_texture_res_x(), -config_get_texture_res_y());
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, -config_get_texture_res_x(), -config_get_texture_res_y());
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, -config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, config_get_texture_res_x(), -config_get_texture_res_y());
|
||||
g2_draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, -config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, config_get_texture_res_x(), -config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, -config_get_texture_res_x(), -config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, -config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w + photo_to_pbr_node_tile_w, config_get_texture_res_x(), -config_get_texture_res_y());
|
||||
draw_scaled_image(source, photo_to_pbr_node_border_w - x * photo_to_pbr_node_tile_w, photo_to_pbr_node_border_w - y * photo_to_pbr_node_tile_w, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
|
||||
let bytes_img: buffer_t = image_get_pixels(photo_to_pbr_node_temp);
|
||||
@@ -155,7 +155,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
|
||||
|
||||
let temp2: image_t = image_from_bytes(u8a, photo_to_pbr_node_tile_w, photo_to_pbr_node_tile_w);
|
||||
g2_begin(photo_to_pbr_node_images[from]);
|
||||
g2_draw_image(temp2, x * photo_to_pbr_node_tile_w, y * photo_to_pbr_node_tile_w);
|
||||
draw_image(temp2, x * photo_to_pbr_node_tile_w, y * photo_to_pbr_node_tile_w);
|
||||
g2_end();
|
||||
app_notify_on_next_frame(function(temp2: image_t) {
|
||||
image_unload(temp2);
|
||||
|
||||
@@ -46,7 +46,7 @@ function tiling_node_button(node_id: i32) {
|
||||
function tiling_node_get_as_image(self: tiling_node_t, from: i32): image_t {
|
||||
let source: image_t = logic_node_input_get_as_image(self.base.inputs[0]);
|
||||
g2_begin(tiling_node_image);
|
||||
g2_draw_scaled_image(source, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(source, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
|
||||
console_progress(tr("Processing") + " - " + tr("Tiling"));
|
||||
@@ -68,10 +68,10 @@ function tiling_node_sd_tiling(image: image_t, seed: i32): image_t {
|
||||
text_to_photo_node_tiling = false;
|
||||
let tile: image_t = image_create_render_target(512, 512);
|
||||
g2_begin(tile);
|
||||
g2_draw_scaled_image(image, -256, -256, 512, 512);
|
||||
g2_draw_scaled_image(image, 256, -256, 512, 512);
|
||||
g2_draw_scaled_image(image, -256, 256, 512, 512);
|
||||
g2_draw_scaled_image(image, 256, 256, 512, 512);
|
||||
draw_scaled_image(image, -256, -256, 512, 512);
|
||||
draw_scaled_image(image, 256, -256, 512, 512);
|
||||
draw_scaled_image(image, -256, 256, 512, 512);
|
||||
draw_scaled_image(image, 256, 256, 512, 512);
|
||||
g2_end();
|
||||
|
||||
let u8a: u8_array_t = u8_array_create(512 * 512);
|
||||
|
||||
@@ -51,7 +51,7 @@ function upscale_node_do_tile(source: image_t): image_t {
|
||||
}
|
||||
upscale_node_temp = image_create_render_target(size1w, size1h);
|
||||
g2_begin(upscale_node_temp);
|
||||
g2_draw_scaled_image(source, 0, 0, size1w, size1h);
|
||||
draw_scaled_image(source, 0, 0, size1w, size1h);
|
||||
g2_end();
|
||||
|
||||
let bytes_img: buffer_t = image_get_pixels(upscale_node_temp);
|
||||
@@ -106,17 +106,17 @@ function upscale_node_esrgan(source: image_t): image_t {
|
||||
for (let x: i32 = 0; x < math_floor(size1w / tile_size); ++x) {
|
||||
for (let y: i32 = 0; y < math_floor(size1h / tile_size); ++y) {
|
||||
g2_begin(tile_source);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, -source.width, source.height);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, source.width, -source.height);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, -source.width, -source.height);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size + tile_size, 32 - y * tile_size + tile_size, source.width, source.height);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size + tile_size, 32 - y * tile_size + tile_size, -source.width, source.height);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size + tile_size, 32 - y * tile_size + tile_size, source.width, -source.height);
|
||||
g2_draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, source.width, source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, -source.width, source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, source.width, -source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, -source.width, -source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size + tile_size, 32 - y * tile_size + tile_size, source.width, source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size + tile_size, 32 - y * tile_size + tile_size, -source.width, source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size + tile_size, 32 - y * tile_size + tile_size, source.width, -source.height);
|
||||
draw_scaled_image(source, 32 - x * tile_size, 32 - y * tile_size, source.width, source.height);
|
||||
g2_end();
|
||||
let tile_result: image_t = upscale_node_do_tile(tile_source);
|
||||
g2_begin(result);
|
||||
g2_draw_sub_image(tile_result, x * tile_size2x, y * tile_size2x, 64, 64, tile_size2x, tile_size2x);
|
||||
draw_sub_image(tile_result, x * tile_size2x, y * tile_size2x, 64, 64, tile_size2x, tile_size2x);
|
||||
g2_end();
|
||||
image_unload(tile_result);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ function variance_node_get_as_image(self: variance_node_t, from: i32): image_t {
|
||||
|
||||
let source: image_t = logic_node_input_get_as_image(variance_node_inst.base.inputs[0]);
|
||||
g2_begin(variance_node_temp);
|
||||
g2_draw_scaled_image(source, 0, 0, 512, 512);
|
||||
draw_scaled_image(source, 0, 0, 512, 512);
|
||||
g2_end();
|
||||
|
||||
let bytes_img: buffer_t = image_get_pixels(variance_node_temp);
|
||||
|
||||
@@ -48,14 +48,14 @@ function ui_nodes_ext_run() {
|
||||
if (texbase != null) {
|
||||
let texpaint: render_target_t = map_get(render_path_render_targets, "texpaint");
|
||||
g2_begin(texpaint._image);
|
||||
g2_draw_scaled_image(texbase, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(texbase, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
}
|
||||
|
||||
if (texnor != null) {
|
||||
let texpaint_nor: render_target_t = map_get(render_path_render_targets, "texpaint_nor");
|
||||
g2_begin(texpaint_nor._image);
|
||||
g2_draw_scaled_image(texnor, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(texnor, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ function ui_nodes_ext_run() {
|
||||
if (texocc != null) {
|
||||
g2_begin(texpaint_pack._image);
|
||||
g2_set_pipeline(pipes_copy_r);
|
||||
g2_draw_scaled_image(texocc, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(texocc, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_set_pipeline(null);
|
||||
g2_end();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ function ui_nodes_ext_run() {
|
||||
if (texrough != null) {
|
||||
g2_begin(texpaint_pack._image);
|
||||
g2_set_pipeline(pipes_copy_g);
|
||||
g2_draw_scaled_image(texrough, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_scaled_image(texrough, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_set_pipeline(null);
|
||||
g2_end();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user