/* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
rtc::scoped_refptr<VideoFrameBuffer> VideoFrameBuffer::CropAndScale( int offset_x, int offset_y, int crop_width, int crop_height, int scaled_width, int scaled_height) {
rtc::scoped_refptr<I420Buffer> result =
I420Buffer::Create(scaled_width, scaled_height);
result->CropAndScaleFrom(*this->ToI420(), offset_x, offset_y, crop_width,
crop_height); return result;
}
const I420BufferInterface* VideoFrameBuffer::GetI420() const { // Overridden by subclasses that can return an I420 buffer without any // conversion, in particular, I420BufferInterface. return nullptr;
}
constchar* VideoFrameBufferTypeToString(VideoFrameBuffer::Type type) { switch (type) { case VideoFrameBuffer::Type::kNative: return"kNative"; case VideoFrameBuffer::Type::kI420: return"kI420"; case VideoFrameBuffer::Type::kI420A: return"kI420A"; case VideoFrameBuffer::Type::kI444: return"kI444"; case VideoFrameBuffer::Type::kI422: return"kI422"; case VideoFrameBuffer::Type::kI010: return"kI010"; case VideoFrameBuffer::Type::kI210: return"kI210"; case VideoFrameBuffer::Type::kI410: return"kI410"; case VideoFrameBuffer::Type::kNV12: return"kNV12"; default:
RTC_DCHECK_NOTREACHED();
}
}
int I444BufferInterface::ChromaWidth() const { return width();
}
int I444BufferInterface::ChromaHeight() const { return height();
}
rtc::scoped_refptr<VideoFrameBuffer> I444BufferInterface::CropAndScale( int offset_x, int offset_y, int crop_width, int crop_height, int scaled_width, int scaled_height) {
rtc::scoped_refptr<I444Buffer> result =
I444Buffer::Create(scaled_width, scaled_height);
result->CropAndScaleFrom(*this, offset_x, offset_y, crop_width, crop_height); return result;
}
int I422BufferInterface::ChromaHeight() const { return height();
}
rtc::scoped_refptr<VideoFrameBuffer> I422BufferInterface::CropAndScale( int offset_x, int offset_y, int crop_width, int crop_height, int scaled_width, int scaled_height) {
rtc::scoped_refptr<I422Buffer> result =
I422Buffer::Create(scaled_width, scaled_height);
result->CropAndScaleFrom(*this, offset_x, offset_y, crop_width, crop_height); return result;
}
rtc::scoped_refptr<VideoFrameBuffer> NV12BufferInterface::CropAndScale( int offset_x, int offset_y, int crop_width, int crop_height, int scaled_width, int scaled_height) {
rtc::scoped_refptr<NV12Buffer> result =
NV12Buffer::Create(scaled_width, scaled_height);
result->CropAndScaleFrom(*this, offset_x, offset_y, crop_width, crop_height); return result;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.