Quik linksSearch all WebsiteSearch Commercial DirectoryVisitors Counter1518759 Visitors
Who's OnlineWe have 1 guest onlineLogin Form |
Home
f Function: Interpret_IRB_to_HTML
******************************************************************************/
/******************************************************************************
*
* INTERNAL FUNCTIONS
*
******************************************************************************/
/******************************************************************************
*
* Internal Function: Interpret_Transfer_Function
*
* Description: Used by Interpret_IRB_to_HTML to interpret Color transfer functions
* for Photoshop IRB resource 0x03F8. Converts the transfer function
* information to a human readable version.
*
* Parameters: Transfer_Function_Binary - a 28 byte Ink curves structure string
*
* Returns: output_str - the text string containing the transfer function
* information
*
******************************************************************************/
function Interpret_Transfer_Function( $Transfer_Function_Binary )
{
// Unpack the Transfer function information
$Trans_vals = unpack ( "n13Curve/nOverride", $Transfer_Function_Binary );
$output_str = "Transfer Function Points: ";
// Cycle through each of the Transfer function array values
foreach ( $Trans_vals as $Key => $val )
{
// Check if the value should be negative
if ($val > 32768 )
{
// Value should be negative - make it so
$val = $val - 65536;
}
// Check that the Override item is not getting in this list, and
// that the value is not -1, which means ignored
if ( ( $Key != "Override" ) && ( $val != -1 ) )
{
// This is a valid transfer function point, output it
$output_str .= $val/10 . "%, ";
}
}
// Output the override info
if ( $Trans_vals['Override'] == 0 )
{
$output_str .= "\nOverride: Let printer supply curve";
}
else
{
$output_str .= "\nOverride: Override printer’s default transfer curve";
}
// Return the result
return $output_str;
}
/******************************************************************************
* End of Function: Interpret_Transfer_Function
******************************************************************************/
/******************************************************************************
*
* Internal Function: Interpret_Halftone
*
* Description: Used by Interpret_IRB_to_HTML to interpret Color halftoning information
* for Photoshop IRB resource 0x03F5. Converts the halftoning info
* to a human readable version.
*
* Parameters: Transfer_Function_Binary - a 18 byte Halftone screen parameter
& structure string
*
* Returns: output_str - the text string containing the transfer function
* information
*
******************************************************************************/
function Interpret_Halftone( $Halftone_Binary )
{
// Create a string to receive the output
$output_str = "";
// Unpack the binary data into an array
$HalftoneInfo = unpack( "nFreqVal_int/nFreqVal_dec/nFreqScale/nAngle_int/nAngle_dec/nShapeCode/NMisc/CAccurate/CDefault", $Halftone_Binary );
// Interpret Ink Screen Frequency
$output_str .= "Ink Screen Frequency = " . ($HalftoneInfo['FreqVal_int'] + $HalftoneInfo['FreqVal_dec']/65536) . " lines per Inch\n";
if ( $HalftoneInfo['FreqScale'] == 1 )
{
$output_str .= "Display units for Ink Screen Frequency = Inches\n";
}
else
{
$output_str .= "Display units for Ink Screen Frequency = Centimetres\n";
}
// Interpret Angle for screen
$output_str .= "Angle for screen = " . ($HalftoneInfo['Angle_int'] + $HalftoneInfo['Angle_dec']/65536) . " degrees\n";
// Interpret Shape of Halftone Dots
if ($HalftoneInfo['ShapeCode'] > 32768 )
{
$HalftoneInfo['ShapeCode'] = $HalftoneInfo['ShapeCode'] - 65536;
}
if ( $HalftoneInfo['ShapeCode'] == 0 )
{
$output_str .= "Shape of Halftone Dots = Round\n";
}
elseif ( $HalftoneInfo['ShapeCode'] == 1 )
{
$output_str .= "Shape of Halftone Dots = Ellipse\n";
}
elseif ( $HalftoneInfo['ShapeCode'] == 2 )
{
$output_str .= "Shape of Halftone Dots = Line\n";
}
elseif ( $HalftoneInfo['ShapeCode'] == 3 )
{
$output_str .= "Shape of Halftone Dots = Square\n";
}
elseif ( $HalftoneInfo['ShapeCode'] == 4 )
{
$output_str .= "Shape of Halftone Dots = Cross\n";
}
elseif ( $HalftoneInfo['ShapeCode'] == 6 )
{
$output_str .= "Shape of Halftone Dots = Diamond\n";
}
else
{
$output_str .= "Shape of Halftone Dots = Unknown shape (" . $HalftoneInfo['ShapeCode'] . ")\n";
}
// Interpret Accurate Screens
if ( $HalftoneInfo['Accurate'] == 1 )
{
$output_str .= "Use Accurate Screens Selected\n";
}
else
{
$output_str .= "Use Other (not Accurate) Screens Selected\n";
}
// Interpret Printer Default Screens
if ( $HalftoneInfo['Default'] == 1 )
{
$output_str .= "Use printer’s default screens\n";
}
else
{
$output_str .= "Use Other (not Printer Default) Screens Selected\n";
}
// Return Text
return $output_str;
}
/******************************************************************************
* End of Global Variable: Interpret_Halftone
******************************************************************************/
/******************************************************************************
* Global Variable: Photoshop_ID_Names
*
* Contents: The Names of the Photoshop IRB resources, indexed by their
* resource number
*
******************************************************************************/
$GLOBALS[ "Photoshop_ID_Names" ] = array(
0x03E8 => "Number of channels, rows, columns, depth, and mode. (Obsolete)",
0x03E9 => "Macintosh print manager info ",
0x03EB => "Indexed color table (Obsolete)",
0x03ED => "Resolution Info",
0x03EE => "Alpha Channel Names",
0x03EF => "Display Info",
0x03F0 => "Caption String",
0x03F1 => "Border information",
0x03F2 => "Background color",
0x03F3 => "Print flags",
0x03F4 => "Grayscale and multichannel halftoning information",
0x03F5 => "Color halftoning information",
0x03F6 => "Duotone halftoning information",
0x03F7 => "Grayscale and multichannel transfer function",
0x03F8 => "Color transfer functions",
0x03F9 => "Duotone transfer functions",
0x03FA => "Duotone image information",
0x03FB => "Black and white values",
0x03FC => "Obsolete Resource.",
0x03FD => "EPS options",
0x03FE => "Quick Mask information",
0x03FF => "Obsolete Resource",
0x0400 => "Layer state information",
0x0401 => "Working path (not saved)",
0x0402 => "Layers group information",
0x0403 => "Obsolete Resource",
0x0404 => "IPTC-NAA record",
0x0405 => "Raw Format Image mode",
0x0406 => "JPEG quality",
0x0408 => "Grid and guides information",
0x0409 => "Thumbnail resource",
0x040A => "Copyright flag",
0x040B => "URL",
0x040C => "Thumbnail resource",
0x040D => "Global Angle",
0x040E => "Color samplers resource",
0x040F => "ICC Profile",
0x0410 => "Watermark",
0x0411 => "ICC Untagged",
0x0412 => "Effects visible",
0x0413 => "Spot Halftone",
0x0414 => "Document Specific IDs",
0x0415 => "Unicode Alpha Names",
0x0416 => "Indexed Color Table Count",
0x0417 => "Tansparent Index. Index of transparent color, if any.",
0x0419 => "Global Altitude",
0x041A => "Slices",
0x041B => "Workflow URL",
0x041C => "Jump To XPEP",
0x041D => "Alpha Identifiers",
0x041E => "URL List",
0x0421 => "Version Info",
0x0BB7 => "Name of clipping path.",
0x2710 => "Print flags information"
);
/******************************************************************************
* End of Global Variable: Photoshop_ID_Names
******************************************************************************/
/******************************************************************************
* Global Variable: Photoshop_ID_Descriptions
*
* Contents: The Descriptions of the Photoshop IRB resources, indexed by their
* resource number
*
******************************************************************************/
$GLOBALS[ "Photoshop_ID_Descriptions" ] = array(
0x03E8 => "Obsolete—Photoshop 2.0 only. number of channels, rows, columns, depth, and mode.",
0x03E9 => "Optional. Macintosh print manager print info record.",
0x03EB => "Obsolete—Photoshop 2.0 only. Contains the indexed color table.",
0x03ED => "ResolutionInfo structure. See Appendix A in Photoshop SDK Guide.pdf",
0x03EE => "Names of the alpha channels as a series of Pascal strings.",
0x03EF => "DisplayInfo structure. See Appendix A in Photoshop SDK Guide.pdf",
0x03F0 => "Optional. The caption as a Pascal string.",
0x03F1 => "Border information. border width, border units",
0x03F2 => "Background color.",
0x03F3 => "Print flags. labels, crop marks, color bars, registration marks, negative, flip, interpolate, caption.",
0x03F4 => "Grayscale and multichannel halftoning information.",
0x03F5 => "Color halftoning information.",
0x03F6 => "Duotone halftoning information.",
0x03F7 => "Grayscale and multichannel transfer function.",
0x03F8 => "Color transfer functions.",
0x03F9 => "Duotone transfer functions.",
0x03FA => "Duotone image information.",
0x03FB => "Effective black and white values for the dot range.",
0x03FC => "Obsolete Resource.",
0x03FD => "EPS options.",
0x03FE => "Quick Mask information. Quick Mask channel ID, Mask initially empty.",
0x03FF => "Obsolete Resource.",
0x0400 => "Layer state information. Index of target layer.",
0x0401 => "Working path (not saved).",
0x0402 => "Layers group information. Group ID for the dragging groups. Layers in a group have the same group ID.",
0x0403 => "Obsolete Resource.",
0x0404 => "IPTC-NAA record. This contains the File Info... information. See the IIMV4.pdf document.",
0x0405 => "Image mode for raw format files.",
0x0406 => "JPEG quality. Private.",
0x0408 => "Grid and guides information.",
0x0409 => "Thumbnail resource.",
0x040A => "Copyright flag. Boolean indicating whether image is copyrighted. Can be set via Property suite or by user in File Info...",
0x040B => "URL. Handle of a text string with uniform resource locator. Can be set via Property suite or by user in File Info...",
0x040C => "Thumbnail resource.",
0x040D => "Global Angle. Global lighting angle for effects layer.",
0x040E => "Color samplers resource.",
0x040F => "ICC Profile. The raw bytes of an ICC format profile, see the ICC34.pdf and ICC34.h files from the Internation Color Consortium.",
0x0410 => "Watermark.",
0x0411 => "ICC Untagged. Disables any assumed profile handling when opening the file. 1 = intentionally untagged.",
0x0412 => "Effects visible. Show/hide all the effects layer.",
0x0413 => "Spot Halftone. Version, length, variable length data.",
0x0414 => "Document specific IDs for layer identification",
0x0415 => "Unicode Alpha Names. Length and the string",
0x0416 => "Indexed Color Table Count. Number of colors in table that are actually defined",
0x0417 => "Transparent Index. Index of transparent color, if any.",
0x0419 => "Global Altitude.",
0x041A => "Slices.",
0x041B => "Workflow URL. Length, string.",
0x041C => "Jump To XPEP. Major version, Minor version, Count. Table which can include: Dirty flag, Mod date.",
0x041D => "Alpha Identifiers.",
0x041E => "URL List. Count of URLs, IDs, and strings",
0x0421 => "Version Info. Version, HasRealMergedData, string of writer name, string of reader name, file version.",
0x0BB7 => "Name of clipping path.",
0x2710 => "Print flags information. Version, Center crop marks, Bleed width value, Bleed width scale."
);
/******************************************************************************
* End of Global Variable: Photoshop_ID_Descriptions
******************************************************************************/
?>
|