bool wxPalette::TransferBitmap(void *data, int depth, int size) { switch(depth) { case 8: { unsigned char *uptr = (unsigned char *)data; int pix_array_n; unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n); #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ while(size-- > 0) { if((int)*uptr < pix_array_n) *uptr = (unsigned char)pix_array[*uptr]; uptr++; } return true; } default: return false; } }
bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz, void *dest, unsigned int bpp) { int pix_array_n; unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n); switch(bpp) { case 8: { unsigned char *dptr = (unsigned char *)dest; while(sz-- > 0) { if((int)*data < pix_array_n) *dptr = (unsigned char)pix_array[*data]; data++; dptr++; } break; } case 16: { unsigned short *dptr = (unsigned short *)dest; while(sz-- > 0) { if((int)*data < pix_array_n) *dptr = (unsigned short)pix_array[*data]; data++; dptr++; } break; } case 24: { struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest; while(sz-- > 0) { if((int)*data < pix_array_n) { dptr->r = pix_array[*data] & 0xFF; dptr->g = (pix_array[*data] >> 8) & 0xFF; dptr->b = (pix_array[*data] >> 16) & 0xFF; } data++; dptr++; } break; } case 32: { unsigned long *dptr = (unsigned long *)dest; while(sz-- > 0) { if((int)*data < pix_array_n) *dptr = pix_array[*data]; data++; dptr++; } break; } default: return false; }
bool wxPalette::TransferBitmap(void *data, int depth, int size) { switch(depth) { case 8: { unsigned char *uptr = (unsigned char *)data; int pix_array_n; unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n); while(size-- > 0) { if((int)*uptr < pix_array_n) *uptr = (unsigned char)pix_array[*uptr]; uptr++; } return true; } default: return false; } }
bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz, void *dest, unsigned int bpp) { int pix_array_n; unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n); switch(bpp) { case 8: { unsigned char *dptr = (unsigned char *)dest; #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ while(sz-- > 0) { if((int)*data < pix_array_n) *dptr = (unsigned char)pix_array[*data]; data++; dptr++; } break; } case 16: { unsigned short *dptr = (unsigned short *)dest; #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ while(sz-- > 0) { if((int)*data < pix_array_n) *dptr = (unsigned short)pix_array[*data]; data++; dptr++; } break; } case 24: { struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest; #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ while(sz-- > 0) { if((int)*data < pix_array_n) { dptr->r = pix_array[*data] & 0xFF; dptr->g = (pix_array[*data] >> 8) & 0xFF; dptr->b = (pix_array[*data] >> 16) & 0xFF; } data++; dptr++; } break; } case 32: { unsigned long *dptr = (unsigned long *)dest; #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ while(sz-- > 0) { if((int)*data < pix_array_n) *dptr = pix_array[*data]; data++; dptr++; } break; } default: return false; }