// // File: sys_txcopy.h // // G A M E.O.N.E - LOW LEVEL LIB V1.0 // Copyright (C) 2001 LEVEL ONE ENTERTAINMENT, // Licensed under the terms of LGPL. //:--------------------------------------------------------------------------- //:Description // // Generic Pixel convertion and copy functions // //:----------------------------------------------------------------------------- // Dieses file in den jeweiligen treibern anpassen // //* WARNUNG */ Dieses File muss im driver.h includiert sein nach // sys_assert und sys_types in den jeweiligen SYS_PLATORM_ bereich #if !defined(SYS_TXCOPY_INCLUDED) #define SYS_TXCOPY_INCLUDED #include // memcpy void txCopy_ARGB_to_ARGB(void *D, void *S, int pixels); void txCopy_ARGB_to_I8(void *D, void *S, int pixels); void txCopy_ARGB_to_RGB332(void *D, void *S, int pixels); void txCopy_ARGB_to_RGB555(void *D, void *S, int pixels); void txCopy_ARGB_to_RGB565(void *D, void *S, int pixels); void txCopy_ARGB_to_RGB888(void *D, void *S, int pixels); void txCopy_I8_to_ARGB(void *D, void *S, int pixels); void txCopy_I8_to_I8(void *D, void *S, int pixels); void txCopy_I8_to_RGB332(void *D, void *S, int pixels); void txCopy_I8_to_RGB555(void *D, void *S, int pixels); void txCopy_I8_to_RGB565(void *D, void *S, int pixels); void txCopy_I8_to_RGB888(void *D, void *S, int pixels); void txCopy_P8_to_ARGB(void *D, void *S, TxU32 *pal, int pixels); void txCopy_P8_to_I8(void *D, void *S, TxU32 *pal, int pixels); void txCopy_P8_to_RGB332(void *D, void *S, TxU32 *pal, int pixels); void txCopy_P8_to_RGB555(void *D, void *S, TxU32 *pal, int pixels); void txCopy_P8_to_RGB565(void *D, void *S, TxU32 *pal, int pixels); void txCopy_P8_to_RGB888(void *D, void *S, TxU32 *pal, int pixels); void txCopy_RGB332_to_ARGB(void *D, void *S, int pixels); void txCopy_RGB332_to_I8(void *D, void *S, int pixels); void txCopy_RGB332_to_RGB332(void *D, void *S, int pixels); void txCopy_RGB332_to_RGB555(void *D, void *S, int pixels); void txCopy_RGB332_to_RGB565(void *D, void *S, int pixels); void txCopy_RGB332_to_RGB888(void *D, void *S, int pixels); void txCopy_RGB555_to_ARGB(void *D, void *S, int pixels); void txCopy_RGB555_to_I8(void *D, void *S, int pixels); void txCopy_RGB555_to_RGB332(void *D, void *S, int pixels); void txCopy_RGB555_to_RGB555(void *D, void *S, int pixels); void txCopy_RGB555_to_RGB565(void *D, void *S, int pixels); void txCopy_RGB555_to_RGB888(void *D, void *S, int pixels); void txCopy_RGB565_to_ARGB(void *D, void *S, int pixels); void txCopy_RGB565_to_I8(void *D, void *S, int pixels); void txCopy_RGB565_to_RGB332(void *D, void *S, int pixels); void txCopy_RGB565_to_RGB555(void *D, void *S, int pixels); void txCopy_RGB565_to_RGB565(void *D, void *S, int pixels); void txCopy_RGB565_to_RGB888(void *D, void *S, int pixels); void txCopy_RGB888_to_ARGB(void *D, void *S, int pixels); void txCopy_RGB888_to_I8(void *D, void *S, int pixels); void txCopy_RGB888_to_RGB332(void *D, void *S, int pixels); void txCopy_RGB888_to_RGB555(void *D, void *S, int pixels); void txCopy_RGB888_to_RGB565(void *D, void *S, int pixels); void txCopy_RGB888_to_RGB888(void *D, void *S, int pixels); void txCopy_RxGxBx_to_ARGB(void *D, void *S, int width, int height); //::36 // +-------------------------+ // | txCopy_ARGB_to_ARGB() | // +-------------------------+ inline void txCopy_ARGB_to_ARGB( void *dst, void *src, int pixels) // Pixel Count { SYS_ASSERT_PTR((TxU8*)src); SYS_ASSERT_PTR((TxU8*)dst); memcpy(dst,src,pixels*4); } //::48 // +-----------------------+ // | txCopy_ARGB_to_I8() | // +-----------------------+ inline void txCopy_ARGB_to_I8( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU32 * SPtr = (TxU32*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = *SPtr; *DPtr = (TxU8) (((argb>>16)&0xFF) * 0.30F + ((argb>>8)&0xFF) * 0.59F + (argb&0xFF) * 0.11F + 0.5F); DPtr++; SPtr++; } } //::37 // +---------------------------+ // | txCopy_ARGB_to_RGB332() | // +---------------------------+ inline void txCopy_ARGB_to_RGB332( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU32 * SPtr = (TxU32*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = *SPtr; *DPtr = (TxU8) ((argb>>16)&0xE0) | (TxU8) ((argb>>11)&0x1C) | (TxU8) ((argb>>6 )&0x03); DPtr++; SPtr++; } } //::38 // +---------------------------+ // | txCopy_ARGB_to_RGB555() | // +---------------------------+ inline void txCopy_ARGB_to_RGB555( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU32 * SPtr = (TxU32*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = *SPtr; *DPtr = (TxU16) ((argb>>9)&0x7C00) | (TxU16) ((argb>>6)&0x03E0) | (TxU16) ((argb>>3)&0x001F); DPtr++; SPtr++; } } //::39 // +---------------------------+ // | txCopy_ARGB_to_RGB565() | // +---------------------------+ inline void txCopy_ARGB_to_RGB565( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU32 * SPtr = (TxU32*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = *SPtr; *DPtr = (TxU16) ((argb>>8)&0xF800) | (TxU16) ((argb>>5)&0x07E0) | (TxU16) ((argb>>3)&0x001F); DPtr++; SPtr++; } } //::40 // +---------------------------+ // | txCopy_ARGB_to_RGB888() | // +---------------------------+ inline void txCopy_ARGB_to_RGB888( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr++ = *SPtr++; *DPtr++ = *SPtr++; *DPtr++ = *SPtr++; SPtr++; } } //::49 // +-----------------------+ // | txCopy_I8_to_ARGB() | // +-----------------------+ inline void txCopy_I8_to_ARGB( void *dst, void *src, int pixels) // Pixel Count { TxU32 * DPtr = (TxU32*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = (TxU32) *SPtr; *DPtr = argb<< 24 | argb<<16 | argb<<8 | argb; DPtr++; SPtr++; } } //::50 // +---------------------+ // | txCopy_I8_to_I8() | // +---------------------+ inline void txCopy_I8_to_I8( void *dst, void *src, int pixels) // Pixel Count { SYS_ASSERT_PTR((TxU8*)src); SYS_ASSERT_PTR((TxU8*)dst); memcpy(dst,src,pixels); } //::51 // +-------------------------+ // | txCopy_I8_to_RGB332() | // +-------------------------+ inline void txCopy_I8_to_RGB332( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU8 argb = *SPtr; *DPtr = (TxU8) (argb&0xE0) | (TxU8) ((argb>>3)&0x1C) | (TxU8) ((argb>>6)&0x03); DPtr++; SPtr++; } } //::52 // +-------------------------+ // | txCopy_I8_to_RGB555() | // +-------------------------+ inline void txCopy_I8_to_RGB555( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU16 argb = (TxU16) *SPtr; *DPtr = (TxU16) ((argb<<7)&0x7C00) | (TxU16) ((argb<<2)&0x03E0) | (TxU16) ((argb>>3)&0x001F); DPtr++; SPtr++; } } //::53 // +-------------------------+ // | txCopy_I8_to_RGB565() | // +-------------------------+ inline void txCopy_I8_to_RGB565( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU16 argb = (TxU16) *SPtr; *DPtr = (TxU16) ((argb<<8)&0xF800) | (TxU16) ((argb<<3)&0x07E0) | (TxU16) ((argb>>3)&0x001F); DPtr++; SPtr++; } } //::54 // +-------------------------+ // | txCopy_I8_to_RGB888() | // +-------------------------+ inline void txCopy_I8_to_RGB888( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr++ = *SPtr; *DPtr++ = *SPtr; *DPtr++ = *SPtr; SPtr++; } } //::21 // +-----------------------+ // | txCopy_P8_to_ARGB() | // +-----------------------+ inline void txCopy_P8_to_ARGB( void *dst, void *src, TxU32 *pal, // Farbpalette pal[256] int pixels) // Pixel Count { SYS_ASSERT_PTR(pal); TxU32 * DPtr = (TxU32*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = pal[ *SPtr ]; DPtr++; SPtr++; } } //::55 // +---------------------+ // | txCopy_P8_to_I8() | // +---------------------+ inline void txCopy_P8_to_I8( void *dst, void *src, TxU32 *pal, // Farbpalette pal[256] int pixels) // Pixel Count { SYS_ASSERT_PTR(pal); TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = pal[ *SPtr ]; *DPtr = (TxU8) (((argb>>16)&0xFF) * 0.30F + ((argb>>8)&0xFF) * 0.59F + (argb&0xFF) * 0.11F + 0.5F); DPtr++; SPtr++; } } //::19 // +-------------------------+ // | txCopy_P8_to_RGB332() | // +-------------------------+ inline void txCopy_P8_to_RGB332( void *dst, void *src, TxU32 *pal, // Farbpalette pal[256] int pixels) // Pixel Count { SYS_ASSERT_PTR(pal); TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = pal[ *SPtr ]; *DPtr = (TxU8) ((argb>>16)&0xE0) | (TxU8) ((argb>>11)&0x1C) | (TxU8) ((argb>>6 )&0x03); DPtr++; SPtr++; } } //::22 // +-------------------------+ // | txCopy_P8_to_RGB555() | // +-------------------------+ inline void txCopy_P8_to_RGB555( void *dst, void *src, TxU32 *pal, // Farbpalette pal[256] int pixels) // Pixel Count { SYS_ASSERT_PTR(pal); TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { TxU32 argb = pal[ *SPtr ]; *DPtr = (TxU16) ((argb>>9)&0x7C00) | (TxU16) ((argb>>6)&0x03E0) | (TxU16) ((argb>>3)&0x001F); DPtr++; SPtr++; } } //::23 // +-------------------------+ // | txCopy_P8_to_RGB565() | // +-------------------------+ inline void txCopy_P8_to_RGB565( void *dst, void *src, TxU32 *pal, // Farbpalette pal[256] int pixels) // Pixel Count { SYS_ASSERT_PTR(pal); TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(SPtr); SYS_ASSERT_PTR(DPtr); while( pixels-- > 0 ) { TxU32 argb = pal[ *SPtr ]; *DPtr = (TxU16) ((argb>>8)&0xF800) | (TxU16) ((argb>>5)&0x07E0) | (TxU16) ((argb>>3)&0x001F); DPtr++; SPtr++; } } //::24 // +-------------------------+ // | txCopy_P8_to_RGB888() | // +-------------------------+ inline void txCopy_P8_to_RGB888( void *dst, void *src, TxU32 *pal, // Farbpalette pal[256] int pixels) // Pixel Count { SYS_ASSERT_PTR(pal); TxRGB * DPtr = (TxRGB*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = pal[ *SPtr ]; DPtr++; SPtr++; } } //::20 // +---------------------------+ // | txCopy_RGB332_to_ARGB() | // +---------------------------+ inline void txCopy_RGB332_to_ARGB( void *dst, void *src, int pixels) // Pixel Count { TxU32 * DPtr = (TxU32*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU32) ((*SPtr&0xE0)<<16) | (TxU32) ((*SPtr&0x1c)<<11) | (TxU32) ((*SPtr&0x03)<<6); DPtr++; SPtr++; } } //::56 // +-------------------------+ // | txCopy_RGB332_to_I8() | // +-------------------------+ inline void txCopy_RGB332_to_I8( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU8) ((*SPtr&0xE0) * 0.30F + ((*SPtr&0x1c)<<3) * 0.59F + ((*SPtr&0x03)<<5) * 0.11F + 0.5F); DPtr++; SPtr++; } } //::25 // +-----------------------------+ // | txCopy_RGB332_to_RGB332() | // +-----------------------------+ inline void txCopy_RGB332_to_RGB332( void *dst, void *src, int pixels) // Pixel Count { SYS_ASSERT_PTR((TxU8*)src); SYS_ASSERT_PTR((TxU8*)dst); memcpy(dst,src,pixels); } //::13 // +-----------------------------+ // | txCopy_RGB332_to_RGB555() | // +-----------------------------+ inline void txCopy_RGB332_to_RGB555( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU16) ( (*SPtr&0xE0) << 7 ) | (TxU16) ( (*SPtr&0x1c) << 5 ) | (TxU16) ( (*SPtr&0x03)) ; DPtr++; SPtr++; } } //::46 // +-----------------------------+ // | txCopy_RGB332_to_RGB565() | // +-----------------------------+ inline void txCopy_RGB332_to_RGB565( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU16) ( (*SPtr&0xE0) << 8 ) | (TxU16) ( (*SPtr&0x1c) << 6 ) | (TxU16) ( (*SPtr&0x03)) ; DPtr++; SPtr++; } } //::15 // +-----------------------------+ // | txCopy_RGB332_to_RGB888() | // +-----------------------------+ inline void txCopy_RGB332_to_RGB888( void *dst, void *src, int pixels) // Pixel Count { TxRGB * DPtr = (TxRGB*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { (*DPtr).r = (*SPtr&0xE0); (*DPtr).g = (*SPtr&0x1c) << 3; (*DPtr).b = (*SPtr&0x03) << 6; DPtr++; SPtr++; } } //::27 // +---------------------------+ // | txCopy_RGB555_to_ARGB() | // +---------------------------+ inline void txCopy_RGB555_to_ARGB( void *dst, void *src, int pixels) // Pixel Count { TxU32 * DPtr = (TxU32*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU32) ((*SPtr&0x7c00)<<9) | (TxU32) ((*SPtr&0x03e0)<<6) | (TxU32) ((*SPtr&0x001f)<<3); DPtr++; SPtr++; } } //::57 // +-------------------------+ // | txCopy_RGB555_to_I8() | // +-------------------------+ inline void txCopy_RGB555_to_I8( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU8) (((*SPtr&0x7C00) >> 7) * 0.30F + ((*SPtr&0x03E0) >> 2) * 0.59F + ((*SPtr&0x001F) << 3) * 0.11F + 0.5F); DPtr++; SPtr++; } } //::28 // +-----------------------------+ // | txCopy_RGB555_to_RGB332() | // +-----------------------------+ inline void txCopy_RGB555_to_RGB332( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(SPtr); SYS_ASSERT_PTR(DPtr); while( pixels-- > 0 ) { *DPtr = ((*SPtr>>7)&0xE0) | ((*SPtr>>5)&0x1C) | ((*SPtr>>3)&0x03); DPtr++; SPtr++; } } //::29 // +-----------------------------+ // | txCopy_RGB555_to_RGB555() | // +-----------------------------+ inline void txCopy_RGB555_to_RGB555( void *dst, void *src, int pixels) // Pixel Count { SYS_ASSERT_PTR((TxU8*)src); SYS_ASSERT_PTR((TxU8*)dst); memcpy(dst,src,pixels*2); } //::14 // +-----------------------------+ // | txCopy_RGB555_to_RGB565() | // +-----------------------------+ inline void txCopy_RGB555_to_RGB565( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = ((*SPtr&0x7C00) << 1 ) | ((*SPtr&0x03E0) << 1 ) | ((*SPtr&0x001F)) ; DPtr++; SPtr++; } } //::30 // +-----------------------------+ // | txCopy_RGB555_to_RGB888() | // +-----------------------------+ inline void txCopy_RGB555_to_RGB888( void *dst, void *src, int pixels) // Pixel Count { TxRGB * DPtr = (TxRGB*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { (*DPtr).r = (*SPtr&0x7C00) >> 7; (*DPtr).g = (*SPtr&0x03E0) >> 2; (*DPtr).b = (*SPtr&0x001F) << 3; DPtr++; SPtr++; } } //::31 // +---------------------------+ // | txCopy_RGB565_to_ARGB() | // +---------------------------+ inline void txCopy_RGB565_to_ARGB( void *dst, void *src, int pixels) // Pixel Count { TxU32 * DPtr = (TxU32*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU32) ((*SPtr&0xF800)<<8) | (TxU32) ((*SPtr&0x07e0)<<5) | (TxU32) ((*SPtr&0x001f)<<3); DPtr++; SPtr++; } } //::58 // +-------------------------+ // | txCopy_RGB565_to_I8() | // +-------------------------+ inline void txCopy_RGB565_to_I8( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU8) (((*SPtr&0xF800) >> 8) * 0.30F + ((*SPtr&0x07E0) >> 3) * 0.59F + ((*SPtr&0x001F) << 3) * 0.11F + 0.5F); DPtr++; SPtr++; } } //::32 // +-----------------------------+ // | txCopy_RGB565_to_RGB332() | // +-----------------------------+ inline void txCopy_RGB565_to_RGB332( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = ((*SPtr>>8)&0xE0) | ((*SPtr>>6)&0x1C) | ((*SPtr>>3)&0x03); DPtr++; SPtr++; } } //::33 // +-----------------------------+ // | txCopy_RGB565_to_RGB555() | // +-----------------------------+ inline void txCopy_RGB565_to_RGB555( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = ((*SPtr&0xF800) >> 1 ) | ((*SPtr&0x07C0) >> 1 ) | ((*SPtr&0x001F)) ; DPtr++; SPtr++; } } //::34 // +-----------------------------+ // | txCopy_RGB565_to_RGB565() | // +-----------------------------+ inline void txCopy_RGB565_to_RGB565( void *dst, void *src, int pixels) // Pixel Count { SYS_ASSERT_PTR((TxU8*)src); SYS_ASSERT_PTR((TxU8*)dst); memcpy(dst,src,pixels*2); } //::35 // +-----------------------------+ // | txCopy_RGB565_to_RGB888() | // +-----------------------------+ inline void txCopy_RGB565_to_RGB888( void *dst, void *src, int pixels) // Pixel Count { TxRGB * DPtr = (TxRGB*) dst; TxU16 * SPtr = (TxU16*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { (*DPtr).r = (*SPtr&0xF800) >> 8; (*DPtr).g = (*SPtr&0x07E0) >> 3; (*DPtr).b = (*SPtr&0x001F) << 3; DPtr++; SPtr++; } } //::41 // +---------------------------+ // | txCopy_RGB888_to_ARGB() | // +---------------------------+ inline void txCopy_RGB888_to_ARGB( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr++ = *SPtr++; *DPtr++ = *SPtr++; *DPtr++ = *SPtr++; *DPtr++ = 0x00; } } //::59 // +-------------------------+ // | txCopy_RGB888_to_I8() | // +-------------------------+ inline void txCopy_RGB888_to_I8( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxRGB * SPtr = (TxRGB*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (TxU8) ((*SPtr).r * 0.30F + (*SPtr).g * 0.59F + (*SPtr).b * 0.11F + 0.5F); DPtr++; SPtr++; } } //::42 // +-----------------------------+ // | txCopy_RGB888_to_RGB332() | // +-----------------------------+ inline void txCopy_RGB888_to_RGB332( void *dst, void *src, int pixels) // Pixel Count { TxU8 * DPtr = (TxU8*) dst; TxRGB * SPtr = (TxRGB*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (((*SPtr).r)&0xE0) | (((*SPtr).g>>3)&0x1C) | (((*SPtr).b>>6)&0x03); DPtr++; SPtr++; } } //::43 // +-----------------------------+ // | txCopy_RGB888_to_RGB555() | // +-----------------------------+ inline void txCopy_RGB888_to_RGB555( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxRGB * SPtr = (TxRGB*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (((TxU16)((*SPtr).r)<<7)&0x7C00) | (((TxU16)((*SPtr).g)<<2)&0x03E0) | (((TxU16)((*SPtr).b)>>3)&0x001F); DPtr++; SPtr++; } } //::44 // +-----------------------------+ // | txCopy_RGB888_to_RGB565() | // +-----------------------------+ inline void txCopy_RGB888_to_RGB565( void *dst, void *src, int pixels) // Pixel Count { TxU16 * DPtr = (TxU16*) dst; TxU8 * SPtr = (TxU8*) src; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtr); while( pixels-- > 0 ) { *DPtr = (((TxU16)(SPtr[2])<<8)&0xF800) | (((TxU16)(SPtr[1])<<3)&0x07E0) | (((TxU16)(SPtr[0])>>3)&0x001F); DPtr++; SPtr+=3; } } //::45 // +-----------------------------+ // | txCopy_RGB888_to_RGB888() | // +-----------------------------+ inline void txCopy_RGB888_to_RGB888( void *dst, void *src, int pixels) // Pixel Count { SYS_ASSERT_PTR((TxU8*)src); SYS_ASSERT_PTR((TxU8*)dst); memcpy(dst,src,pixels*3); } //::41 // +---------------------------+ // | txCopy_RxGxBx_to_ARGB() | // +---------------------------+ // scanlines RRRRR // scanlines GGGGG // scanlines BBBBB // scanlines RRR... inline void txCopy_RxGxBx_to_ARGB( void *dst, void *src, int width, int height) // Pixel Count { TxU32 * DPtr = (TxU32*) dst; TxU8 * SPtrR = (TxU8*) src; TxU8 * SPtrG = SPtrR + width; TxU8 * SPtrB = SPtrG + width; int wadd = width << 1; SYS_ASSERT_PTR(DPtr); SYS_ASSERT_PTR(SPtrR); while( height-- > 0 ) { int w = width; while( w -- > 0 ) { *DPtr++ = (TxU32((*SPtrR++)) << 16) | (TxU32((*SPtrG++)) << 8) | (TxU32((*SPtrB++)) ); } SPtrR += wadd; SPtrG += wadd; SPtrB += wadd; } } #endif // SYS_TXCOPY_INCLUDED