View Single Post
Old 23rd September 2002, 18:14   #27  |  Link
vlad59
Vlad, the Buffy slayer
 
vlad59's Avatar
 
Join Date: Oct 2001
Location: France
Posts: 445
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.
__________________
Vlad59
Convolution3D for avisynth 2.0X : http://www.hellninjacommando.com/con3d
Convolution3D for avisynth 2.5 : http://www.hellninjacommando.com/con3d/beta

Last edited by vlad59; 23rd September 2002 at 18:33.
vlad59 is offline   Reply With Quote