📄 rgb32torgb444.c
字号:
*(unsigned short *) (d2) = da_rgb;
d2 += 2;
*(unsigned short *) (d12) = dc_rgb;
d12 += 2;
if (!(--count))
goto end_of_row;
}
while ((limit -= step) >= 0);
limit += dest_dx;
register unsigned int sa_rgb;
sa_rgb = *(unsigned int *) (s);
db_rgb =((8 + 4 <8)? (((((16 + 8 <8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) & (0x100 -(1U <<(8 -8)))): ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &(0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 -4)))) >>((8 -(8 +4)) & 0x1F)) : (((((16 + 8 <8) ? ((sa_rgb <<((8 -(16 + 8)) & 0x1F)) & (0x100 -(1U <<(8 -8)))): ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &(0x100 -(1U << (8 - 8)))))) & (0x100 -(1U <<(8 -4)))) <<(((8 + 4) - 8) & 0x1F))) | ((4 + 4 <8)? (((((8 + 8 <8)? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) >> ((8 - (4 + 4)) & 0x1F)) : (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) << (((4 + 4) - 8) & 0x1F))) | ((0 + 4 < 8) ? (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) >> ((8 - (0 + 4)) & 0x1F)) : (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) << (((0 + 4) - 8) & 0x1F)));
da_rgb =(((da_rgb ^ db_rgb) >> 1) &(((1U << (8 + 4 - 1)) - (1U << 8)) | ((1U << (4 + 4 - 1)) -(1U << 4)) | ((1U <<(0 + 4 -1)) -(1U << 0))))+ (da_rgb & db_rgb);
sb_rgb = *(unsigned short *) (d1);
dc_rgb =(((da_rgb ^ sb_rgb) >> 1) &(((1U << (8 + 4 - 1)) - (1U << 8)) | ((1U << (4 + 4 - 1)) -(1U << 4)) | ((1U <<(0 + 4 -1)) -(1U << 0))))+ (da_rgb & sb_rgb);
do
{
d1 += 2;
*(unsigned short *) (d2) = da_rgb;
d2 += 2;
*(unsigned short *) (d12) = dc_rgb;
d12 += 2;
if (!(--count))
goto end_of_row;
}
while ((limit -= step) >= 0);
limit += dest_dx;
sb_rgb = *(unsigned short *) (d1);
dd_rgb =(((db_rgb ^ sb_rgb) >> 1) &(((1U << (8 + 4 - 1)) - (1U << 8)) | ((1U << (4 + 4 - 1)) -(1U << 4)) | ((1U <<(0 + 4 -1)) -(1U << 0))))+ (db_rgb & sb_rgb);
do
{
d1 += 2;
*(unsigned short *) (d2) = db_rgb;
d2 += 2;
*(unsigned short *) (d12) = dd_rgb;
d12 += 2;
if (!(--count))
goto end_of_row_2;
}
while ((limit -= step) >= 0);
limit += dest_dx;
sa_rgb = *(unsigned int *) (s + 4);
da_rgb =((8 + 4 <8)? (((((16 + 8 <8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) & (0x100 -(1U <<(8 -8)))): ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &(0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 -4)))) >>((8 -(8 +4)) & 0x1F)) : (((((16 + 8 <8) ? ((sa_rgb <<((8 -(16 + 8)) & 0x1F)) & (0x100 -(1U <<(8 -8)))): ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &(0x100 -(1U << (8 - 8)))))) & (0x100 -(1U <<(8 -4)))) <<(((8 + 4) - 8) & 0x1F))) | ((4 + 4 <8)? (((((8 + 8 <8)? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) >> ((8 - (4 + 4)) & 0x1F)) : (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) << (((4 + 4) - 8) & 0x1F))) | ((0 + 4 < 8) ? (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) >> ((8 - (0 + 4)) & 0x1F)) : (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) & (0x100 - (1U << (8 - 8)))) : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) & (0x100 - (1U << (8 - 8)))))) & (0x100 - (1U << (8 - 4)))) << (((0 + 4) - 8) & 0x1F)));
s += 2 * 4;
db_rgb =(((db_rgb ^ da_rgb) >> 1) &(((1U << (8 + 4 - 1)) - (1U << 8)) | ((1U << (4 + 4 - 1)) -(1U << 4)) | ((1U <<(0 + 4 -1)) -(1U << 0))))+ (db_rgb & da_rgb);
sb_rgb = *(unsigned short *) (d1);
dd_rgb =(((db_rgb ^ sb_rgb) >> 1) &(((1U << (8 + 4 - 1)) - (1U << 8)) | ((1U << (4 + 4 - 1)) -(1U << 4)) | ((1U <<(0 + 4 -1)) -(1U << 0))))+ (db_rgb & sb_rgb);
do
{
d1 += 2;
*(unsigned short *) (d2) = db_rgb;
d2 += 2;
*(unsigned short *) (d12) = dd_rgb;
d12 += 2;
if (!(--count))
goto end_of_row_2;
}
while ((limit -= step) >= 0);
limit += dest_dx;
}
end_of_row_2:
da_rgb = db_rgb;
dc_rgb = dd_rgb;
end_of_row:
while (remainder--)
{
*(unsigned short *) (d2) = da_rgb;
d2 += 2;
*(unsigned short *) (d12) = dc_rgb;
d12 += 2;
}
}
}
int
RGBtoRGB (int dest_format, unsigned char *dest_ptr, int dest_width,
int dest_height, int dest_pitch, int dest_x, int dest_y,
int dest_dx, int dest_dy, int src_format, unsigned char *src_ptr,
int src_width, int src_height, int src_pitch, int src_x, int src_y,
int src_dx, int src_dy)
{
void (*ImageFuncs[5]) (unsigned char *dest_ptr, int dest_dx, int dest_dy,
int dest_pitch, int dest_bpp, unsigned char *src_ptr,
int src_dx, int src_dy, int src_pitch, int src_bpp,
void (*row_func) (unsigned char *, int,
unsigned char *, int),
void (*row2x_func) (unsigned char *, unsigned char *,
unsigned char *, int,
unsigned char *, int)) =
{
IMAGE_SHRINK,
IMAGE_COPY,
IMAGE_STRETCH,
IMAGE_STRETCH2X,
IMAGE_STRETCH2XPLUS
};
void (*RowFuncs[5]) (unsigned char *dest_ptr, int dest_dx,
unsigned char *src_ptr, int src_dx) =
{
RGB32toRGB444_ROW_SHRINK,
RGB32toRGB444_ROW_COPY,
RGB32toRGB444_ROW_STRETCH,
RGB32toRGB444_ROW_STRETCH2X,
RGB32toRGB444_ROW_STRETCH2XPLUS
};
void (*Row2xFuncs[5]) (unsigned char *dest_ptr_1, unsigned char *dest_ptr_12,
unsigned char *dest_ptr_2, int dest_dx,
unsigned char *src_ptr, int src_dx) =
{
RGB32toRGB444_ROW2X_SHRINK,
RGB32toRGB444_ROW2X_COPY,
RGB32toRGB444_ROW2X_STRETCH,
RGB32toRGB444_ROW2X_STRETCH2X,
RGB32toRGB444_ROW2X_STRETCH2XPLUS
};
void (*row_proc) (unsigned char *, int, unsigned char *, int);
void (*row2x_proc) (unsigned char *, unsigned char *, unsigned char *, int,
unsigned char *, int);
void (*image_proc) (unsigned char *, int, int, int, int,
unsigned char *, int, int, int, int,
void (*)(unsigned char *, int, unsigned char *, int),
void (*)(unsigned char *, unsigned char *,
unsigned char *, int, unsigned char *, int));
register int scale_x, scale_y;
register int dest_bpp, src_bpp;
register unsigned char *d, *s;
if (((unsigned) dest_ptr & 3) || (dest_pitch & 1) ||
((unsigned) src_ptr & 3) || (src_pitch & 3) ||
dest_width <= 0 || dest_height <= 0 ||
src_width <= 0 || src_height <= 0 ||
dest_x < 0 || dest_y < 0 || dest_dx <= 0 || dest_dy <= 0 ||
src_x < 0 || src_y < 0 || src_dx <= 0 || src_dy <= 0 ||
dest_width < dest_x + dest_dx || dest_height < dest_y + dest_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -