Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TASPngWriter.h
Go to the documentation of this file.
1#ifndef ROOT_TASPngWriter
2#define ROOT_TASPngWriter
3
4#include <string_view>
5#include <vector>
6
8 int width = 0;
9 int height = 0;
10 unsigned char color_type = 0;
11 unsigned char bit_depth = 8;
12 std::vector<unsigned char *> row_pointers;
13
14public:
15 TASPngWriter() = default;
16 TASPngWriter(int w, int h, unsigned char t = 2, unsigned char d = 8)
18 {
19 }
20
21 void set_type(bool is_rgb, bool has_alpha)
22 {
23 color_type = is_rgb ? 2 : 0;
24 if (has_alpha)
25 color_type |= 4;
26 }
27 void set_luminance() { color_type = 0; }
29 void set_rgb() { color_type = 2; }
30 void set_rgba() { color_type = 6; }
31
32 std::vector<unsigned char *> &ref_row_pointers() { return row_pointers; }
33
34 int write_png_file(std::string_view filename);
35};
36
37#endif
#define d(i)
Definition RSha256.hxx:102
#define h(i)
Definition RSha256.hxx:106
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
C++ wrapper over simple writer of PNG files for standard GL memory formats: LUMINANCE,...
Definition TASPngWriter.h:7
void set_luminance_alpha()
unsigned char bit_depth
unsigned char color_type
std::vector< unsigned char * > & ref_row_pointers()
std::vector< unsigned char * > row_pointers
void set_luminance()
void set_type(bool is_rgb, bool has_alpha)
TASPngWriter()=default
TASPngWriter(int w, int h, unsigned char t=2, unsigned char d=8)
int write_png_file(std::string_view filename)
void set_rgba()