Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpixelformat.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#include "
qpixelformat.h
"
5
6
QT_BEGIN_NAMESPACE
7
488
static_assert
(
sizeof
(
QPixelFormat
) ==
sizeof
(
quint64
));
489
490
491
namespace
QtPrivate
{
492
QPixelFormat
QPixelFormat_createYUV
(
QPixelFormat::YUVLayout
yuvLayout,
493
uchar
alphaSize,
494
QPixelFormat::AlphaUsage
alphaUsage,
495
QPixelFormat::AlphaPosition
alphaPosition,
496
QPixelFormat::AlphaPremultiplied
premultiplied,
497
QPixelFormat::TypeInterpretation
typeInterpretation,
498
QPixelFormat::ByteOrder
byteOrder)
499
{
500
uchar
bits_per_pixel = 0;
501
switch
(yuvLayout) {
502
case
QPixelFormat::YUV444
:
503
bits_per_pixel = 24;
504
break
;
505
case
QPixelFormat::YUV422
:
506
bits_per_pixel = 16;
507
break
;
508
case
QPixelFormat::YUV411
:
509
case
QPixelFormat::YUV420P
:
510
case
QPixelFormat::YUV420SP
:
511
case
QPixelFormat::YV12
:
512
bits_per_pixel = 12;
513
break
;
514
case
QPixelFormat::UYVY
:
515
case
QPixelFormat::YUYV
:
516
bits_per_pixel = 16;
517
break
;
518
case
QPixelFormat::NV12
:
519
case
QPixelFormat::NV21
:
520
bits_per_pixel = 12;
521
break
;
522
case
QPixelFormat::IMC1
:
523
case
QPixelFormat::IMC2
:
524
case
QPixelFormat::IMC3
:
525
case
QPixelFormat::IMC4
:
526
bits_per_pixel = 12;
527
break
;
528
case
QPixelFormat::Y8
:
529
bits_per_pixel = 8;
530
break
;
531
case
QPixelFormat::Y16
:
532
bits_per_pixel = 16;
533
break
;
534
}
535
536
return
QPixelFormat
(
QPixelFormat::YUV
,
537
0, 0, 0, 0,
538
bits_per_pixel,
539
alphaSize,
540
alphaUsage,
541
alphaPosition,
542
premultiplied,
543
typeInterpretation,
544
byteOrder,
545
yuvLayout);
546
}
547
}
548
549
QT_END_NAMESPACE
QPixelFormat
\inmodule QtGui
Definition
qpixelformat.h:12
QPixelFormat::ByteOrder
ByteOrder
This enum describes the ByteOrder of the pixel format.
Definition
qpixelformat.h:121
QPixelFormat::AlphaPosition
AlphaPosition
This enum type is used to describe the alpha channels position relative to the color channels.
Definition
qpixelformat.h:85
QPixelFormat::AlphaPremultiplied
AlphaPremultiplied
This enum type describes the boolean state if the alpha channel is multiplied into the color channels...
Definition
qpixelformat.h:90
QPixelFormat::TypeInterpretation
TypeInterpretation
This enum describes how each pixel is interpreted.
Definition
qpixelformat.h:95
QPixelFormat::YUVLayout
YUVLayout
YUV is not represented by describing the size of the color channels.
Definition
qpixelformat.h:102
QPixelFormat::UYVY
@ UYVY
Definition
qpixelformat.h:109
QPixelFormat::Y16
@ Y16
Definition
qpixelformat.h:118
QPixelFormat::IMC4
@ IMC4
Definition
qpixelformat.h:116
QPixelFormat::YUV422
@ YUV422
Definition
qpixelformat.h:104
QPixelFormat::YUV444
@ YUV444
Definition
qpixelformat.h:103
QPixelFormat::NV21
@ NV21
Definition
qpixelformat.h:112
QPixelFormat::IMC1
@ IMC1
Definition
qpixelformat.h:113
QPixelFormat::IMC3
@ IMC3
Definition
qpixelformat.h:115
QPixelFormat::YUV420P
@ YUV420P
Definition
qpixelformat.h:106
QPixelFormat::YV12
@ YV12
Definition
qpixelformat.h:108
QPixelFormat::YUV420SP
@ YUV420SP
Definition
qpixelformat.h:107
QPixelFormat::YUYV
@ YUYV
Definition
qpixelformat.h:110
QPixelFormat::NV12
@ NV12
Definition
qpixelformat.h:111
QPixelFormat::YUV411
@ YUV411
Definition
qpixelformat.h:105
QPixelFormat::Y8
@ Y8
Definition
qpixelformat.h:117
QPixelFormat::IMC2
@ IMC2
Definition
qpixelformat.h:114
QPixelFormat::AlphaUsage
AlphaUsage
This enum describes if the alpha channel is used or not.
Definition
qpixelformat.h:80
QPixelFormat::YUV
@ YUV
Definition
qpixelformat.h:76
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
QtPrivate
\macro QT_NO_KEYWORDS >
Definition
qtconcurrentcompilertest.h:13
QtPrivate::QPixelFormat_createYUV
QPixelFormat QPixelFormat_createYUV(QPixelFormat::YUVLayout yuvLayout, uchar alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied, QPixelFormat::TypeInterpretation typeInterpretation, QPixelFormat::ByteOrder byteOrder)
Definition
qpixelformat.cpp:492
qpixelformat.h
uchar
unsigned char uchar
Definition
qtypes.h:32
quint64
unsigned long long quint64
Definition
qtypes.h:61
qtbase
src
gui
kernel
qpixelformat.cpp
Generated by
1.10.0