MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / init

Method init

common/Frame.cpp:65–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64
65void Frame::init(rrframeheader &h, int pixelFormat, int flags_, bool stereo_)
66{
67 if(pixelFormat < 0 || pixelFormat >= PIXELFORMATS)
68 throw(Error("Frame::init", "Invalid argument"));
69
70 flags = flags_;
71 PF *newpf = pf_get(pixelFormat);
72 if(h.size == 0) h.size = h.framew * h.frameh * newpf->size;
73 checkHeader(h);
74 if(h.framew != hdr.framew || h.frameh != hdr.frameh
75 || newpf->size != pf->size || !bits)
76 {
77 delete [] bits;
78 bits = new unsigned char[h.framew * h.frameh * newpf->size + 1];
79 }
80 if(stereo_)
81 {
82 if(h.framew != hdr.framew || h.frameh != hdr.frameh
83 || newpf->size != pf->size || !rbits)
84 {
85 delete [] rbits;
86 rbits = new unsigned char[h.framew * h.frameh * newpf->size + 1];
87 }
88 }
89 else
90 {
91 delete [] rbits; rbits = NULL;
92 }
93 pf = newpf; pitch = pf->size * h.framew; stereo = stereo_; hdr = h;
94}
95
96
97void Frame::init(unsigned char *bits_, int width, int pitch_, int height,

Callers 4

CompressorClass · 0.45
dotestMethod · 0.45
makeAnaglyphMethod · 0.45
rgbBenchFunction · 0.45

Calls 5

pf_getFunction · 0.85
XOpenDisplayFunction · 0.85
getenvFunction · 0.85
fbxv_initFunction · 0.85
ErrorClass · 0.50

Tested by

no test coverage detected