gem5  v20.1.0.0
Classes | Public Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
PngWriter Class Reference

Image writer implementing support for PNG. More...

#include <pngwriter.hh>

Inheritance diagram for PngWriter:
ImgWriter

Classes

struct  PngPixel24
 Png Pixel type: not containing padding. More...
 
struct  PngStructHandle
 

Public Member Functions

 PngWriter (const FrameBuffer *_fb)
 Create a png that takes data in a given mode & size and outputs to an ostream. More...
 
 ~PngWriter ()
 
const char * getImgExtension () const override
 Return Image format as a string. More...
 
void write (std::ostream &png) const override
 Write the frame buffer data into the provided ostream. More...
 
- Public Member Functions inherited from ImgWriter
 ImgWriter (const FrameBuffer *_fb)
 
virtual ~ImgWriter ()
 

Private Types

typedef PngPixel24 PixelType
 

Private Attributes

struct PngWriter::PngPixel24 M5_ATTR_PACKED
 

Static Private Attributes

static const char * _imgExtension = "png"
 

Additional Inherited Members

- Protected Attributes inherited from ImgWriter
const FrameBufferfb
 

Detailed Description

Image writer implementing support for PNG.

Definition at line 50 of file pngwriter.hh.

Member Typedef Documentation

◆ PixelType

Definition at line 100 of file pngwriter.hh.

Constructor & Destructor Documentation

◆ PngWriter()

PngWriter::PngWriter ( const FrameBuffer _fb)
inline

Create a png that takes data in a given mode & size and outputs to an ostream.

Definition at line 57 of file pngwriter.hh.

◆ ~PngWriter()

PngWriter::~PngWriter ( )
inline

Definition at line 61 of file pngwriter.hh.

Member Function Documentation

◆ getImgExtension()

const char* PngWriter::getImgExtension ( ) const
inlineoverridevirtual

Return Image format as a string.

Returns
img extension (e.g. .png for Png)

Implements ImgWriter.

Definition at line 68 of file pngwriter.hh.

References _imgExtension.

◆ write()

void PngWriter::write ( std::ostream &  png) const
overridevirtual

Write the frame buffer data into the provided ostream.

Parameters
pngstream to write to

Implements ImgWriter.

Definition at line 112 of file pngwriter.cc.

References FrameBuffer::area(), ImgWriter::fb, FrameBuffer::height(), FrameBuffer::pixel(), PngWriter::PngStructHandle::pngInfoP, PngWriter::PngStructHandle::pngWriteP, warn, ArmISA::width, FrameBuffer::width(), writePng(), and RiscvISA::x.

Member Data Documentation

◆ _imgExtension

const char * PngWriter::_imgExtension = "png"
staticprivate

Definition at line 104 of file pngwriter.hh.

Referenced by getImgExtension().

◆ M5_ATTR_PACKED

struct PngWriter::PngPixel24 PngWriter::M5_ATTR_PACKED
private

The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:29 for gem5 by doxygen 1.8.17