Ejemplo n.º 1
0
        internal ResponseCurve(int idx, int ChannelCount)
        {
            //Measurement unit signature (4 bytes)
            CurveType = (CurveMeasurementEncodings)Helper.GetUInt32(idx);
            //Counts of measurements in response arrays
            MeasurmentCounts = new int[ChannelCount];
            int end = idx + 4 + 4 * ChannelCount; int c = 0;

            for (int i = idx + 4; i < end; i += 4)
            {
                MeasurmentCounts[c] = (int)Helper.GetUInt32(i); c++;
            }
            //PCSXYZ values
            XYZvalues = new XYZnumber[ChannelCount];
            int start = end; end += 12 * ChannelCount; c = 0;

            for (int i = start; i < end; i += 12)
            {
                XYZvalues[c] = new XYZnumber(i); c++;
            }
            //Response arrays
            int p = MeasurmentCounts.Sum();

            ResponseArrays = new Response16Number[p];
            start          = end; end += 8 * p; c = 0;
            for (int i = start; i < end; i += 8)
            {
                ResponseArrays[c] = new Response16Number(i); c++;
            }
        }
Ejemplo n.º 2
0
        internal ICCHeader(byte[] arr)
        {
            bool ile = BitConverter.IsLittleEndian;

            //Profile size field (bytes 0 to 3)
            ProfileSize      = Helper.GetUInt32(0);
            Helper.IsReverse = new bool[ProfileSize];
            //Preferred CMM type field (bytes 4 to 7)
            CMMType = Helper.GetASCIIString(4, 4);
            //Profile version field (bytes 8 to 11) (10 and 11 are not used)
            ProfileVersionNumber = new VersionNumber(ICCProfile.DataBytes[8], ICCProfile.DataBytes[9]);
            //Profile/device class field (bytes 12 to 15)
            ProfileClass = (ProfileClassName)Helper.GetUInt32(12);
            //Data colour space field (bytes 16 to 20)
            DataColorspace = (ColorSpaceType)Helper.GetUInt32(16);
            //PCS field (bytes 20 to 23)
            PCS = (ColorSpaceType)Helper.GetUInt32(20);
            //Date and time field (bytes 24 to 35)
            CreationDate = Helper.GetDateTime(24);
            //Profile file signature field (bytes 36 to 39)
            ProfileFileSignature = Helper.GetASCIIString(36, 4);
            //Primary platform field (bytes 40 to 43)
            PrimaryPlatformSignature = (PrimaryPlatformName)Helper.GetUInt32(40);
            //Profile flags field (bytes 44 to 47)
            ProfileFlags = new ProfileFlag(44);
            //Device manufacturer field (bytes 48 to 51)
            DeviceManufacturer = (TagSignature)Helper.GetUInt32(48);
            //Device model field (bytes 52 to 55)
            DeviceModel = (TagSignature)Helper.GetUInt32(52);
            //Device attributes field (bytes 56 to 63)
            DeviceAttributes = new DeviceAttribute(56);
            //Rendering intent field (bytes 64 to 67) (66 and 67 are zero)
            RenderingIntent = (RenderingIntentName)Helper.GetUInt16(64);
            //PCS illuminant field (Bytes 68 to 79)
            PCSIlluminant = new XYZnumber(68);
            //Profile creator field (bytes 80 to 83)
            ProfileCreatorSignature = Helper.GetUInt32(64);;
            //Profile ID field (bytes 84 to 99)
            ProfileID = Helper.GetProfileID(84);
            //Reserved field (bytes 100 to 127)
        }
