Changeset View
Changeset View
Standalone View
Standalone View
commands/kpCommandSize.cpp
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 55 | { | |||
---|---|---|---|---|---|
57 | int roundedDepth = (depth > 8 ? (depth + 7) / 8 * 8 : depth); | 57 | int roundedDepth = (depth > 8 ? (depth + 7) / 8 * 8 : depth); | ||
58 | kpCommandSize::SizeType ret = | 58 | kpCommandSize::SizeType ret = | ||
59 | static_cast<kpCommandSize::SizeType> (width) * height * roundedDepth / 8; | 59 | static_cast<kpCommandSize::SizeType> (width) * height * roundedDepth / 8; | ||
60 | 60 | | |||
61 | qCDebug(kpLogCommands) << "kpCommandSize::PixmapSize() w=" << width | 61 | qCDebug(kpLogCommands) << "kpCommandSize::PixmapSize() w=" << width | ||
62 | << " h=" << height | 62 | << " h=" << height | ||
63 | << " d=" << depth | 63 | << " d=" << depth | ||
64 | << " roundedDepth=" << roundedDepth | 64 | << " roundedDepth=" << roundedDepth | ||
65 | << " ret=" << ret | 65 | << " ret=" << ret; | ||
66 | << endl; | | |||
67 | return ret; | 66 | return ret; | ||
68 | } | 67 | } | ||
69 | 68 | | |||
70 | 69 | | |||
71 | // public static | 70 | // public static | ||
72 | kpCommandSize::SizeType kpCommandSize::QImageSize (const QImage &image) | 71 | kpCommandSize::SizeType kpCommandSize::QImageSize (const QImage &image) | ||
73 | { | 72 | { | ||
74 | return kpCommandSize::QImageSize (image.width (), image.height (), image.depth ()); | 73 | return kpCommandSize::QImageSize (image.width (), image.height (), image.depth ()); | ||
Show All 12 Lines | 84 | { | |||
87 | int roundedDepth = (depth > 8 ? (depth + 7) / 8 * 8 : depth); | 86 | int roundedDepth = (depth > 8 ? (depth + 7) / 8 * 8 : depth); | ||
88 | kpCommandSize::SizeType ret = | 87 | kpCommandSize::SizeType ret = | ||
89 | static_cast<kpCommandSize::SizeType> (width) * height * roundedDepth / 8; | 88 | static_cast<kpCommandSize::SizeType> (width) * height * roundedDepth / 8; | ||
90 | 89 | | |||
91 | qCDebug(kpLogCommands) << "kpCommandSize::QImageSize() w=" << width | 90 | qCDebug(kpLogCommands) << "kpCommandSize::QImageSize() w=" << width | ||
92 | << " h=" << height | 91 | << " h=" << height | ||
93 | << " d=" << depth | 92 | << " d=" << depth | ||
94 | << " roundedDepth=" << roundedDepth | 93 | << " roundedDepth=" << roundedDepth | ||
95 | << " ret=" << ret | 94 | << " ret=" << ret; | ||
96 | << endl; | | |||
97 | 95 | | |||
98 | return ret; | 96 | return ret; | ||
99 | } | 97 | } | ||
100 | 98 | | |||
101 | 99 | | |||
102 | // public static | 100 | // public static | ||
103 | kpCommandSize::SizeType kpCommandSize::ImageSize (const kpImage &image) | 101 | kpCommandSize::SizeType kpCommandSize::ImageSize (const kpImage &image) | ||
104 | { | 102 | { | ||
Show All 20 Lines | |||||
125 | } | 123 | } | ||
126 | 124 | | |||
127 | 125 | | |||
128 | // public static | 126 | // public static | ||
129 | kpCommandSize::SizeType kpCommandSize::StringSize (const QString &string) | 127 | kpCommandSize::SizeType kpCommandSize::StringSize (const QString &string) | ||
130 | { | 128 | { | ||
131 | qCDebug(kpLogCommands) << "kpCommandSize::StringSize(" << string << ")" | 129 | qCDebug(kpLogCommands) << "kpCommandSize::StringSize(" << string << ")" | ||
132 | << " len=" << string.length () | 130 | << " len=" << string.length () | ||
133 | << " sizeof(QChar)=" << sizeof (QChar) | 131 | << " sizeof(QChar)=" << sizeof (QChar); | ||
134 | << endl; | | |||
135 | return static_cast<SizeType> (static_cast<unsigned int> (string.length ()) * sizeof (QChar)); | 132 | return static_cast<SizeType> (static_cast<unsigned int> (string.length ()) * sizeof (QChar)); | ||
136 | } | 133 | } | ||
137 | 134 | | |||
138 | 135 | | |||
139 | // public static | 136 | // public static | ||
140 | kpCommandSize::SizeType kpCommandSize::PolygonSize (const QPolygon &points) | 137 | kpCommandSize::SizeType kpCommandSize::PolygonSize (const QPolygon &points) | ||
141 | { | 138 | { | ||
142 | qCDebug(kpLogCommands) << "kpCommandSize::PolygonSize() points.size=" | 139 | qCDebug(kpLogCommands) << "kpCommandSize::PolygonSize() points.size=" | ||
143 | << points.size () | 140 | << points.size () | ||
144 | << " sizeof(QPoint)=" << sizeof (QPoint) | 141 | << " sizeof(QPoint)=" << sizeof (QPoint); | ||
145 | << endl; | | |||
146 | 142 | | |||
147 | return static_cast<SizeType> (static_cast<unsigned int> (points.size ()) * sizeof (QPoint)); | 143 | return static_cast<SizeType> (static_cast<unsigned int> (points.size ()) * sizeof (QPoint)); | ||
148 | } | 144 | } | ||
149 | 145 | |