Lines Matching +full:count +full:- +full:width
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
46 static int splash_mode = -1;
64 /* currently only 256-color modes are supported XXX */ in bmp_start()
75 -1, in bmp_start()
141 else brightness--; in bmp_splash()
145 brightness--; in bmp_splash()
218 int width,height; /* image dimensions */ member
249 if ((x < 0) || (x >= info->swidth) || (y < 0) || (y >= info->sheight)) in bmp_SetPix()
254 * because 0,0 is bottom-left for DIB, we have to convert. in bmp_SetPix()
256 sofs = ((info->height - (y+1) + (info->sheight - info->height) / 2) in bmp_SetPix()
257 * info->adp->va_line_width); in bmp_SetPix()
258 x += (info->swidth - info->width) / 2; in bmp_SetPix()
260 switch(info->sdepth) { in bmp_SetPix()
265 newbank = sofs/info->adp->va_window_size; in bmp_SetPix()
266 if (info->bank != newbank) { in bmp_SetPix()
267 vidd_set_win_org(info->adp, newbank*info->adp->va_window_size); in bmp_SetPix()
268 info->bank = newbank; in bmp_SetPix()
270 sofs %= info->adp->va_window_size; in bmp_SetPix()
274 *(info->vidmem + sofs) ^= 0xff; /* read-modify-write */ in bmp_SetPix()
279 newbank = sofs/info->adp->va_window_size; in bmp_SetPix()
280 if (info->bank != newbank) { in bmp_SetPix()
281 vidd_set_win_org(info->adp, newbank*info->adp->va_window_size); in bmp_SetPix()
282 info->bank = newbank; in bmp_SetPix()
284 sofs %= info->adp->va_window_size; in bmp_SetPix()
285 *(info->vidmem+sofs) = val; in bmp_SetPix()
293 ** Given (data) pointing to a line of RLE4-format data and (line) being the starting
299 int count; /* run count */ in bmp_DecodeRLE4() local
312 if (*info->index) { in bmp_DecodeRLE4()
313 for (count = 0; count < *info->index; count++, x++) { in bmp_DecodeRLE4()
314 if (count & 1) { /* odd count, low nybble */ in bmp_DecodeRLE4()
315 bmp_SetPix(info, x, y, *(info->index+1) & 0x0f); in bmp_DecodeRLE4()
316 } else { /* even count, high nybble */ in bmp_DecodeRLE4()
317 bmp_SetPix(info, x, y, (*(info->index+1) >>4) & 0x0f); in bmp_DecodeRLE4()
320 info->index += 2; in bmp_DecodeRLE4()
326 switch (*(info->index+1)) { in bmp_DecodeRLE4()
328 info->index += 2; in bmp_DecodeRLE4()
331 info->index = NULL; in bmp_DecodeRLE4()
334 x += *(info->index + 2); /* new coords */ in bmp_DecodeRLE4()
335 y += *(info->index + 3); in bmp_DecodeRLE4()
336 info->index += 4; in bmp_DecodeRLE4()
339 for (count = 0; count < *(info->index + 1); count++, x++) { in bmp_DecodeRLE4()
340 val = *(info->index + 2 + (count / 2)); /* byte with nybbles */ in bmp_DecodeRLE4()
341 if (count & 1) { in bmp_DecodeRLE4()
348 /* warning, this depends on integer truncation, do not hand-optimise! */ in bmp_DecodeRLE4()
349 info->index += 2 + ((count + 3) / 4) * 2; in bmp_DecodeRLE4()
358 ** Given (data) pointing to a line of RLE8-format data and (line) being the starting
364 int count; /* run count */ in bmp_DecodeRLE8() local
376 if (*info->index) { in bmp_DecodeRLE8()
377 for (count = 0; count < *info->index; count++, x++) in bmp_DecodeRLE8()
378 bmp_SetPix(info, x, y, *(info->index+1)); in bmp_DecodeRLE8()
379 info->index += 2; in bmp_DecodeRLE8()
385 switch(*(info->index+1)) { in bmp_DecodeRLE8()
387 info->index += 2; in bmp_DecodeRLE8()
390 info->index = NULL; in bmp_DecodeRLE8()
393 x += *(info->index + 2); /* new coords */ in bmp_DecodeRLE8()
394 y += *(info->index + 3); in bmp_DecodeRLE8()
395 info->index += 4; in bmp_DecodeRLE8()
398 for (count = 0; count < *(info->index + 1); count++, x++) in bmp_DecodeRLE8()
399 bmp_SetPix(info, x, y, *(info->index + 2 + count)); in bmp_DecodeRLE8()
400 /* must be an even count */ in bmp_DecodeRLE8()
401 info->index += 2 + count + (count & 1); in bmp_DecodeRLE8()
420 switch(info->format) { in bmp_DecodeLine()
422 switch(info->depth) { in bmp_DecodeLine()
424 for (x = 0; x < info->width; x++, info->index++) in bmp_DecodeLine()
425 bmp_SetPix(info, x, line, *info->index); in bmp_DecodeLine()
426 info->index += 3 - (--x % 4); in bmp_DecodeLine()
429 p = info->index; in bmp_DecodeLine()
430 for (x = 0; x < info->width; x++) { in bmp_DecodeLine()
439 /* warning, this depends on integer truncation, do not hand-optimise! */ in bmp_DecodeLine()
440 info->index += ((x + 7) / 8) * 4; in bmp_DecodeLine()
443 p = info->index; in bmp_DecodeLine()
445 for (x = 0; x < info->width; x++) { in bmp_DecodeLine()
454 /* warning, this depends on integer truncation, do not hand-optimise! */ in bmp_DecodeLine()
455 info->index += ((x + 31) / 32) * 4; in bmp_DecodeLine()
486 if (bmf->bmfh.bfType != 0x4d42) { in bmp_Init()
488 return(1); /* XXX check word ordering for big-endian ports? */ in bmp_Init()
492 if (bmf->bmfi.bmiHeader.biSize > sizeof(bmf->bmfi.bmiHeader)) { in bmp_Init()
494 bmf->bmfi.bmiHeader.biSize); in bmp_Init()
504 bmp_info.data = (u_char *)data + bmf->bmfh.bfOffBits; in bmp_Init()
507 bmp_info.width = bmf->bmfi.bmiHeader.biWidth; in bmp_Init()
508 bmp_info.height = bmf->bmfi.bmiHeader.biHeight; in bmp_Init()
509 bmp_info.depth = bmf->bmfi.bmiHeader.biBitCount; in bmp_Init()
510 bmp_info.format = bmf->bmfi.bmiHeader.biCompression; in bmp_Init()
523 bmp_info.ncols = (bmf->bmfi.bmiHeader.biClrUsed); in bmp_Init()
526 bmp_info.ncols = 1 << bmf->bmfi.bmiHeader.biBitCount; in bmp_Init()
529 (bmp_info.width > bmp_info.swidth) || in bmp_Init()
533 bmp_info.width, bmp_info.height, bmp_info.ncols); in bmp_Init()
539 bmp_info.palette[pind][0] = bmf->bmfi.bmiColors[pind].rgbRed; in bmp_Init()
540 bmp_info.palette[pind][1] = bmf->bmfi.bmiColors[pind].rgbGreen; in bmp_Init()
541 bmp_info.palette[pind][2] = bmf->bmfi.bmiColors[pind].rgbBlue; in bmp_Init()
565 bmp_info.vidmem = (u_char *)adp->va_window; in bmp_Draw()
579 if ((adp->va_type == KD_EGA) || (adp->va_type == KD_VGA)) { in bmp_Draw()
580 inb(adp->va_crtc_addr + 6); /* reset flip-flop */ in bmp_Draw()
587 inb(adp->va_crtc_addr + 6); /* reset flip-flop */ in bmp_Draw()