Cleanup
This commit is contained in:
@@ -72,9 +72,9 @@ function inpaint_node_get_as_image(self: inpaint_node_t, from: i32): iron_g5_tex
|
||||
let source: iron_g5_texture_t = logic_node_input_get_as_image(self.base.inputs[0]);
|
||||
console_progress(tr("Processing") + " - " + tr("Inpaint"));
|
||||
|
||||
g2_begin(inpaint_node_image);
|
||||
draw_begin(inpaint_node_image);
|
||||
draw_scaled_image(source, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
draw_end();
|
||||
|
||||
if (inpaint_node_auto) {
|
||||
return inpaint_node_texsynth_inpaint(inpaint_node_image, false, inpaint_node_mask);
|
||||
@@ -144,10 +144,10 @@ function inpaint_node_sd_inpaint(image: iron_g5_texture_t, mask: iron_g5_texture
|
||||
}
|
||||
}
|
||||
|
||||
g2_begin(inpaint_node_temp);
|
||||
draw_begin(inpaint_node_temp);
|
||||
// g2_drawImage(image, -x * 512, -y * 512);
|
||||
draw_scaled_image(image, 0, 0, 512, 512);
|
||||
g2_end();
|
||||
draw_end();
|
||||
|
||||
bytes_img = iron_g4_get_texture_pixels(inpaint_node_temp);
|
||||
let u8a: buffer_t = bytes_img;
|
||||
|
||||
@@ -57,7 +57,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
|
||||
let x: i32 = i % tiles_x;
|
||||
let y: i32 = math_floor(i / tiles_x);
|
||||
|
||||
g2_begin(photo_to_pbr_node_temp);
|
||||
draw_begin(photo_to_pbr_node_temp);
|
||||
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());
|
||||
@@ -65,7 +65,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
|
||||
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();
|
||||
draw_end();
|
||||
|
||||
let bytes_img: buffer_t = iron_g4_get_texture_pixels(photo_to_pbr_node_temp);
|
||||
let u8a: buffer_t = bytes_img;
|
||||
@@ -154,9 +154,9 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i
|
||||
///end
|
||||
|
||||
let temp2: iron_g5_texture_t = iron_g4_create_texture_from_bytes(u8a, photo_to_pbr_node_tile_w, photo_to_pbr_node_tile_w);
|
||||
g2_begin(photo_to_pbr_node_images[from]);
|
||||
draw_begin(photo_to_pbr_node_images[from]);
|
||||
draw_image(temp2, x * photo_to_pbr_node_tile_w, y * photo_to_pbr_node_tile_w);
|
||||
g2_end();
|
||||
draw_end();
|
||||
app_notify_on_next_frame(function(temp2: iron_g5_texture_t) {
|
||||
iron_unload_image(temp2);
|
||||
}, temp2);
|
||||
|
||||
@@ -45,9 +45,9 @@ function tiling_node_button(node_id: i32) {
|
||||
|
||||
function tiling_node_get_as_image(self: tiling_node_t, from: i32): iron_g5_texture_t {
|
||||
let source: iron_g5_texture_t = logic_node_input_get_as_image(self.base.inputs[0]);
|
||||
g2_begin(tiling_node_image);
|
||||
draw_begin(tiling_node_image);
|
||||
draw_scaled_image(source, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
draw_end();
|
||||
|
||||
console_progress(tr("Processing") + " - " + tr("Tiling"));
|
||||
|
||||
@@ -67,12 +67,12 @@ function tiling_node_get_cached_image(self: tiling_node_t): iron_g5_texture_t {
|
||||
function tiling_node_sd_tiling(image: iron_g5_texture_t, seed: i32): iron_g5_texture_t {
|
||||
text_to_photo_node_tiling = false;
|
||||
let tile: iron_g5_texture_t = iron_g4_create_render_target(512, 512);
|
||||
g2_begin(tile);
|
||||
draw_begin(tile);
|
||||
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();
|
||||
draw_end();
|
||||
|
||||
let u8a: u8_array_t = u8_array_create(512 * 512);
|
||||
for (let i: i32 = 0; i < 512 * 512; ++i) {
|
||||
|
||||
@@ -50,9 +50,9 @@ function upscale_node_do_tile(source: iron_g5_texture_t): iron_g5_texture_t {
|
||||
iron_unload_image(upscale_node_temp);
|
||||
}
|
||||
upscale_node_temp = iron_g4_create_render_target(size1w, size1h);
|
||||
g2_begin(upscale_node_temp);
|
||||
draw_begin(upscale_node_temp);
|
||||
draw_scaled_image(source, 0, 0, size1w, size1h);
|
||||
g2_end();
|
||||
draw_end();
|
||||
|
||||
let bytes_img: buffer_t = iron_g4_get_texture_pixels(upscale_node_temp);
|
||||
let u8a: u8_array_t = bytes_img;
|
||||
@@ -105,7 +105,7 @@ function upscale_node_esrgan(source: iron_g5_texture_t): iron_g5_texture_t {
|
||||
let tile_source: iron_g5_texture_t = iron_g4_create_render_target(tile_size + 32 * 2, tile_size + 32 * 2);
|
||||
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);
|
||||
draw_begin(tile_source);
|
||||
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);
|
||||
@@ -113,11 +113,11 @@ function upscale_node_esrgan(source: iron_g5_texture_t): iron_g5_texture_t {
|
||||
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();
|
||||
draw_end();
|
||||
let tile_result: iron_g5_texture_t = upscale_node_do_tile(tile_source);
|
||||
g2_begin(result);
|
||||
draw_begin(result);
|
||||
draw_sub_image(tile_result, x * tile_size2x, y * tile_size2x, 64, 64, tile_size2x, tile_size2x);
|
||||
g2_end();
|
||||
draw_end();
|
||||
iron_unload_image(tile_result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ function variance_node_get_as_image(self: variance_node_t, from: i32): iron_g5_t
|
||||
let strength: f32 = node.value;
|
||||
|
||||
let source: iron_g5_texture_t = logic_node_input_get_as_image(variance_node_inst.base.inputs[0]);
|
||||
g2_begin(variance_node_temp);
|
||||
draw_begin(variance_node_temp);
|
||||
draw_scaled_image(source, 0, 0, 512, 512);
|
||||
g2_end();
|
||||
draw_end();
|
||||
|
||||
let bytes_img: buffer_t = iron_g4_get_texture_pixels(variance_node_temp);
|
||||
let u8a: u8_array_t = bytes_img;
|
||||
|
||||
@@ -47,34 +47,34 @@ function ui_nodes_ext_run() {
|
||||
|
||||
if (texbase != null) {
|
||||
let texpaint: render_target_t = map_get(render_path_render_targets, "texpaint");
|
||||
g2_begin(texpaint._image);
|
||||
draw_begin(texpaint._image);
|
||||
draw_scaled_image(texbase, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
draw_end();
|
||||
}
|
||||
|
||||
if (texnor != null) {
|
||||
let texpaint_nor: render_target_t = map_get(render_path_render_targets, "texpaint_nor");
|
||||
g2_begin(texpaint_nor._image);
|
||||
draw_begin(texpaint_nor._image);
|
||||
draw_scaled_image(texnor, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
g2_end();
|
||||
draw_end();
|
||||
}
|
||||
|
||||
let texpaint_pack: render_target_t = map_get(render_path_render_targets, "texpaint_pack");
|
||||
|
||||
if (texocc != null) {
|
||||
g2_begin(texpaint_pack._image);
|
||||
draw_begin(texpaint_pack._image);
|
||||
draw_set_pipeline(pipes_copy_r);
|
||||
draw_scaled_image(texocc, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_set_pipeline(null);
|
||||
g2_end();
|
||||
draw_end();
|
||||
}
|
||||
|
||||
if (texrough != null) {
|
||||
g2_begin(texpaint_pack._image);
|
||||
draw_begin(texpaint_pack._image);
|
||||
draw_set_pipeline(pipes_copy_g);
|
||||
draw_scaled_image(texrough, 0, 0, config_get_texture_res_x(), config_get_texture_res_y());
|
||||
draw_set_pipeline(null);
|
||||
g2_end();
|
||||
draw_end();
|
||||
}
|
||||
|
||||
if (texheight != null) {
|
||||
|
||||
Reference in New Issue
Block a user