526{
532
533 zoom =
ctx->Pixel.ZoomX != 1.0 ||
ctx->Pixel.ZoomY != 1.0;
534
535
536 x = (
GLint) (
ctx->Current.RasterPos[0] + 0.5F);
537 y = (
GLint) (
ctx->Current.RasterPos[1] + 0.5F);
540 {
541
544 {
546 }
547 }
548
549
550 if (
ctx->Pixel.RedScale != 1.0F ||
ctx->Pixel.RedBias != 0.0F
551 ||
ctx->Pixel.GreenScale != 1.0F ||
ctx->Pixel.GreenBias != 0.0F
552 ||
ctx->Pixel.BlueScale != 1.0F ||
ctx->Pixel.BlueBias != 0.0F
553 ||
ctx->Pixel.AlphaScale != 1.0F ||
ctx->Pixel.AlphaBias != 0.0F)
554 {
556 }
557 else
558 {
560 }
561
562
563 if (
ctx->RasterMask == 0 && !zoom &&
x >= 0 &&
y >= 0
564 &&
x + width <= ctx->
Buffer->Width
565 &&
y + height <= ctx->
Buffer->Height)
566 {
568 }
569 else
570 {
572 }
573
574
577 && !
ctx->Pixel.MapColorFlag
578 && !scale_or_bias &&
ctx->Visual->EightBitColor)
579 {
582
585 {
586
591 {
593 {
597 }
598 if (quick_draw)
599 {
602 }
603 else if (zoom)
604 {
607 }
608 else
609 {
612 }
613 }
617 }
619 {
620
625 {
627 {
631 }
632 if (quick_draw)
633 {
636 }
637 else if (zoom)
638 {
641 }
642 else
643 {
646 }
647 }
651 }
652 else
653 {
654
657 {
658 if (quick_draw)
659 {
662 }
663 else if (zoom)
664 {
666 lum, lum, lum,
alpha, desty);
667 }
668 else
669 {
672 }
673 }
674 }
676 }
677 else
678 {
679
680 GLboolean r_flag, g_flag, b_flag, a_flag, l_flag;
683
684 r_flag = g_flag = b_flag = a_flag = l_flag =
GL_FALSE;
687 {
691 break;
695 break;
699 break;
703 break;
705 r_flag = g_flag = b_flag =
GL_TRUE;
707 break;
710 r_flag = g_flag = b_flag =
GL_TRUE;
712 break;
716 break;
720 break;
722 r_flag = g_flag = b_flag = a_flag =
GL_TRUE;
724 break;
727 r_flag = g_flag = b_flag = a_flag =
GL_TRUE;
729 break;
730 default:
732 return;
733 }
734
735
737 {
746
747
749 {
751 {
754 {
755 if (l_flag)
756 {
758 }
759 else if (is_bgr)
760 {
764 }
765 else
766 {
770 }
772 }
773 }
774 break;
776 {
779 {
780 if (l_flag)
781 {
783 }
784 else if (is_bgr)
785 {
789 }
790 else
791 {
795 }
797 }
798 }
799 break;
801
802 break;
804 {
807 {
808 if (l_flag)
809 {
811 }
812 else if (is_bgr)
813 {
817 }
818 else
819 {
823 }
825 }
826 }
827 break;
829 {
832 {
833 if (l_flag)
834 {
836 }
837 else if (is_bgr)
838 {
842 }
843 else
844 {
848 }
850 }
851 }
852 break;
854 {
857 {
858 if (l_flag)
859 {
861 }
862 else if (is_bgr)
863 {
867 }
868 else
869 {
873 }
875 }
876 }
877 break;
879 {
882 {
883 if (l_flag)
884 {
886 }
887 else if (is_bgr)
888 {
892 }
893 else
894 {
898 }
900 }
901 }
902 break;
904 {
907 {
908 if (l_flag)
909 {
910 rf[
j] = gf[
j] = bf[
j] = *
src++;
911 }
912 else if (is_bgr)
913 {
914 bf[
j] = b_flag ? *
src++ : 0.0;
915 gf[
j] = g_flag ? *
src++ : 0.0;
916 rf[
j] = r_flag ? *
src++ : 0.0;
917 }
918 else
919 {
920 rf[
j] = r_flag ? *
src++ : 0.0;
921 gf[
j] = g_flag ? *
src++ : 0.0;
922 bf[
j] = b_flag ? *
src++ : 0.0;
923 }
924 af[
j] = a_flag ? *
src++ : 1.0;
925 }
926 }
927 break;
928 default:
930 return;
931 }
932
933
934 if (scale_or_bias)
935 {
937 {
939 r = rf[
j] *
ctx->Pixel.RedScale +
ctx->Pixel.RedBias;
940 g = gf[
j] *
ctx->Pixel.GreenScale +
ctx->Pixel.GreenBias;
941 b = bf[
j] *
ctx->Pixel.BlueScale +
ctx->Pixel.BlueBias;
942 a = af[
j] *
ctx->Pixel.AlphaScale +
ctx->Pixel.AlphaBias;
947 }
948 }
949
950
951 if (
ctx->Pixel.MapColorFlag)
952 {
958 {
959 rf[
j] =
ctx->Pixel.MapRtoR[(
GLint) (rf[
j] * rscale)];
960 gf[
j] =
ctx->Pixel.MapGtoG[(
GLint) (gf[
j] * gscale)];
961 bf[
j] =
ctx->Pixel.MapBtoB[(
GLint) (bf[
j] * bscale)];
962 af[
j] =
ctx->Pixel.MapAtoA[(
GLint) (af[
j] * ascale)];
963 }
964 }
965
966
968 {
973 }
974
975
976 if (quick_draw)
977 {
980 }
981 else if (zoom)
982 {
985 }
986 else
987 {
990 }
991
1000 }
1001 }
1002
1003}
void gl_problem(const GLcontext *ctx, const char *s)
void gl_error(GLcontext *ctx, GLenum error, const char *s)
#define GL_UNSIGNED_SHORT
GLint GLint GLint GLint GLint x
#define GL_LUMINANCE_ALPHA
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLuint GLuint GLsizei GLenum type
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLenum GLenum GLuint components
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define UBYTE_TO_FLOAT(B)
#define DEFARRAY(TYPE, NAME, SIZE)
#define MEMSET(DST, VAL, N)
#define SHORT_TO_FLOAT(S)
#define USHORT_TO_FLOAT(S)
void gl_write_zoomed_color_span(GLcontext *ctx, GLuint n, GLint x, GLint y, const GLdepth z[], const GLubyte red[], const GLubyte green[], const GLubyte blue[], const GLubyte alpha[], GLint y0)
void gl_write_color_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLdepth z[], GLubyte r[], GLubyte g[], GLubyte b[], GLubyte a[], GLenum primitive)
#define CLAMP(f, min, max)