Qt 4.8
Public Functions | List of all members
Tga16Reader Struct Reference
Inheritance diagram for Tga16Reader:
TgaReader

Public Functions

QRgb operator() (QIODevice *s) const
 
 ~Tga16Reader ()
 
- Public Functions inherited from TgaReader
virtual ~TgaReader ()
 

Detailed Description

Definition at line 54 of file qtgafile.cpp.

Constructors and Destructors

◆ ~Tga16Reader()

Tga16Reader::~Tga16Reader ( )
inline

Definition at line 56 of file qtgafile.cpp.

56 {}

Functions

◆ operator()()

QRgb Tga16Reader::operator() ( QIODevice s) const
inlinevirtual

Implements TgaReader.

Definition at line 57 of file qtgafile.cpp.

58  {
59  char ch1, ch2;
60  if (s->getChar(&ch1) && s->getChar(&ch2)) {
61  quint16 d = (int(ch1) & 0xFF) | ((int(ch2) & 0xFF) << 8);
62  QRgb result = (d & 0x8000) ? 0xFF000000 : 0x00000000;
63  result |= (d & 0x7C00 << 6) | (d & 0x03E0 << 3) | (d & 0x001F);
64  return result;
65  } else {
66  return 0;
67  }
68  }
double d
Definition: qnumeric_p.h:62
unsigned int QRgb
Definition: qrgb.h:53
bool getChar(char *c)
Reads one character from the device and stores it in c.
Definition: qiodevice.cpp:1536
unsigned short quint16
Definition: qglobal.h:936

The documentation for this struct was generated from the following file: