ICC-Profile

 view release on metacpan or  search on metacpan

lib/ICC/Profile/gbd_.pm  view on Meta::CPAN

		
		# verify number of faces
		(@{$self->[1]} >= 4) || croak('number of faces < 4');
		
		# verify number of vertices per face
		(@{$self->[1]} == 3) || croak('number of vertices per face <> 3');
		
		# check gamut faces
		($f, $v, $e) = _check_faces($self);
		
		# verify closed shape using Euler's formula
		($f + $v - $e == 2) || carp('not a closed shape');
		
	}

	# if 'pcs' key defined
	if (defined($hash->{'pcs'})) {
		
		# get value
		$value = $hash->{'pcs'};
		

lib/ICC/Profile/vcgt.pm  view on Meta::CPAN

		if (UNIVERSAL::isa($self->[1][$i], 'ICC::Profile::curv')) {
			
			# transform using 'curv' method
			$out[$i] = $self->[1][$i]->_transform($dir, $in[$i]);
			
		} else {
			
			# if normal direction
			if ($dir == 0) {
				
				# forward transform using formula (out = min + (max - min) * input^gamma)
				$out[$i] = $self->[1][$i][1] + ($self->[1][$i][2] - $self->[1][$i][1]) * $in[$i]**$self->[1][$i][0];
				
			} else {
				
				# reverse transform using formula (out = ((input - min)/(max - min))^(1/gamma))
				$out[$i] = (($in[$i] - $self->[1][$i][1])/($self->[1][$i][2] - $self->[1][$i][1]))**(1/$self->[1][$i][0]);
				
			}
			
		}
		
	}

	# return output array
	return(@out);

lib/ICC/Profile/vcgt.pm  view on Meta::CPAN

				# unpack table
				@table = unpack('n*', $buf);
				
				# save as 'curv' object
				$self->[1][$i] = ICC::Profile::curv->new([map {$_/65535} @table]);
				
			}
			
		}
		
	# if formula
	} elsif ($tagType == 1) {
		
		# for each RGB
		for my $i (0 .. 2) {
			
			# read 12 bytes
			read($fh, $buf, 12);
			
			# unpack gamma, min, max (s15Fixed16Number values)
			$self->[1][$i] = [ICC::Shared::s15f162v(unpack('N3', $buf))];

lib/ICC/Profile/vcgt.pm  view on Meta::CPAN

			# else 16-bit
			} else {
				
				# write table limiting values, converting to 16-bit, adding 0.5 to round
				print $fh pack('n*', map {$_ < 0 ? 0 : ($_ > 1 ? 65535 : $_ * 65535 + 0.5)} @{$self->[1][$i]->array()});
				
			}
			
		}
		
	# if formula
	} else {
		
		# if gamma type 'curv' objects
		if (UNIVERSAL::isa($self->[1][0], 'ICC::Profile::curv')) {
			
			# for each RGB
			for my $i (0 .. 2) {
				
				# get 'curv' object index (could be just one 'curv')
				my $j = defined($self->[1][$i]) ? $i : 0;

lib/ICC/Shared.pm  view on Meta::CPAN


	# compute n
	my $n = ($x - 0.3320)/($y - 0.1858);

	# return CCT
	return(-449 * $n**3 + 3525 * $n**2 - 6823.3 * $n + 5520.33);

}

# black body radiance (Planck's law)
# using constants and formula per CIE 15
# wavelength in nm, temperature in degrees Kelvin
# parameters: (wavelength, temperature)
# returns: (radiance)
sub bbrad {

	# get parameters
	my ($lambda, $T) = @_;

	# CIE constants
	my $c1 = 3.741771E-16; # 2πhc²

lib/ICC/Templates/CxF3_Core.xsd  view on Meta::CPAN

				<xs:element name="SerialNumber" type="xs:string" minOccurs="0"/>
				<xs:element ref="cc:DeviceClass" minOccurs="0"/>
				<xs:element ref="cc:DeviceFilter" minOccurs="0"/>
				<xs:element ref="cc:DeviceIllumination" minOccurs="0"/>
				<xs:element name="DevicePolarization" type="xs:boolean" minOccurs="0"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="Colorant">
		<xs:annotation>
			<xs:documentation>Element which defines a specific colorant used within a formula. If the colorant is a base or resin the optional attribute isBase should be set to yes</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="PartNumber" type="xs:string" minOccurs="0"/>
				<xs:element name="Density" type="xs:double" nillable="true" minOccurs="0"/>
				<xs:element name="Value" type="xs:double"/>
			</xs:sequence>
			<xs:attribute name="Name" type="xs:string" use="required"/>
			<xs:attribute name="ID" type="xs:string" use="optional"/>
			<xs:attribute name="isBase" type="xs:boolean" use="optional"/>

lib/ICC/Templates/CxF3_Core.xsd  view on Meta::CPAN

				<xs:element name="R" type="xs:short"/>
				<xs:element name="G" type="xs:short"/>
				<xs:element name="B" type="xs:short"/>
			</xs:sequence>
			<xs:attribute name="Name" type="xs:string"/>
			<xs:attribute name="ColorSpecification" type="xs:NCName" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ColorRecipe">
		<xs:annotation>
			<xs:documentation>An element which contains a recipe(formula) consisting primarily of a list of named colorants and the amount of each.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="cc:CreationDate"/>
				<xs:element ref="cc:Tag" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="cc:Substrate" minOccurs="0"/>
				<xs:element ref="cc:Process" minOccurs="0"/>
				<xs:element ref="cc:Colorant" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="Units" type="xs:string" use="required"/>

pod/ICC/Shared.pod  view on Meta::CPAN

=head2 ASTM Standards

B<ASTM E 2022> I<Standard Practice for Calculation of Weighting Factors for Tristimulus Integration>

=head2 CIE Standards

B<CIE 15> I<Colorimetry>

=head2 DIN Standards

B<DIN 6176> I<Colorimetric evaluation of colour differences of surface colours according to DIN99 formula>

=head2 ICC Specification

The ICC (International Color Consortium) maintains a web site at L<http://www.color.org>
The ICC specification and related materials may be downloaded from this web site.

The ICC specification is also published as ISO 15076-1.

=head2 ISO Standards



( run in 0.591 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )