ReactOS  0.4.15-dev-499-g1f31905
pcfutil.c File Reference
#include <ft2build.h>
#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 44 of file pcfutil.c.

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

Referenced by PCF_Glyph_Load().

◆ FourByteSwap()

FourByteSwap ( unsigned char buf,
size_t  nbytes 
)

Definition at line 85 of file pcfutil.c.

87  {
88  for ( ; nbytes >= 4; nbytes -= 4, buf += 4 )
89  {
90  unsigned char c;
91 
92 
93  c = buf[0];
94  buf[0] = buf[3];
95  buf[3] = c;
96 
97  c = buf[1];
98  buf[1] = buf[2];
99  buf[2] = c;
100  }
101  }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
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 66 of file pcfutil.c.

68  {
69  for ( ; nbytes >= 2; nbytes -= 2, buf += 2 )
70  {
71  unsigned char c;
72 
73 
74  c = buf[0];
75  buf[0] = buf[1];
76  buf[1] = c;
77  }
78  }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80

Referenced by PCF_Glyph_Load().