diff --git a/framework/doc/content/source/outputs/png/PNGOutput.md b/framework/doc/content/source/outputs/png/PNGOutput.md new file mode 100644 index 000000000000..3143f8e5bbfb --- /dev/null +++ b/framework/doc/content/source/outputs/png/PNGOutput.md @@ -0,0 +1,18 @@ +# PNGOutput (Outputs) + +The PNGOutput object is the class for writing png files from the input files. + +Following is an example of all the different input variables that can be used. + +``` +[Outputs] + [png] + type = PNGOutput + transparent = true #indicates whether the background will be transparent + resolution = 50 #resolution of each point + color = RWB #indicates which color scheme to use (required) + out_bounds_shade = .5 #value from 0-1 indicating shade to use as background + transparency = 1 #value from 0(transparent)-1(opaque) for image. + [] +[] +``` diff --git a/framework/include/outputs/PNGOutput.h b/framework/include/outputs/png/PNGOutput.h similarity index 95% rename from framework/include/outputs/PNGOutput.h rename to framework/include/outputs/png/PNGOutput.h index 75ea58505c78..3d9f4862320f 100644 --- a/framework/include/outputs/PNGOutput.h +++ b/framework/include/outputs/png/PNGOutput.h @@ -61,7 +61,9 @@ class PNGOutput : public FileOutput MooseEnum _color; // Indicates whether to make the background transparent. - bool _transparent; + bool _transparent_background; + + // Controls transparency level for the general image. Real _transparency; /// Pointer the libMesh::MeshFunction object that the read data is stored diff --git a/framework/src/outputs/PNGOutput.C b/framework/src/outputs/png/PNGOutput.C similarity index 96% rename from framework/src/outputs/PNGOutput.C rename to framework/src/outputs/png/PNGOutput.C index e8e4793936db..8d466d6a0f63 100644 --- a/framework/src/outputs/PNGOutput.C +++ b/framework/src/outputs/png/PNGOutput.C @@ -22,9 +22,10 @@ InputParameters validParams() { InputParameters params = validParams(); - params.addParam( - "transparent", true, "Determination of whether the background will be transparent."); - params.addParam("resolution", 2000, "The resolution of the image."); + params.addParam("transparent_background", + false, + "Determination of whether the background will be transparent."); + params.addParam("resolution", 1, "The resolution of the image."); MooseEnum color("GRAY BRYW BCR RWB BR"); params.addParam("color", color, "Choose the color scheme to use."); params.addRangeCheckedParam("out_bounds_shade", @@ -46,7 +47,7 @@ PNGOutput::PNGOutput(const InputParameters & parameters) : FileOutput(parameters), _resolution(getParam("resolution")), _color(parameters.get("color")), - _transparent(getParam("transparent")), + _transparent_background(getParam("transparent_background")), _transparency(getParam("transparency")), _out_bounds_shade(getParam("out_bounds_shade")) { @@ -60,7 +61,7 @@ PNGOutput::makeMeshFunc() const std::vector var_nums = {0}; // If we want the background to be transparent, we need a number over 1. - if (_transparent) + if (_transparent_background) _out_bounds_shade = 2; // Find the values that will be used for rescaling purposes. calculateRescalingValues(); diff --git a/test/tests/outputs/png/adv_diff_reaction_test.i b/test/tests/outputs/png/adv_diff_reaction_test.i index c973688bb72d..b0dbefb89b92 100644 --- a/test/tests/outputs/png/adv_diff_reaction_test.i +++ b/test/tests/outputs/png/adv_diff_reaction_test.i @@ -115,7 +115,7 @@ [Outputs] [png] type = PNGOutput - resolution = 250 + resolution = 1 color = BCR [] [] diff --git a/test/tests/outputs/png/adv_diff_reaction_transient_test.i b/test/tests/outputs/png/adv_diff_reaction_transient_test.i index d5b127724776..61e1b1ec061e 100644 --- a/test/tests/outputs/png/adv_diff_reaction_transient_test.i +++ b/test/tests/outputs/png/adv_diff_reaction_transient_test.i @@ -127,7 +127,7 @@ [Outputs] [png] type = PNGOutput - resolution = 250 + resolution = 1 color = RWB [] [] diff --git a/test/tests/outputs/png/simple_transient_diffusion.i b/test/tests/outputs/png/simple_transient_diffusion.i index 1aa43ae2d7ef..c9a493b3c263 100644 --- a/test/tests/outputs/png/simple_transient_diffusion.i +++ b/test/tests/outputs/png/simple_transient_diffusion.i @@ -49,7 +49,7 @@ [Outputs] [png] type = PNGOutput - resolution = 250 + resolution = 1 color = RWB [] [] diff --git a/test/tests/outputs/png/tests b/test/tests/outputs/png/tests index 223190375e46..36b4efdd396b 100644 --- a/test/tests/outputs/png/tests +++ b/test/tests/outputs/png/tests @@ -2,6 +2,7 @@ [adv_diff_reaction] type = 'CheckFiles' input = 'adv_diff_reaction_test.i' + design = 'PNGOutput.md' check_files = 'adv_diff_reaction_test_png_001.png' issues = '#12846' requirement = 'MOOSE shall be able to produce png images' @@ -9,6 +10,7 @@ [simple_transient_diff] type = 'CheckFiles' input = 'simple_transient_diffusion.i' + design = 'PNGOutput.md' check_files = 'simple_transient_diffusion_png_001.png' issues = '#12846' requirement = 'MOOSE shall be able to produce png images' @@ -16,6 +18,7 @@ [wedge] type = 'CheckFiles' input = 'wedge.i' + design = 'PNGOutput.md' check_files = 'wedge_png_001.png' issues = '#12846' requirement = 'MOOSE shall be able to produce png images' diff --git a/test/tests/outputs/png/wedge.i b/test/tests/outputs/png/wedge.i index 02f423853df0..400eb55635d9 100644 --- a/test/tests/outputs/png/wedge.i +++ b/test/tests/outputs/png/wedge.i @@ -72,8 +72,7 @@ [Outputs] [png] type = PNGOutput - resolution = 500 - transparency = 1 + resolution = 1 color = RWB [] []