Lines Matching refs:ximage

435 static int _XDestroyImage (XImage *ximage)  in _XDestroyImage()  argument
437 Xfree(ximage->data); in _XDestroyImage()
438 Xfree(ximage->obdata); in _XDestroyImage()
439 Xfree(ximage); in _XDestroyImage()
471 register XImage *ximage, in _XGetPixel() argument
483 if ((ximage->bits_per_pixel | ximage->depth) == 1) { in _XGetPixel()
484 src = &ximage->data[XYINDEX(x, y, ximage)]; in _XGetPixel()
487 for (i = ximage->bitmap_unit >> 3; --i >= 0; ) *dst++ = *src++; in _XGetPixel()
488 XYNORMALIZE(&pixel, ximage); in _XGetPixel()
489 bits = (x + ximage->xoffset) % ximage->bitmap_unit; in _XGetPixel()
491 } else if (ximage->format == XYPixmap) { in _XGetPixel()
494 nbytes = ximage->bitmap_unit >> 3; in _XGetPixel()
495 for (i = ximage->depth; --i >= 0; ) { in _XGetPixel()
496 src = &ximage->data[XYINDEX(x, y, ximage)+ plane]; in _XGetPixel()
500 XYNORMALIZE(&px, ximage); in _XGetPixel()
501 bits = (x + ximage->xoffset) % ximage->bitmap_unit; in _XGetPixel()
504 plane = plane + (ximage->bytes_per_line * ximage->height); in _XGetPixel()
506 } else if (ximage->format == ZPixmap) { in _XGetPixel()
507 src = &ximage->data[ZINDEX(x, y, ximage)]; in _XGetPixel()
510 for (i = (ximage->bits_per_pixel + 7) >> 3; --i >= 0; ) in _XGetPixel()
512 ZNORMALIZE(&px, ximage); in _XGetPixel()
516 if (ximage->bits_per_pixel == 4) { in _XGetPixel()
525 if (ximage->bits_per_pixel == ximage->depth) in _XGetPixel()
528 return (pixel & low_bits_table[ximage->depth]); in _XGetPixel()
534 register XImage *ximage, in _XGetPixel32() argument
541 if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 32)) { in _XGetPixel32()
542 addr = &((unsigned char *)ximage->data) in _XGetPixel32()
543 [y * ximage->bytes_per_line + (x << 2)]; in _XGetPixel32()
544 if (*((const char *)&byteorderpixel) == ximage->byte_order) in _XGetPixel32()
546 else if (ximage->byte_order == MSBFirst) in _XGetPixel32()
556 if (ximage->depth != 32) in _XGetPixel32()
557 pixel &= low_bits_table[ximage->depth]; in _XGetPixel32()
560 _XInitImageFuncPtrs(ximage); in _XGetPixel32()
561 return XGetPixel(ximage, x, y); in _XGetPixel32()
566 register XImage *ximage, in _XGetPixel16() argument
573 if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 16)) { in _XGetPixel16()
574 addr = &((unsigned char *)ximage->data) in _XGetPixel16()
575 [y * ximage->bytes_per_line + (x << 1)]; in _XGetPixel16()
576 if (ximage->byte_order == MSBFirst) in _XGetPixel16()
580 if (ximage->depth != 16) in _XGetPixel16()
581 pixel &= low_bits_table[ximage->depth]; in _XGetPixel16()
584 _XInitImageFuncPtrs(ximage); in _XGetPixel16()
585 return XGetPixel(ximage, x, y); in _XGetPixel16()
590 register XImage *ximage, in _XGetPixel8() argument
596 if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 8)) { in _XGetPixel8()
597 pixel = ((unsigned char *)ximage->data) in _XGetPixel8()
598 [y * ximage->bytes_per_line + x]; in _XGetPixel8()
599 if (ximage->depth != 8) in _XGetPixel8()
600 pixel &= low_bits_table[ximage->depth]; in _XGetPixel8()
603 _XInitImageFuncPtrs(ximage); in _XGetPixel8()
604 return XGetPixel(ximage, x, y); in _XGetPixel8()
609 register XImage *ximage, in _XGetPixel1() argument
616 if (((ximage->bits_per_pixel | ximage->depth) == 1) && in _XGetPixel1()
617 (ximage->byte_order == ximage->bitmap_bit_order)) { in _XGetPixel1()
618 xoff = x + ximage->xoffset; in _XGetPixel1()
619 yoff = y * ximage->bytes_per_line + (xoff >> 3); in _XGetPixel1()
621 if (ximage->bitmap_bit_order == MSBFirst) in _XGetPixel1()
625 return (ximage->data[yoff] & bit) ? 1 : 0; in _XGetPixel1()
627 _XInitImageFuncPtrs(ximage); in _XGetPixel1()
628 return XGetPixel(ximage, x, y); in _XGetPixel1()
649 register XImage *ximage, in _XPutPixel() argument
662 if (ximage->depth == 4) in _XPutPixel()
667 if ((ximage->bits_per_pixel | ximage->depth) == 1) { in _XPutPixel()
668 src = &ximage->data[XYINDEX(x, y, ximage)]; in _XPutPixel()
671 nbytes = ximage->bitmap_unit >> 3; in _XPutPixel()
673 XYNORMALIZE(&px, ximage); in _XPutPixel()
674 i = ((x + ximage->xoffset) % ximage->bitmap_unit); in _XPutPixel()
676 XYNORMALIZE(&px, ximage); in _XPutPixel()
678 dst = &ximage->data[XYINDEX(x, y, ximage)]; in _XPutPixel()
680 } else if (ximage->format == XYPixmap) { in _XPutPixel()
681 plane = (ximage->bytes_per_line * ximage->height) * in _XPutPixel()
682 (ximage->depth - 1); /* do least signif plane 1st */ in _XPutPixel()
683 nbytes = ximage->bitmap_unit >> 3; in _XPutPixel()
684 for (j = ximage->depth; --j >= 0; ) { in _XPutPixel()
685 src = &ximage->data[XYINDEX(x, y, ximage) + plane]; in _XPutPixel()
689 XYNORMALIZE(&px, ximage); in _XPutPixel()
690 i = ((x + ximage->xoffset) % ximage->bitmap_unit); in _XPutPixel()
692 XYNORMALIZE(&px, ximage); in _XPutPixel()
694 dst = &ximage->data[XYINDEX(x, y, ximage) + plane]; in _XPutPixel()
699 plane = plane - (ximage->bytes_per_line * ximage->height); in _XPutPixel()
701 } else if (ximage->format == ZPixmap) { in _XPutPixel()
702 src = &ximage->data[ZINDEX(x, y, ximage)]; in _XPutPixel()
705 nbytes = (ximage->bits_per_pixel + 7) >> 3; in _XPutPixel()
707 ZNORMALIZE(&px, ximage); in _XPutPixel()
709 (x * ximage->bits_per_pixel) & 7, in _XPutPixel()
710 ximage->bits_per_pixel, (char *)&px); in _XPutPixel()
711 ZNORMALIZE(&px, ximage); in _XPutPixel()
713 dst = &ximage->data[ZINDEX(x, y, ximage)]; in _XPutPixel()
722 register XImage *ximage, in _XPutPixel32() argument
729 if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 32)) { in _XPutPixel32()
730 addr = &((unsigned char *)ximage->data) in _XPutPixel32()
731 [y * ximage->bytes_per_line + (x << 2)]; in _XPutPixel32()
732 if (*((const char *)&byteorderpixel) == ximage->byte_order) in _XPutPixel32()
734 else if (ximage->byte_order == MSBFirst) { in _XPutPixel32()
747 _XInitImageFuncPtrs(ximage); in _XPutPixel32()
748 return XPutPixel(ximage, x, y, pixel); in _XPutPixel32()
753 register XImage *ximage, in _XPutPixel16() argument
760 if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 16)) { in _XPutPixel16()
761 addr = &((unsigned char *)ximage->data) in _XPutPixel16()
762 [y * ximage->bytes_per_line + (x << 1)]; in _XPutPixel16()
763 if (ximage->byte_order == MSBFirst) { in _XPutPixel16()
772 _XInitImageFuncPtrs(ximage); in _XPutPixel16()
773 return XPutPixel(ximage, x, y, pixel); in _XPutPixel16()
778 register XImage *ximage, in _XPutPixel8() argument
783 if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 8)) { in _XPutPixel8()
784 ximage->data[y * ximage->bytes_per_line + x] = pixel; in _XPutPixel8()
787 _XInitImageFuncPtrs(ximage); in _XPutPixel8()
788 return XPutPixel(ximage, x, y, pixel); in _XPutPixel8()
793 register XImage *ximage, in _XPutPixel1() argument
801 if (((ximage->bits_per_pixel | ximage->depth) == 1) && in _XPutPixel1()
802 (ximage->byte_order == ximage->bitmap_bit_order)) { in _XPutPixel1()
803 xoff = x + ximage->xoffset; in _XPutPixel1()
804 yoff = y * ximage->bytes_per_line + (xoff >> 3); in _XPutPixel1()
806 if (ximage->bitmap_bit_order == MSBFirst) in _XPutPixel1()
811 ximage->data[yoff] |= bit; in _XPutPixel1()
813 ximage->data[yoff] &= ~bit; in _XPutPixel1()
816 _XInitImageFuncPtrs(ximage); in _XPutPixel1()
817 return XPutPixel(ximage, x, y, pixel); in _XPutPixel1()
832 XImage *ximage, in _XSubImage() argument
850 subimage->format = ximage->format; in _XSubImage()
851 subimage->byte_order = ximage->byte_order; in _XSubImage()
852 subimage->bitmap_unit = ximage->bitmap_unit; in _XSubImage()
853 subimage->bitmap_bit_order = ximage->bitmap_bit_order; in _XSubImage()
854 subimage->bitmap_pad = ximage->bitmap_pad; in _XSubImage()
855 subimage->bits_per_pixel = ximage->bits_per_pixel; in _XSubImage()
856 subimage->depth = ximage->depth; in _XSubImage()
883 if (height > ximage->height - y ) height = ximage->height - y; in _XSubImage()
884 if (width > ximage->width - x ) width = ximage->width - x; in _XSubImage()
888 pixel = XGetPixel(ximage, col, row); in _XSubImage()
964 register XImage *ximage, in _XAddPixel() argument
972 if ((ximage->bits_per_pixel | ximage->depth) == 1) { in _XAddPixel()
980 register unsigned char *dp = (unsigned char *) ximage->data; in _XAddPixel()
981 x = ximage->bytes_per_line * ximage->height; in _XAddPixel()
986 } else if ((ximage->format == ZPixmap) && in _XAddPixel()
987 (ximage->bits_per_pixel == 8)) { in _XAddPixel()
988 register unsigned char *dp = (unsigned char *) ximage->data; in _XAddPixel()
989 x = ximage->bytes_per_line * ximage->height; in _XAddPixel()
992 } else if ((ximage->format == ZPixmap) && in _XAddPixel()
993 (ximage->bits_per_pixel == 16) && in _XAddPixel()
994 (*((const char *)&byteorderpixel) == ximage->byte_order)) { in _XAddPixel()
995 register unsigned short *dp = (unsigned short *) ximage->data; in _XAddPixel()
996 x = (ximage->bytes_per_line >> 1) * ximage->height; in _XAddPixel()
999 } else if ((ximage->format == ZPixmap) && in _XAddPixel()
1000 (ximage->bits_per_pixel == 32) && in _XAddPixel()
1001 (*((const char *)&byteorderpixel) == ximage->byte_order)) { in _XAddPixel()
1002 register CARD32 *dp = (CARD32 *) ximage->data; in _XAddPixel()
1003 x = (ximage->bytes_per_line >> 2) * ximage->height; in _XAddPixel()
1007 for (y = ximage->height; --y >= 0; ) { in _XAddPixel()
1008 for (x = ximage->width; --x >= 0; ) { in _XAddPixel()
1009 register unsigned long pixel = XGetPixel(ximage, x, y); in _XAddPixel()
1011 XPutPixel(ximage, x, y, pixel); in _XAddPixel()