https://mooseframework.inl.gov
PNGOutput.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 #pragma once
10 
11 #ifdef MOOSE_HAVE_LIBPNG
12 
13 // pnglib includes
14 #include <png.h>
15 // MOOSE includes
16 #include "FileOutput.h"
17 #include "MooseEnum.h"
18 // libmesh includes
19 #include "libmesh/mesh_function.h"
20 #include "libmesh/bounding_box.h"
21 
22 class PNGOutput : public FileOutput
23 {
24 public:
27 
29 
30 protected:
32  void setRGB(png_byte * rgb, Real selection);
33 
35  void makeMeshFunc();
36 
39 
41  Real applyScale(Real value_to_scale);
42 
44  Real reverseScale(Real value_to_unscale);
45 
47  void makePNG();
48 
50  virtual void output();
51 
53  const unsigned int _resolution;
54 
57 
60 
63 
65  std::unique_ptr<libMesh::MeshFunction> _mesh_function;
66 
68  BoundingBox _box;
69 
72  unsigned int _nl_sys_num;
73 
75  VariableName _variable;
76 
81 
86 
89 };
90 
91 #endif
unsigned int _nl_sys_num
What nonlinear system the variable is in.
Definition: PNGOutput.h:72
Real _min
Definition: PNGOutput.h:80
void makePNG()
Function that creates the PNG.
Definition: PNGOutput.C:327
std::unique_ptr< libMesh::MeshFunction > _mesh_function
Pointer to the libMesh::MeshFunction object in which the read data is stored.
Definition: PNGOutput.h:65
const MooseEnum _color
Way to specify color vs grayscale image creation.
Definition: PNGOutput.h:56
void makeMeshFunc()
Function to create the mesh_function.
Definition: PNGOutput.C:67
static InputParameters validParams()
Basic constructor. Takes parameters passed in to create a PNGOutput object.
Definition: PNGOutput.C:22
const bool _transparent_background
Indicates whether to make the background transparent.
Definition: PNGOutput.h:59
Real reverseScale(Real value_to_unscale)
Function for reversing the applyScale function.
Definition: PNGOutput.C:179
Real _out_bounds_shade
Value of the colors that are outside of the libmesh bounds.
Definition: PNGOutput.h:88
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void calculateRescalingValues()
Function to populate values to the variables used for scaling.
Definition: PNGOutput.C:128
const unsigned int _resolution
Variable to determine the size, or resolution, of the image.
Definition: PNGOutput.h:53
const Real _transparency
Controls transparency level for the general image.
Definition: PNGOutput.h:62
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
Real _scaling_max
Definition: PNGOutput.h:84
Real _max
Variables that store the max and min of the values in the variable used.
Definition: PNGOutput.h:79
Real _shift_value
Definition: PNGOutput.h:85
Real applyScale(Real value_to_scale)
Function for applying scaling to given values.
Definition: PNGOutput.C:171
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _scaling_min
Values used for rescaling the image.
Definition: PNGOutput.h:83
BoundingBox _box
The boundaries of the image.
Definition: PNGOutput.h:68
VariableName _variable
The name of the variable to use to create the png.
Definition: PNGOutput.h:75
PNGOutput(const InputParameters &parameters)
Definition: PNGOutput.C:51
const InputParameters & parameters() const
Get the parameters of the object.
An outputter with filename support.
Definition: FileOutput.h:20
void setRGB(png_byte *rgb, Real selection)
Method for assigning color values to the PNG.
Definition: PNGOutput.C:186
virtual void output()
Called to run the functions in this class.
Definition: PNGOutput.C:315