Fix image byte extraction macros
This commit is contained in:
parent
ecfcf994c6
commit
2513b54e71
@ -21,11 +21,11 @@
|
|||||||
#define gdispImageGetVar(type, p, idx) (*(type *)(((uint8_t *)(p))+(idx)))
|
#define gdispImageGetVar(type, p, idx) (*(type *)(((uint8_t *)(p))+(idx)))
|
||||||
#define gdispImageGetByte(type, p, idx, shift) (((type)gdispImageGetVar(uint8_t, p, idx))<<(shift))
|
#define gdispImageGetByte(type, p, idx, shift) (((type)gdispImageGetVar(uint8_t, p, idx))<<(shift))
|
||||||
#define gdispImageSwap16(w) ((((uint16_t)(w))>>8)|(((uint16_t)(w))<<8))
|
#define gdispImageSwap16(w) ((((uint16_t)(w))>>8)|(((uint16_t)(w))<<8))
|
||||||
#define gdispImageSwap32(dw) ((((uint32_t)(w))>>24)|((((uint32_t)(w))&0x00FF0000)>>8)\
|
#define gdispImageSwap32(dw) ((((uint32_t)(dw))>>24)|((((uint32_t)(dw))&0x00FF0000)>>8)\
|
||||||
|((((uint32_t)(w))&0x0000FF00)<<8)|(((uint32_t)(w))<<24))
|
|((((uint32_t)(dw))&0x0000FF00)<<8)|(((uint32_t)(dw))<<24))
|
||||||
#define gdispImageSwapWords32(dw) ((((uint32_t)(w))>>16)|(((uint32_t)(w))<<16))
|
#define gdispImageSwapWords32(dw) ((((uint32_t)(dw))>>16)|(((uint32_t)(dw))<<16))
|
||||||
#define gdispImageSwapBytes32(dw) (((((uint32_t)(w))&0xFF000000)>>8)|((((uint32_t)(w))&0x00FF0000)<<8)\
|
#define gdispImageSwapBytes32(dw) (((((uint32_t)(dw))&0xFF000000)>>8)|((((uint32_t)(dw))&0x00FF0000)<<8)\
|
||||||
|((((uint32_t)(w))&0x0000FF00)>>8)|(((uint32_t)(w))<<8))
|
|((((uint32_t)(dw))&0x0000FF00)>>8)|(((uint32_t)(dw))<<8))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get a uint16_t/uint32_t from memory in the required endianness.
|
* Get a uint16_t/uint32_t from memory in the required endianness.
|
||||||
@ -120,7 +120,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user