Lines Matching refs:infile
31 static int bmp_read_header(gdIOCtxPtr infile, bmp_hdr_t *hdr);
32 static int bmp_read_info(gdIOCtxPtr infile, bmp_info_t *info);
33 static int bmp_read_windows_v3_info(gdIOCtxPtr infile, bmp_info_t *info);
34 static int bmp_read_os2_v1_info(gdIOCtxPtr infile, bmp_info_t *info);
35 static int bmp_read_os2_v2_info(gdIOCtxPtr infile, bmp_info_t *info);
37 static int bmp_read_direct(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header);
38 static int bmp_read_1bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header);
39 static int bmp_read_4bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header);
40 static int bmp_read_8bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header);
41 static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info);
438 gdImagePtr gdImageCreateFromBmpCtx(gdIOCtxPtr infile) in gdImageCreateFromBmpCtx() argument
449 if (bmp_read_header(infile, hdr)) { in gdImageCreateFromBmpCtx()
464 if (bmp_read_info(infile, info)) { in gdImageCreateFromBmpCtx()
492 error = bmp_read_1bit(im, infile, info, hdr); in gdImageCreateFromBmpCtx()
496 error = bmp_read_4bit(im, infile, info, hdr); in gdImageCreateFromBmpCtx()
500 error = bmp_read_8bit(im, infile, info, hdr); in gdImageCreateFromBmpCtx()
506 error = bmp_read_direct(im, infile, info, hdr); in gdImageCreateFromBmpCtx()
524 static int bmp_read_header(gdIOCtx *infile, bmp_hdr_t *hdr) in bmp_read_header() argument
527 !gdGetWordLSB(&hdr->magic, infile) || in bmp_read_header()
528 !gdGetIntLSB(&hdr->size, infile) || in bmp_read_header()
529 !gdGetWordLSB(&hdr->reserved1, infile) || in bmp_read_header()
530 !gdGetWordLSB(&hdr->reserved2 , infile) || in bmp_read_header()
531 !gdGetIntLSB(&hdr->off , infile) in bmp_read_header()
538 static int bmp_read_info(gdIOCtx *infile, bmp_info_t *info) in bmp_read_info() argument
541 if (!gdGetIntLSB(&info->len, infile)) { in bmp_read_info()
551 if (bmp_read_windows_v3_info(infile, info)) { in bmp_read_info()
556 if (bmp_read_os2_v1_info(infile, info)) { in bmp_read_info()
561 if (bmp_read_os2_v2_info(infile, info)) { in bmp_read_info()
572 static int bmp_read_windows_v3_info(gdIOCtxPtr infile, bmp_info_t *info) in bmp_read_windows_v3_info() argument
575 !gdGetIntLSB(&info->width, infile) || in bmp_read_windows_v3_info()
576 !gdGetIntLSB(&info->height, infile) || in bmp_read_windows_v3_info()
577 !gdGetWordLSB(&info->numplanes, infile) || in bmp_read_windows_v3_info()
578 !gdGetWordLSB(&info->depth, infile) || in bmp_read_windows_v3_info()
579 !gdGetIntLSB(&info->enctype, infile) || in bmp_read_windows_v3_info()
580 !gdGetIntLSB(&info->size, infile) || in bmp_read_windows_v3_info()
581 !gdGetIntLSB(&info->hres, infile) || in bmp_read_windows_v3_info()
582 !gdGetIntLSB(&info->vres, infile) || in bmp_read_windows_v3_info()
583 !gdGetIntLSB(&info->numcolors, infile) || in bmp_read_windows_v3_info()
584 !gdGetIntLSB(&info->mincolors, infile) in bmp_read_windows_v3_info()
606 static int bmp_read_os2_v1_info(gdIOCtxPtr infile, bmp_info_t *info) in bmp_read_os2_v1_info() argument
609 !gdGetWordLSB((signed short int *)&info->width, infile) || in bmp_read_os2_v1_info()
610 !gdGetWordLSB((signed short int *)&info->height, infile) || in bmp_read_os2_v1_info()
611 !gdGetWordLSB(&info->numplanes, infile) || in bmp_read_os2_v1_info()
612 !gdGetWordLSB(&info->depth, infile) in bmp_read_os2_v1_info()
631 static int bmp_read_os2_v2_info(gdIOCtxPtr infile, bmp_info_t *info) in bmp_read_os2_v2_info() argument
635 !gdGetIntLSB(&info->width, infile) || in bmp_read_os2_v2_info()
636 !gdGetIntLSB(&info->height, infile) || in bmp_read_os2_v2_info()
637 !gdGetWordLSB(&info->numplanes, infile) || in bmp_read_os2_v2_info()
638 !gdGetWordLSB(&info->depth, infile) || in bmp_read_os2_v2_info()
639 !gdGetIntLSB(&info->enctype, infile) || in bmp_read_os2_v2_info()
640 !gdGetIntLSB(&info->size, infile) || in bmp_read_os2_v2_info()
641 !gdGetIntLSB(&info->hres, infile) || in bmp_read_os2_v2_info()
642 !gdGetIntLSB(&info->vres, infile) || in bmp_read_os2_v2_info()
643 !gdGetIntLSB(&info->numcolors, infile) || in bmp_read_os2_v2_info()
644 !gdGetIntLSB(&info->mincolors, infile) in bmp_read_os2_v2_info()
650 if (!gdGetBuf(useless_bytes, 24, infile)) { in bmp_read_os2_v2_info()
672 static int bmp_read_direct(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header) in bmp_read_direct() argument
712 if (gdTell(infile) != header->off) { in bmp_read_direct()
714 if (!gdSeek(infile, header->off)) { in bmp_read_direct()
735 if (!gdGetWordLSB(&data, infile)) { in bmp_read_direct()
744 if (!gdGetByte(&blue, infile) || !gdGetByte(&green, infile) || !gdGetByte(&red, infile)) { in bmp_read_direct()
748 …if (!gdGetByte(&blue, infile) || !gdGetByte(&green, infile) || !gdGetByte(&red, infile) || !gdGetB… in bmp_read_direct()
756 if (!gdGetByte(&red, infile)) { in bmp_read_direct()
765 static int bmp_read_palette(gdImagePtr im, gdIOCtxPtr infile, int count, int read_four) in bmp_read_palette() argument
772 !gdGetByte(&b, infile) || in bmp_read_palette()
773 !gdGetByte(&g, infile) || in bmp_read_palette()
774 !gdGetByte(&r, infile) || in bmp_read_palette()
775 (read_four && !gdGetByte(&z, infile)) in bmp_read_palette()
787 static int bmp_read_1bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header) in bmp_read_1bit() argument
802 if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALETTE_4))) { in bmp_read_1bit()
809 if (gdTell(infile) != header->off) { in bmp_read_1bit()
811 if (!gdSeek(infile, header->off)) { in bmp_read_1bit()
831 if (!gdGetByte(¤t_byte, infile)) { in bmp_read_1bit()
849 if (!gdGetByte(&index, infile)) { in bmp_read_1bit()
857 static int bmp_read_4bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header) in bmp_read_4bit() argument
872 if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALETTE_4))) { in bmp_read_4bit()
879 if (gdTell(infile) != header->off) { in bmp_read_4bit()
881 if (!gdSeek(infile, header->off)) { in bmp_read_4bit()
902 if (!gdGetByte(¤t_byte, infile)) { in bmp_read_4bit()
925 if (!gdGetByte(&index, infile)) { in bmp_read_4bit()
933 if (bmp_read_rle(im, infile, info)) { in bmp_read_4bit()
944 static int bmp_read_8bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header) in bmp_read_8bit() argument
959 if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALETTE_4))) { in bmp_read_8bit()
966 if (gdTell(infile) != header->off) { in bmp_read_8bit()
968 if (!gdSeek(infile, header->off)) { in bmp_read_8bit()
989 if (!gdGetByte(&index, infile)) { in bmp_read_8bit()
1000 if (!gdGetByte(&index, infile)) { in bmp_read_8bit()
1008 if (bmp_read_rle(im, infile, info)) { in bmp_read_8bit()
1019 static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info) in bmp_read_rle() argument
1028 if (!gdGetByte(&rle_length, infile) || !gdGetByte(&rle_data, infile)) { in bmp_read_rle()
1053 if (!gdGetByte(&index, infile)) { in bmp_read_rle()
1072 if (padding % 2 && !gdGetByte(&index, infile)) { in bmp_read_rle()
1081 if (!gdGetByte(&rle_length, infile) || !gdGetByte(&rle_data, infile)) { in bmp_read_rle()