Quote:
Originally posted by sh0dan
Would it make more sense to overload GetPitch, and make different types, so it could return even more types of pitches?
[EDIT]"Full planar" is still possible, since the enums just could be expanded - perhaps the GetPitch should also be like this:
Code:
int GetPitch (BYTE p_channel) const {
switch (p_channel) {
case YV12_CHANNEL_Y:
return pitch;
case YV12_CHANNEL_U:
return uv_pitch;
case YV12_CHANNEL_V:
return uv_pitch;
default:
_ASSERT(FALSE);
}
return uv_pitch;
}
[/B]
|
Yes I think we must use the same trick on GetReadPtr, GetPitch and even GetRowSize and GetHeight.
And it must also be the same with GetWritePtr. About GetWritePtr I think we will be obliged to provide standard function to copy one plane as Bitblt will copy the three planes.
@MarcFD
I globally agree with your code example (althought I prefer uv_pitch than pitch2
).
But IMHO height2 and rowsize2 are not usefull as
height2 = height/2 and
rowsize2 = rowsize/2
Instead we need specific offset for U and V plane (to crop and keep correct alignment).
I'll have to think more about it.