37 static const int32_t gnMAX_IMAGE_SIZE_BYTES = 1024*1024*100;
59 for(
int i = 0; i < anWidth*anHeight;) {
60 mpDataVector[i++] = ((apData[cntr] & (0x00000FFF)));
61 mpDataVector[i++] = ((apData[cntr] & (0x00FFF000)) >> 12);
62 mpDataVector[i++] = ((apData[cntr] & (0xFF000000)) >> 24) | ((apData[cntr + 1] & (0x0000000F)) << 8);
64 mpDataVector[i++] = ((apData[cntr] & (0x0000FFF0)) >> 4);
65 mpDataVector[i++] = ((apData[cntr] & (0x0FFF0000)) >> 16);
66 mpDataVector[i++] = ((apData[cntr] & (0xF0000000)) >> 28) | ((apData[cntr + 1] & (0x000000FF)) << 4);
68 mpDataVector[i++] = ((apData[cntr] & (0x000FFF00)) >> 8);
69 mpDataVector[i++] = ((apData[cntr] & (0xFFF00000)) >> 20);
92 for(
int i = 0; i < anWidth*anHeight; i++) {
95 word = ((apData[cntr] & (0x0FFF)));
96 }
else if(method == 1) {
98 word = ((apData[cntr] & (0xF000)) >> 12) | ((apData[cntr + 1] & (0xFF)) << 4);
100 }
else if(method == 2) {
101 word = ((apData[cntr] & (0xFF00)) >> 8) | ((apData[cntr + 1] & (0xF)) << 8);
103 }
else if(method == 3) {
104 word = ((apData[cntr] & (0xFFF0)) >> 4);
107 method = (method + 1) % 4;
109 mpDataVector[i] = word;
123 void alloc_and_unpack(
unsigned char* apData, int32_t anWidth,
130 int num_bytes =
sizeof(uint16_t)*anWidth*anHeight;
131 mpDataVector = (uint16_t*)malloc(num_bytes);
133 memcpy(mpDataVector, apData, num_bytes);
139 int num_bytes =
sizeof(uint16_t)*anWidth*anHeight;
140 mpDataVector = (uint16_t*)malloc(num_bytes);
142 unpack16bit((uint16_t*)apData, anWidth, anHeight);
151 int num_bytes =
sizeof(uint8_t)*anWidth*anHeight;
152 mpDataVector = (uint16_t*)malloc(num_bytes);
154 memcpy(mpDataVector, apData, num_bytes);
177 bool abHasHeader =
false)
178 : mnWidth(anWidth), mnHeight(anHeight), mbOwnData(anNumBytes)
180 unsigned char* lpData = (
unsigned char*)apAddr;
189 memset(&msFrameHeader, 0,
sizeof(msFrameHeader));
191 mpDataVector = (
reinterpret_cast<uint16 *
>(lpData));
197 alloc_and_unpack(lpData, mnWidth, mnHeight, aePacking);
211 unsigned char* lpData = (
unsigned char*)apAddr;
217 if (mnWidth * mnHeight * 2 <= gnMAX_IMAGE_SIZE_BYTES)
218 alloc_and_unpack(lpData, mnWidth, mnHeight, aePacking);
244 return (uint8_t*)mpDataVector;
248 return (
const uint8_t*)mpDataVector;
272 return msFrameHeader;