Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TASPngWriter.cxx
Go to the documentation of this file.
1#include "TASPngWriter.h"
2
3#include <afterrootpngwrite.h>
4
5#include <cerrno>
6
7/** \class TASPngWriter
8\ingroup asimage
9
10C++ wrapper over simple writer of PNG files for standard GL memory formats:
11LUMINANCE, LUMINANCE_ALPHA, RGB, and RGBA.
12*/
13
15{
16 if ((int)row_pointers.size() != height)
17 return 1;
18
19 FILE *fp = fopen(filename.data(), "wb");
20 if (!fp)
21 return errno;
22
23 int ret = after_root_png_write(fp, width, height, color_type, bit_depth, row_pointers.data());
24 if (ret)
25 return ret;
26
27 fclose(fp);
28
29 return 0;
30}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
unsigned char bit_depth
unsigned char color_type
std::vector< unsigned char * > row_pointers
int write_png_file(std::string_view filename)