Thread: Avisynth+
View Single Post
Old 24th June 2016, 08:46   #1813  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,297
Honestly, about interface, evolution does the job only half, to do thing properly to the end, i would have put all the pitch in ptrdiff_t. If you have to break existing things, break it for a full good purpose, not half. And also the Getpitch functions should return the same.
But, i agree about something. These critical datas shouldn't have been public, and should be accessed only via functions.

Well, personnaly, i would have done :
Code:
class VideoFrame {
public:
	volatile long refcount;
	VideoFrameBuffer* const vfb;
	const size_t offset;
	const ptrdiff_t pitch;
	const uint32_t row_size;
	const int32_t height;
	const size_t offsetU, offsetV;  // U&V offsets are from top of picture.
	const ptrdiff_t pitchUV;
	const uint32t row_sizeUV;
	const int32_t heightUV;

Last edited by jpsdr; 24th June 2016 at 09:02.
jpsdr is offline