ReactOS 0.4.16-dev-2332-g4cba65d
pcfutil.c File Reference
#include "pcfutil.h"
Include dependency graph for pcfutil.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 BitOrderInvert (unsigned char *buf, size_t nbytes)
 
 TwoByteSwap (unsigned char *buf, size_t nbytes)
 
 FourByteSwap (unsigned char *buf, size_t nbytes)
 

Function Documentation

◆ BitOrderInvert()

BitOrderInvert ( unsigned char buf,
size_t  nbytes 
)

Definition at line 43 of file pcfutil.c.

45 {
46 for ( ; nbytes > 0; nbytes--, buf++ )
47 {
48 unsigned int val = *buf;
49
50
51 val = ( ( val >> 1 ) & 0x55 ) | ( ( val << 1 ) & 0xAA );
52 val = ( ( val >> 2 ) & 0x33 ) | ( ( val << 2 ) & 0xCC );
53 val = ( ( val >> 4 ) & 0x0F ) | ( ( val << 4 ) & 0xF0 );
54
55 *buf = (unsigned char)val;
56 }
57 }
unsigned char
Definition: typeof.h:29
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLfloat * val
Definition: glext.h:7180

Referenced by PCF_Glyph_Load().

◆ FourByteSwap()

FourByteSwap ( unsigned char buf,
size_t  nbytes 
)

Definition at line 84 of file pcfutil.c.

86 {
87 for ( ; nbytes >= 4; nbytes -= 4, buf += 4 )
88 {
89 unsigned char c;
90
91
92 c = buf[0];
93 buf[0] = buf[3];
94 buf[3] = c;
95
96 c = buf[1];
97 buf[1] = buf[2];
98 buf[2] = c;
99 }
100 }
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80

Referenced by PCF_Glyph_Load().

◆ TwoByteSwap()

TwoByteSwap ( unsigned char buf,
size_t  nbytes 
)

Definition at line 65 of file pcfutil.c.

67 {
68 for ( ; nbytes >= 2; nbytes -= 2, buf += 2 )
69 {
70 unsigned char c;
71
72
73 c = buf[0];
74 buf[0] = buf[1];
75 buf[1] = c;
76 }
77 }

Referenced by PCF_Glyph_Load().