Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 2133:898c1edadbc6
Cosmetic cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 28 May 2019 10:35:26 +0300 |
parents | 3b5be00759ed |
children | 5daed72fd211 |
comparison
equal
deleted
inserted
replaced
2132:6528a1398e8e | 2133:898c1edadbc6 |
---|---|
300 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), | 300 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), |
301 scroffs = yoffs + x, | 301 scroffs = yoffs + x, |
302 vshift = 6 - (rasterX & 6); | 302 vshift = 6 - (rasterX & 6); |
303 | 303 |
304 return dmC64GetGenericMCPixel(col, img, | 304 return dmC64GetGenericMCPixel(col, img, |
305 bmoffs, scroffs, vshift, | 305 bmoffs, scroffs, |
306 0, rasterX & 1, 0, img->bgcolor); | 306 vshift, 0, |
307 rasterX & 1, 0, img->bgcolor); | |
307 } | 308 } |
308 | 309 |
309 | 310 |
310 static const char *fmtBDP5MagicID = "BDP 5.00"; | 311 static const char *fmtBDP5MagicID = "BDP 5.00"; |
311 | 312 |
519 static int fmtGetPixelFLIDesigner(Uint8 *col, | 520 static int fmtGetPixelFLIDesigner(Uint8 *col, |
520 const DMC64Image *img, const int rasterX, const int rasterY) | 521 const DMC64Image *img, const int rasterX, const int rasterY) |
521 { | 522 { |
522 DM_C64_GENERIC_MC_PIXEL_DEFS(img) | 523 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
523 | 524 |
524 //return dmC64GetGenericMCPixel( img, bmoffs, scroffs, vshift, rasterY & 7, bitmap, 0, img->bgcolor); | 525 return dmC64GetGenericMCPixel(col, img, |
525 return dmC64GetGenericMCPixel(col, img, bmoffs, scroffs, vshift, rasterY & 7, 0, 0, img->bgcolor); | 526 bmoffs, scroffs, |
527 vshift, rasterY & 7, | |
528 0, 0, img->bgcolor); | |
526 } | 529 } |
527 | 530 |
528 | 531 |
529 static int fmtProbeBlackMailFLIPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | 532 static int fmtProbeBlackMailFLIPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
530 { | 533 { |
615 | 618 |
616 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? | 619 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? |
617 img->extraData[0].data[rasterY] : img->bgcolor; | 620 img->extraData[0].data[rasterY] : img->bgcolor; |
618 | 621 |
619 return dmC64GetGenericMCPixel(col, img, | 622 return dmC64GetGenericMCPixel(col, img, |
620 bmoffs, scroffs, vshift, rasterY & 7, 0, 0, | 623 bmoffs, scroffs, |
621 bgcol & 15); | 624 vshift, rasterY & 7, |
625 0, 0, bgcol & 15); | |
622 } | 626 } |
623 | 627 |
624 | 628 |
625 static int fmtTruePaintGetLaceType(const DMC64EncDecOp *op, DMC64Image *img, | 629 static int fmtTruePaintGetLaceType(const DMC64EncDecOp *op, DMC64Image *img, |
626 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) | 630 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
643 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), | 647 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), |
644 scroffs = yoffs + x, | 648 scroffs = yoffs + x, |
645 vshift = 6 - (rasterX & 6); | 649 vshift = 6 - (rasterX & 6); |
646 | 650 |
647 return dmC64GetGenericMCPixel(col, img, | 651 return dmC64GetGenericMCPixel(col, img, |
648 bmoffs, scroffs, vshift, 0, rasterX & 1, 0, img->bgcolor); | 652 bmoffs, scroffs, |
653 vshift, 0, | |
654 rasterX & 1, 0, img->bgcolor); | |
649 } | 655 } |
650 | 656 |
651 | 657 |
652 static int fmtProbeTruePaintPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | 658 static int fmtProbeTruePaintPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
653 { | 659 { |
948 y = rasterY / 8, | 954 y = rasterY / 8, |
949 yb = rasterY & 7, | 955 yb = rasterY & 7, |
950 yoffs = y * img->fmt->chWidth, | 956 yoffs = y * img->fmt->chWidth, |
951 bmoffs = yoffs * 8 + yb + (x * 8), | 957 bmoffs = yoffs * 8 + yb + (x * 8), |
952 scroffs = yoffs + x, | 958 scroffs = yoffs + x, |
953 vshift = 6 - (rasterX & 6), | |
954 bitmap = rasterX & 1, | 959 bitmap = rasterX & 1, |
955 vbank = yb + (bitmap * 8); | 960 vbank = yb + (bitmap * 8), |
961 vshift = 6 - (rasterX & 6); | |
956 | 962 |
957 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? | 963 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? |
958 img->extraData[0].data[rasterY] : img->bgcolor; | 964 img->extraData[0].data[rasterY] : img->bgcolor; |
959 | 965 |
960 return dmC64GetGenericMCPixel(col, img, | 966 return dmC64GetGenericMCPixel(col, img, |
961 bmoffs, scroffs, vshift, | 967 bmoffs, scroffs, |
962 vbank, bitmap, 0, bgcol & 15); | 968 vshift, vbank, |
969 bitmap, 0, bgcol & 15); | |
963 } | 970 } |
964 | 971 |
965 | 972 |
966 static int fmtGetPixelBFLI(Uint8 *col, | 973 static int fmtGetPixelBFLI(Uint8 *col, |
967 const DMC64Image *img, const int rasterX, const int rasterY) | 974 const DMC64Image *img, const int rasterX, const int rasterY) |
968 { | 975 { |
969 DM_C64_GENERIC_MC_PIXEL_DEFS(img) | 976 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
970 const int vbb = rasterY < 200 ? 0 : 1; | 977 const int vbb = rasterY < 200 ? 0 : 1; |
971 const int vbank = (rasterY & 7) + (vbb * 8); | 978 const int vbank = (rasterY & 7) + (vbb * 8); |
972 | 979 |
973 return dmC64GetGenericMCPixel(col, | 980 return dmC64GetGenericMCPixel(col, img, |
974 img, bmoffs & 0x1fff, scroffs & 0x3ff, | 981 bmoffs & 0x1fff, scroffs & 0x3ff, |
975 vshift, vbank, vbb, 0, img->bgcolor); | 982 vshift, vbank, |
983 vbb, 0, img->bgcolor); | |
976 } | 984 } |
977 | 985 |
978 | 986 |
979 static int fmtGetPixelPentelPaint(Uint8 *col, | 987 static int fmtGetPixelPentelPaint(Uint8 *col, |
980 const DMC64Image *img, const int rasterX, const int rasterY) | 988 const DMC64Image *img, const int rasterX, const int rasterY) |
1011 Uint8 bgcol = (unsigned) ry < img->extraData[0].size ? | 1019 Uint8 bgcol = (unsigned) ry < img->extraData[0].size ? |
1012 img->extraData[0].data[ry] : img->bgcolor; | 1020 img->extraData[0].data[ry] : img->bgcolor; |
1013 | 1021 |
1014 return dmC64GetGenericMCPixel(col, img, | 1022 return dmC64GetGenericMCPixel(col, img, |
1015 bmoffs, scroffs, | 1023 bmoffs, scroffs, |
1016 vshift, vbank, 0, vbank, bgcol & 15); | 1024 vshift, vbank, |
1025 0, vbank, bgcol & 15); | |
1017 } | 1026 } |
1018 | 1027 |
1019 | 1028 |
1020 static int fmtGetPixelCrestHIFLIorCDHM(Uint8 *col, | 1029 static int fmtGetPixelCrestHIFLIorCDHM(Uint8 *col, |
1021 const DMC64Image *img, const int rasterX, const int rasterY) | 1030 const DMC64Image *img, const int rasterX, const int rasterY) |
1022 { | 1031 { |
1023 DM_C64_GENERIC_SC_PIXEL_DEFS(img) | 1032 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
1024 return dmC64GetGenericSCPixel(col, img, bmoffs, scroffs, vshift, rasterY & 7, 0); | 1033 |
1034 return dmC64GetGenericSCPixel(col, img, | |
1035 bmoffs, scroffs, | |
1036 vshift, rasterY & 7, 0); | |
1025 } | 1037 } |
1026 | 1038 |
1027 | 1039 |
1028 static int fmtECIGetLaceType(const DMC64EncDecOp *op, DMC64Image *img, | 1040 static int fmtECIGetLaceType(const DMC64EncDecOp *op, DMC64Image *img, |
1029 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) | 1041 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |