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 #include "MooseConfig.h"
12 #ifdef MOOSE_HAVE_LIBPNG
13 
14 // pnglib includes
15 #include <png.h>
16 // MOOSE includes
17 #include "FileOutput.h"
18 #include "MooseEnum.h"
19 // libmesh includes
20 #include "libmesh/mesh_function.h"
21 #include "libmesh/bounding_box.h"
22 
23 class PNGOutput : public FileOutput
24 {
25 public:
28 
30 
31 protected:
33  void setRGB(png_byte * rgb, Real selection);
34 
36  void makeMeshFunc();
37 
40 
42  Real applyScale(Real value_to_scale);
43 
45  Real reverseScale(Real value_to_unscale);
46 
48  void makePNG();
49 
51  virtual void output();
52 
54  const unsigned int _resolution;
55 
58 
61 
64 
66  std::unique_ptr<libMesh::MeshFunction> _mesh_function;
67 
69  BoundingBox _box;
70 
73  unsigned int _nl_sys_num;
74 
76  VariableName _variable;
77 
82 
87 
90 };
91 
92 #endif
unsigned int _nl_sys_num
What nonlinear system the variable is in.
Definition: PNGOutput.h:73
Real _min
Definition: PNGOutput.h:81
void makePNG()
Function that creates the PNG.
Definition: PNGOutput.C:328
std::unique_ptr< libMesh::MeshFunction > _mesh_function
Pointer to the libMesh::MeshFunction object in which the read data is stored.
Definition: PNGOutput.h:66
const MooseEnum _color
Way to specify color vs grayscale image creation.
Definition: PNGOutput.h:57
void makeMeshFunc()
Function to create the mesh_function.
Definition: PNGOutput.C:68
static InputParameters validParams()
Basic constructor. Takes parameters passed in to create a PNGOutput object.
Definition: PNGOutput.C:23
const bool _transparent_background
Indicates whether to make the background transparent.
Definition: PNGOutput.h:60
Real reverseScale(Real value_to_unscale)
Function for reversing the applyScale function.
Definition: PNGOutput.C:180
Real _out_bounds_shade
Value of the colors that are outside of the libmesh bounds.
Definition: PNGOutput.h:89
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:129
const unsigned int _resolution
Variable to determine the size, or resolution, of the image.
Definition: PNGOutput.h:54
const Real _transparency
Controls transparency level for the general image.
Definition: PNGOutput.h:63
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:85
Real _max
Variables that store the max and min of the values in the variable used.
Definition: PNGOutput.h:80
Real _shift_value
Definition: PNGOutput.h:86
Real applyScale(Real value_to_scale)
Function for applying scaling to given values.
Definition: PNGOutput.C:172
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _scaling_min
Values used for rescaling the image.
Definition: PNGOutput.h:84
BoundingBox _box
The boundaries of the image.
Definition: PNGOutput.h:69
VariableName _variable
The name of the variable to use to create the png.
Definition: PNGOutput.h:76
PNGOutput(const InputParameters &parameters)
Definition: PNGOutput.C:52
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:187
virtual void output()
Called to run the functions in this class.
Definition: PNGOutput.C:316