-
Notifications
You must be signed in to change notification settings - Fork 3
/
PixelFormat.cpp
39 lines (35 loc) · 1.05 KB
/
PixelFormat.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2009,2010,2011,2012 GlavSoft LLC.
// All rights reserved.
//
//-------------------------------------------------------------------------
// This file is part of the TightVNC software. Please visit our Web site:
//
// http://www.tightvnc.com/
//
// This program is free software; you can redistribute it and/or modify
#include "PixelFormat.h"
#include <string.h>
PixelFormat::PixelFormat()
{
memset(this, 0, sizeof(PixelFormat));
}
void PixelFormat::initBigEndianByNative()
{
union {
char test;
int i;
} testBigEndian;
testBigEndian.i = 1;
bigEndian = (testBigEndian.test == 0);
}
bool PixelFormat::isEqualTo(const PixelFormat *pf) const {
return bitsPerPixel == pf->bitsPerPixel &&
colorDepth == pf->colorDepth &&
redMax == pf->redMax &&
greenMax == pf->greenMax &&
blueMax == pf->blueMax &&
redShift == pf->redShift &&
greenShift == pf->greenShift &&
blueShift == pf->blueShift &&
bigEndian == pf->bigEndian;
}