#include <string>
#include <vector>
Go to the source code of this file.
|
| void | strToUI (const std::string &m, std::vector< unsigned int > &v) |
| void | UITostr (std::string &n, std::vector< unsigned int >::const_iterator &i, bool bugcompat) |
| void | bitmapToUI (const std::vector< bool > &m, std::vector< unsigned int > &v) |
| void | UITobitmap (std::vector< bool > &n, std::vector< unsigned int >::const_iterator &i, bool bugcompat) |
◆ bitmapToUI()
| void bitmapToUI |
( |
const std::vector< bool > & | m, |
|
|
std::vector< unsigned int > & | v ) |
Definition at line 85 of file vectorize.cxx.
85 {
86 unsigned short l =
m.size();
87 int rem=16;
91 rem -=1;
93
94 if (rem==0) {
97 rem=32;
98 }
99 }
100 if(rem!=32)
v.push_back(t);
101}
l
Printing final latex table to .tex output file.
◆ strToUI()
| void strToUI |
( |
const std::string & | m, |
|
|
std::vector< unsigned int > & | v ) |
Definition at line 9 of file vectorize.cxx.
9 {
10 unsigned short l = (
unsigned short)
m.size();
11 v.reserve(
v.size() + (
unsigned int)((2. + l) / 4. + 0.9));
13 unsigned int rem = 16;
15
16 for (
unsigned int w = 0;
w <
l;
w++)
17 if (rem){
18 t |=
m[
w] % 255 << (rem - 8);
19 rem -= 8;
20 }else{
23 rem = 24;
24 t |=
m[
w] % 255 << rem;
25 }
27}
◆ UITobitmap()
| void UITobitmap |
( |
std::vector< bool > & | n, |
|
|
std::vector< unsigned int >::const_iterator & | i, |
|
|
bool | bugcompat ) |
Definition at line 103 of file vectorize.cxx.
106{
110 int rem = 16;
111 for (
int w=0;
w<
l;
w++){
112 rem -=1;
113 n.push_back((*i)>>rem & 0x1);
114
115 if(rem==0){
117 rem=32;
118 }
119 }
121
122 if (bugcompat && l > 32 && (l%32) == 16) {
125 }
126}
◆ UITostr()
| void UITostr |
( |
std::string & | n, |
|
|
std::vector< unsigned int >::const_iterator & | i, |
|
|
bool | bugcompat ) |
Definition at line 29 of file vectorize.cxx.
30 {
32
35 int rem = 16;
36
38 if(rem){
39 rem-=8;
40 short o = (*i) >> rem & 0xff;
42 }else{
44 rem = 24;
45 short o = (*i) >> rem & 0xff;
47 }
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 if (bugcompat && l > 2 && (l%4) == 2)
71 {
72 bool ok = true;
73 for (int j = 0; ok && j < 4; j++) {
75 if (!std::isprint(c) && c != '\n' && c != '\t' && c != '\r')
76 ok = false;
77 }
78 if (!ok) {
81 }
82 }
83}