#!/usr/bin/perl -w
my
(
$profile
,
$tag
,
$temp
,
$raw1
,
$raw2
);
BEGIN { use_ok(
'ICC::Profile::para'
) };
can_ok(
'ICC::Profile::para'
,
qw(new new_fh write_fh size inverse derivative transform parametric array sdump)
);
$tag
= ICC::Profile::para->new;
isa_ok(
$tag
,
'ICC::Profile::para'
);
$profile
= t::lib::Boot->new(File::Spec->catfile(
't'
,
'data'
,
'eciRGB_v2_ICCv4.icc'
));
$tag
= ICC::Profile::para->new_fh(
$profile
,
$profile
->fh,
$profile
->tag_table->[3]);
isa_ok(
$tag
,
'ICC::Profile::para'
);
ok(
$tag
->size ==
$profile
->tag_table->[3][2],
'tag size'
);
$temp
= File::Temp::tempfile();
$tag
->write_fh(
$profile
,
$temp
,
$profile
->tag_table->[3]);
$temp
->flush;
seek
(
$profile
->fh,
$profile
->tag_table->[3][1], 0);
read
(
$profile
->fh,
$raw1
,
$tag
->size);
seek
(
$temp
,
$profile
->tag_table->[3][1], 0);
read
(
$temp
,
$raw2
,
$tag
->size);
ok(
$raw1
eq
$raw2
,
'raw data round-trip'
);
close
(
$profile
->fh);
close
(
$temp
);