Ejemplo n.º 3
0
        internal ICCHeader(byte[] arr)
        {
            bool ile = BitConverter.IsLittleEndian;

            //Profile size field (bytes 0 to 3)
            ProfileSize = Helper.GetUInt32(0);
            Helper.IsReverse = new bool[ProfileSize];
            //Preferred CMM type field (bytes 4 to 7)
            CMMType = Helper.GetASCIIString(4, 4);
            //Profile version field (bytes 8 to 11) (10 and 11 are not used)
            ProfileVersionNumber = new VersionNumber(ICCProfile.DataBytes[8], ICCProfile.DataBytes[9]);
            //Profile/device class field (bytes 12 to 15)
            ProfileClass = (ProfileClassName)Helper.GetUInt32(12);
            //Data colour space field (bytes 16 to 20)
            DataColorspace = (ColorSpaceType)Helper.GetUInt32(16);
            //PCS field (bytes 20 to 23)
            PCS = (ColorSpaceType)Helper.GetUInt32(20);
            //Date and time field (bytes 24 to 35)
            CreationDate = Helper.GetDateTime(24);
            //Profile file signature field (bytes 36 to 39)
            ProfileFileSignature = Helper.GetASCIIString(36, 4);
            //Primary platform field (bytes 40 to 43)
            PrimaryPlatformSignature = (PrimaryPlatformName)Helper.GetUInt32(40);
            //Profile flags field (bytes 44 to 47)
            ProfileFlags = new ProfileFlag(44);
            //Device manufacturer field (bytes 48 to 51)
            DeviceManufacturer = (TagSignature)Helper.GetUInt32(48);
            //Device model field (bytes 52 to 55)
            DeviceModel = (TagSignature)Helper.GetUInt32(52);
            //Device attributes field (bytes 56 to 63)
            DeviceAttributes = new DeviceAttribute(56);
            //Rendering intent field (bytes 64 to 67) (66 and 67 are zero)
            RenderingIntent = (RenderingIntentName)Helper.GetUInt16(64);
            //PCS illuminant field (Bytes 68 to 79)
            PCSIlluminant = new XYZnumber(68);
            //Profile creator field (bytes 80 to 83)
            ProfileCreatorSignature = Helper.GetUInt32(64); ;
            //Profile ID field (bytes 84 to 99)
            ProfileID = Helper.GetProfileID(84);
            //Reserved field (bytes 100 to 127)
        }
Ejemplo n.º 4
0
 internal ResponseCurve(int idx, int ChannelCount)
 {
     //Measurement unit signature (4 bytes)
     CurveType = (CurveMeasurementEncodings)Helper.GetUInt32(idx);
     //Counts of measurements in response arrays
     MeasurmentCounts = new int[ChannelCount];
     int end = idx + 4 + 4 * ChannelCount; int c = 0;
     for (int i = idx + 4; i < end; i += 4) { MeasurmentCounts[c] = (int)Helper.GetUInt32(i); c++; }
     //PCSXYZ values
     XYZvalues = new XYZnumber[ChannelCount];
     int start = end; end += 12 * ChannelCount; c = 0;
     for (int i = start; i < end; i += 12) { XYZvalues[c] = new XYZnumber(i); c++; }
     //Response arrays
     int p = MeasurmentCounts.Sum();
     ResponseArrays = new Response16Number[p];
     start = end; end += 8 * p; c = 0;
     for (int i = start; i < end; i += 8) { ResponseArrays[c] = new Response16Number(i); c++; }
 }
Ejemplo n.º 5
0
 internal XYZTagDataEntry(int idx)
 {
     Data = new XYZnumber[(size - 8) / 12]; int c = 0;
     for (int i = idx; i < idx + size - 8; i += 12) { Data[c] = new XYZnumber(i); c++; }
 }
Ejemplo n.º 6
0
 internal viewingConditionsTagDataEntry(int idx)
 {
     //Un-normalized CIEXYZ values for illuminant (12 bytes)
     IlluminantXYZ = new XYZnumber(idx);
     //Un-normalized CIEXYZ values for surround (12 bytes)
     IlluminantXYZ = new XYZnumber(idx + 12);
     //Standard illuminant (4 bytes)
     Illuminant = (StandardIlluminant)Helper.GetUInt32(idx + 24);
 }
Ejemplo n.º 7
0
 internal measurementTagDataEntry(int idx)
 {
     //Standard observer (4 bytes)
     Observer = (StandardObserver)Helper.GetUInt32(idx);
     //nCIEXYZ tristimulus values for measurement backing
     XYZBacking = new XYZnumber(idx + 4);
     //Measurement geometry (4 bytes)
     Geometry = (MeasurementGeometry)Helper.GetUInt32(idx + 16);
     //Measurement flare (4 bytes)
     Flare = Helper.GetU16Fixed16Number(idx + 20);
     //Standard illuminant (4 bytes)
     Illuminant = (StandardIlluminant)Helper.GetUInt32(idx + 24);
 }