Ejemplo n.º 1
0
        public void CIEXYZTRIPLE_FromHandleTest()
        {
            using (var profile = Profile.CreatePlaceholder(null))
            {
                var expected = new CIEXYZTRIPLE
                {
                    Red = new CIEXYZ {
                        X = 0.8322, Y = 1.0, Z = 0.7765
                    },
                    Green = new CIEXYZ {
                        X = 0.9642, Y = 1.0, Z = 0.8249
                    },
                    Blue = new CIEXYZ {
                        X = 0.7352, Y = 1.0, Z = 0.6115
                    }
                };

                profile.WriteTag(TagSignature.ChromaticAdaptation, expected);

                // Act
                // implicit call to FromHandle
                var actual = profile.ReadTag <CIEXYZTRIPLE>(TagSignature.ChromaticAdaptation);

                // Assert
                Assert.AreEqual(expected, actual);
            }
        }
Ejemplo n.º 2
0
        public void TagSignatureTest_ArgyllArts()
        {
            // Arrange
            using (var profile = Profile.CreatePlaceholder(null))
            {
                // Bradford matrix
                CIEXYZTRIPLE expected = new CIEXYZTRIPLE
                {
                    Red = new CIEXYZ {
                        X = 0.89509583, Y = 0.26640320, Z = -0.16140747
                    },
                    Green = new CIEXYZ {
                        X = -0.75019836, Y = 1.71350098, Z = 0.03669739
                    },
                    Blue = new CIEXYZ {
                        X = 0.03889465, Y = -0.06849670, Z = 1.02960205
                    }
                };

                // Act
                profile.WriteTag(TagSignature.ArgyllArts, expected);
                var actual = profile.ReadTag <CIEXYZTRIPLE>(TagSignature.ArgyllArts);

                // Assert
                Assert.AreEqual(expected, actual);
            }
        }
Ejemplo n.º 3
0
 public BITMAPINFOHEADER(int width, int height, ushort bpp)
 {
     biSize                   = (uint)Marshal.SizeOf(typeof(BITMAPINFOHEADER));
     biPlanes                 = 1;
     biCompression            = BI_COMPRESSION.BI_RGB;
     biWidth                  = width;
     biHeight                 = height;
     biBitCount               = bpp;
     biSizeImage              = (uint)(width * height * (bpp >> 3));
     biXPelsPerMeter          = 0;
     biYPelsPerMeter          = 0;
     biClrUsed                = 0;
     biClrImportant           = 0;
     bV5RedMask               = (uint)255 << 16;
     bV5GreenMask             = (uint)255 << 8;
     bV5BlueMask              = (uint)255;
     bV5AlphaMask             = (uint)255 << 24;
     bV5CSType                = 1934772034;
     bV5Endpoints             = new CIEXYZTRIPLE();
     bV5Endpoints.ciexyzBlue  = new CIEXYZ(0);
     bV5Endpoints.ciexyzGreen = new CIEXYZ(0);
     bV5Endpoints.ciexyzRed   = new CIEXYZ(0);
     bV5GammaRed              = 0;
     bV5GammaGreen            = 0;
     bV5GammaBlue             = 0;
     bV5Intent                = 4;
     bV5ProfileData           = 0;
     bV5ProfileSize           = 0;
     bV5Reserved              = 0;
 }
Ejemplo n.º 4
0
    public void PopulateWithData(byte[] data, int StartAddress)

    {
        bV5Size = BitConverter.ToUInt32(data, StartAddress + 0);                         //4

        bV5Width = BitConverter.ToInt32(data, StartAddress + 4);                         //8

        bV5Height = BitConverter.ToInt32(data, StartAddress + 8);                        //12

        bV5Planes = BitConverter.ToUInt16(data, StartAddress + 12);                      //14

        bV5BitCount = BitConverter.ToUInt16(data, StartAddress + 14);                    //16

        bV5Compression = ( BI_COMPRESSION)BitConverter.ToInt32(data, StartAddress + 16); //20

        bV5SizeImage = BitConverter.ToUInt32(data, StartAddress + 20);                   //24

        bV5XPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 24);                //28

        bV5YPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 28);                //32

        bV5ClrUsed = BitConverter.ToUInt32(data, StartAddress + 32);                     //36

        bV5ClrImportant = BitConverter.ToUInt32(data, StartAddress + 36);                //40

        bV5RedMask = BitConverter.ToUInt32(data, StartAddress + 40);                     //44

        bV5GreenMask = BitConverter.ToUInt32(data, StartAddress + 44);                   //48

        bV5BlueMask = BitConverter.ToUInt32(data, StartAddress + 48);                    //52

        bV5AlphaMask = BitConverter.ToUInt32(data, StartAddress + 52);                   //56

        bV5CSType = BitConverter.ToUInt32(data, StartAddress + 56);                      //60

        bV5Endpoints = new CIEXYZTRIPLE();



        bV5Endpoints.PopulateWithData(data, 60);                         //96

        bV5GammaRed = BitConverter.ToUInt32(data, StartAddress + 96);    //100

        bV5GammaGreen = BitConverter.ToUInt32(data, StartAddress + 100); //104

        bV5GammaBlue = BitConverter.ToUInt32(data, StartAddress + 104);  //108



        bV5Intent = BitConverter.ToUInt32(data, StartAddress + 108);      //112

        bV5ProfileData = BitConverter.ToUInt32(data, StartAddress + 112); //116

        bV5ProfileSize = BitConverter.ToUInt32(data, StartAddress + 116); //120

        bV5Reserved = BitConverter.ToUInt32(data, StartAddress + 120);    //124
    }
Ejemplo n.º 5
0
    public void PopulateWithData(byte[] data, int StartAddress)

    {
        bV4Size = BitConverter.ToUInt32(data, StartAddress + 0);                           //4

        bV4Width = BitConverter.ToInt32(data, StartAddress + 4);                           //8

        bV4Height = BitConverter.ToInt32(data, StartAddress + 8);                          //12

        bV4Planes = BitConverter.ToUInt16(data, StartAddress + 12);                        //14

        bV4BitCount = BitConverter.ToUInt16(data, StartAddress + 14);                      //16

        bV4V4Compression = ( BI_COMPRESSION)BitConverter.ToInt32(data, StartAddress + 16); //20

        bV4SizeImage = BitConverter.ToUInt32(data, StartAddress + 20);                     //24

        bV4XPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 24);                  //28

        bV4YPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 28);                  //32

        bV4ClrUsed = BitConverter.ToUInt32(data, StartAddress + 32);                       //36

        bV4ClrImportant = BitConverter.ToUInt32(data, StartAddress + 36);                  //40

        bV4RedMask = BitConverter.ToUInt32(data, StartAddress + 40);                       //44

        bV4GreenMask = BitConverter.ToUInt32(data, StartAddress + 44);                     //48

        bV4BlueMask = BitConverter.ToUInt32(data, StartAddress + 48);                      //52

        bV4AlphaMask = BitConverter.ToUInt32(data, StartAddress + 52);                     //56

        BV4CsType = BitConverter.ToUInt32(data, StartAddress + 56);                        //60

        bV4Endpoints = new CIEXYZTRIPLE();

        bV4Endpoints.PopulateWithData(data, 60);                         //96

        bV4GammaRed = BitConverter.ToUInt32(data, StartAddress + 96);    //100

        bV4GammaGreen = BitConverter.ToUInt32(data, StartAddress + 100); //104

        bV4GammaBlue = BitConverter.ToUInt32(data, StartAddress + 104);  //108
    }