613{
621 GLboolean r_flag, g_flag, b_flag, a_flag, l_flag;
624
626
627
628 r_flag = g_flag = b_flag = a_flag = l_flag =
GL_FALSE;
630 {
634 break;
638 break;
642 break;
646 break;
650 break;
654 break;
656 r_flag = g_flag = b_flag =
GL_TRUE;
658 break;
660 r_flag = g_flag = b_flag =
GL_TRUE;
663 break;
665 r_flag = g_flag = b_flag = a_flag =
GL_TRUE;
667 break;
669 r_flag = g_flag = b_flag = a_flag =
GL_TRUE;
672 break;
673 default:
680 return;
681 }
682
683
686 {
693 return;
694 }
695
696
697 a =
ctx->Pack.Alignment;
698 if (
ctx->Pack.RowLength > 0)
699 {
700 l =
ctx->Pack.RowLength;
701 }
702 else
703 {
705 }
706
708 {
710 }
711 else
712 {
714 }
715
716
718
719
721 {
722
723
724
725 if (
ctx->Visual->RGBAflag)
726 {
731 GLfloat rscale = 1.0F *
ctx->Visual->InvRedScale;
732 GLfloat gscale = 1.0F *
ctx->Visual->InvGreenScale;
733 GLfloat bscale = 1.0F *
ctx->Visual->InvBlueScale;
734 GLfloat ascale = 1.0F *
ctx->Visual->InvAlphaScale;
735
736
739 {
741 }
743 {
748 }
749
750 if (scale_or_bias)
751 {
753 }
754 if (
ctx->Pixel.MapColorFlag)
755 {
757 }
762 }
763 else
764 {
765
768
769 if (
ctx->Pixel.IndexShift != 0 ||
ctx->Pixel.IndexOffset != 0)
770 {
772 if (
ctx->Pixel.IndexShift < 0)
773 {
774
775 s = -
ctx->Pixel.IndexShift;
777 {
779 }
780 }
781 else
782 {
783
784 s =
ctx->Pixel.IndexShift;
786 {
788 }
789 }
790 }
791
793 {
798 }
799 }
800
801 if (l_flag)
802 {
804 {
807 }
808 }
809
810
811
812
813
815 {
817 {
820 {
821 if (is_bgr)
822 {
823 if (b_flag)
825 if (g_flag)
827 if (r_flag)
829 }
830 else
831 {
832 if (r_flag)
834 if (g_flag)
836 if (b_flag)
838 }
839 if (l_flag)
841 if (a_flag)
843 }
844 break;
845 }
847 {
850 {
851 if (is_bgr)
852 {
853 if (b_flag)
855 if (g_flag)
857 if (r_flag)
859 }
860 else
861 {
862 if (r_flag)
864 if (g_flag)
866 if (b_flag)
868 }
869 if (l_flag)
871 if (a_flag)
873 }
874 break;
875 }
877 {
880 {
881 if (is_bgr)
882 {
883 if (b_flag)
885 if (g_flag)
887 if (r_flag)
889 }
890 else
891 {
892 if (r_flag)
894 if (g_flag)
896 if (b_flag)
898 }
899 if (l_flag)
901 if (a_flag)
903 }
904 if (
ctx->Pack.SwapBytes)
905 {
907 }
908 break;
909 }
911 {
914 {
915 if (is_bgr)
916 {
917 if (b_flag)
919 if (g_flag)
921 if (r_flag)
923 }
924 else
925 {
926 if (r_flag)
928 if (g_flag)
930 if (b_flag)
932 }
933 if (l_flag)
935 if (a_flag)
937 }
938 if (
ctx->Pack.SwapBytes)
939 {
941 }
942 break;
943 }
945 {
948 {
949 if (is_bgr)
950 {
951 if (b_flag)
953 if (g_flag)
955 if (r_flag)
957 }
958 else
959 {
960 if (r_flag)
962 if (g_flag)
964 if (b_flag)
966 }
967 if (l_flag)
969 if (a_flag)
971 }
972 if (
ctx->Pack.SwapBytes)
973 {
975 }
976 break;
977 }
979 {
982 {
983 if (is_bgr)
984 {
985 if (b_flag)
987 if (g_flag)
989 if (r_flag)
991 }
992 else
993 {
994 if (r_flag)
996 if (g_flag)
998 if (b_flag)
1000 }
1001 if (l_flag)
1003 if (a_flag)
1005 }
1006 if (
ctx->Pack.SwapBytes)
1007 {
1009 }
1010 break;
1011 }
1013 {
1016 {
1017 if (is_bgr)
1018 {
1019 if (b_flag)
1021 if (g_flag)
1023 if (r_flag)
1025 }
1026 else
1027 {
1028 if (r_flag)
1030 if (g_flag)
1032 if (b_flag)
1034 }
1035 if (l_flag)
1036 *
dst++ = luminance[
i];
1037 if (a_flag)
1039 }
1040 if (
ctx->Pack.SwapBytes)
1041 {
1043 }
1044 break;
1045 }
1046 default:
1048 }
1049 }
1055}
void gl_read_alpha_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte alpha[])
GLint gl_sizeof_type(GLenum type)
void gl_swap4(GLuint *p, GLuint n)
void gl_swap2(GLushort *p, GLuint n)
#define GL_UNSIGNED_SHORT
GLdouble GLdouble GLdouble r
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 GLint GLint j
#define DEFARRAY(TYPE, NAME, SIZE)
#define FLOAT_TO_USHORT(X)
#define FLOAT_TO_UBYTE(X)
#define FLOAT_TO_SHORT(X)
static int sum(int x_, int y_)
static void scale_and_bias_rgba(GLcontext *ctx, GLint n, GLfloat red[], GLfloat green[], GLfloat blue[], GLfloat alpha[])
static void map_rgba(GLcontext *ctx, GLint n, GLfloat red[], GLfloat green[], GLfloat blue[], GLfloat alpha[])
static GLboolean scale_or_bias_rgba(GLcontext *ctx)
#define CLAMP(f, min, max)