Qt
6.x
The Qt SDK
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Symbols
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Loading...
Searching...
No Matches
qhaikuutils.cpp
Go to the documentation of this file.
1
// Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig <tobias.koenig@kdab.com>
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 "
qhaikuutils.h
"
5
6
color_space
QHaikuUtils::imageFormatToColorSpace
(
QImage::Format
format
)
7
{
8
color_space colorSpace = B_NO_COLOR_SPACE;
9
switch
(
format
) {
10
case
QImage::Format_Invalid
:
11
colorSpace = B_NO_COLOR_SPACE;
12
break
;
13
case
QImage::Format_MonoLSB
:
14
colorSpace = B_GRAY1;
15
break
;
16
case
QImage::Format_Indexed8
:
17
colorSpace = B_CMAP8;
18
break
;
19
case
QImage::Format_RGB32
:
20
colorSpace = B_RGB32;
21
break
;
22
case
QImage::Format_ARGB32
:
23
colorSpace = B_RGBA32;
24
break
;
25
case
QImage::Format_RGB16
:
26
colorSpace = B_RGB16;
27
break
;
28
case
QImage::Format_RGB555
:
29
colorSpace = B_RGB15;
30
break
;
31
case
QImage::Format_RGB888
:
32
colorSpace = B_RGB24;
33
break
;
34
default
:
35
qWarning
(
"Cannot convert image format %d to color space"
,
format
);
36
Q_ASSERT
(
false
);
37
break
;
38
}
39
40
return
colorSpace;
41
}
42
43
QImage::Format
QHaikuUtils::colorSpaceToImageFormat
(color_space colorSpace)
44
{
45
QImage::Format
format
=
QImage::Format_Invalid
;
46
switch
(colorSpace) {
47
case
B_NO_COLOR_SPACE:
48
format
=
QImage::Format_Invalid
;
49
break
;
50
case
B_GRAY1:
51
format
=
QImage::Format_MonoLSB
;
52
break
;
53
case
B_CMAP8:
54
format
=
QImage::Format_Indexed8
;
55
break
;
56
case
B_RGB32:
57
format
=
QImage::Format_RGB32
;
58
break
;
59
case
B_RGBA32:
60
format
=
QImage::Format_ARGB32
;
61
break
;
62
case
B_RGB16:
63
format
=
QImage::Format_RGB16
;
64
break
;
65
case
B_RGB15:
66
format
=
QImage::Format_RGB555
;
67
break
;
68
case
B_RGB24:
69
format
=
QImage::Format_RGB888
;
70
break
;
71
default
:
72
qWarning
(
"Cannot convert color space %d to image format"
, colorSpace);
73
Q_ASSERT
(
false
);
74
break
;
75
}
76
77
return
format
;
78
}
79
80
QT_END_NAMESPACE
QImage::Format
Format
The following image formats are available in Qt.
Definition
qimage.h:41
QImage::Format_RGB888
@ Format_RGB888
Definition
qimage.h:55
QImage::Format_RGB32
@ Format_RGB32
Definition
qimage.h:46
QImage::Format_Invalid
@ Format_Invalid
Definition
qimage.h:42
QImage::Format_MonoLSB
@ Format_MonoLSB
Definition
qimage.h:44
QImage::Format_RGB555
@ Format_RGB555
Definition
qimage.h:53
QImage::Format_Indexed8
@ Format_Indexed8
Definition
qimage.h:45
QImage::Format_RGB16
@ Format_RGB16
Definition
qimage.h:49
QImage::Format_ARGB32
@ Format_ARGB32
Definition
qimage.h:47
QHaikuUtils::imageFormatToColorSpace
color_space imageFormatToColorSpace(QImage::Format format)
Definition
qhaikuutils.cpp:6
QHaikuUtils::colorSpaceToImageFormat
QImage::Format colorSpaceToImageFormat(color_space colorSpace)
Definition
qhaikuutils.cpp:43
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
qhaikuutils.h
qWarning
#define qWarning
Definition
qlogging.h:162
format
GLint GLsizei GLsizei GLenum format
Definition
qopengles2ext.h:206
Q_ASSERT
#define Q_ASSERT(cond)
Definition
qrandom.cpp:47
qtbase
src
plugins
platforms
haiku
qhaikuutils.cpp
Generated by
1.9.7