mirror of
https://github.com/wang-bin/QtAV.git
synced 2026-10-25 09:23:23 +08:00
effective and padded line sizes for a video frame
This commit is contained in:
+13
-3
@@ -258,12 +258,16 @@ int VideoFrame::height() const
|
||||
return d_func()->height;
|
||||
}
|
||||
|
||||
int VideoFrame::effectivePlaneWidth(int plane) const
|
||||
{
|
||||
Q_D(const VideoFrame);
|
||||
return effectiveBytesPerLine(plane)/d->format.bytesPerPixel(plane);
|
||||
}
|
||||
|
||||
int VideoFrame::planeWidth(int plane) const
|
||||
{
|
||||
Q_D(const VideoFrame);
|
||||
if (plane == 0)
|
||||
return d->width;
|
||||
return d->format.chromaWidth(d->width);
|
||||
return bytesPerLine(plane)/d->format.bytesPerPixel(plane);
|
||||
}
|
||||
|
||||
int VideoFrame::planeHeight(int plane) const
|
||||
@@ -274,6 +278,12 @@ int VideoFrame::planeHeight(int plane) const
|
||||
return d->format.chromaHeight(d->height);
|
||||
}
|
||||
|
||||
int VideoFrame::effectiveBytesPerLine(int plane) const
|
||||
{
|
||||
Q_D(const VideoFrame);
|
||||
return d->format.bytesPerLine(width(), plane);
|
||||
}
|
||||
|
||||
void VideoFrame::setImageConverter(ImageConverter *conv)
|
||||
{
|
||||
d_func()->conv = conv;
|
||||
|
||||
Reference in New Issue
Block a user