Module Pdfgraphics

module Pdfgraphics: sig .. end
Structured Graphics - Incomplete and unsupported.

type fpoint = float * float 
Point.
type winding_rule = 
| EvenOdd
| NonZero
Winding rule.
type segment = 
| Straight of fpoint * fpoint
| Bezier of fpoint * fpoint * fpoint
* fpoint
A segment (a straight line or bezier curve)
type hole = 
| Hole
| Not_hole
Each segment list may be marked as a hole or not.
type closure = 
| Closed
| Open
type subpath = hole * closure * segment list 
A subpath is the pair of a hole and a list of segments.
type path = winding_rule * subpath list 
A path is made from a number of subpaths.
val string_of_path : path -> string
type tiling = 
| Tiling
Colour values
type function_shading = {
   funshading_domain :float * float * float * float;
   funshading_matrix :Transform.transform_matrix;
   funshading_function :Pdffun.pdf_fun;
}
type radial_shading = {
   radialshading_coords :float * float * float * float * float * float;
   radialshading_domain :float * float;
   radialshading_function :Pdffun.pdf_fun list;
   radialshading_extend :bool * bool;
}
type axial_shading = {
   axialshading_coords :float * float * float * float;
   axialshading_domain :float * float;
   axialshading_function :Pdffun.pdf_fun list;
   axialshading_extend :bool * bool;
}
type shading_kind = 
| FunctionShading of function_shading
| AxialShading of axial_shading
| RadialShading of radial_shading
| FreeFormGouraudShading
| LatticeFormGouraudShading
| CoonsPatchMesh
| TensorProductPatchMesh
type shading = {
   shading_colourspace :Pdf.pdfobject;
   shading_background :Pdf.pdfobject option;
   shading_bbox :Pdf.pdfobject option;
   shading_antialias :bool;
   shading_matrix :Transform.transform_matrix;
   shading_extgstate :Pdf.pdfobject;
   shading :shading_kind;
}
type pattern = 
| ColouredTilingPattern of tiling
| UncolouredTilingPattern of tiling
| ShadingPattern of shading
type colvals = 
| Floats of float list
| Named of (string * float list)
| Pattern of pattern
type transparency_attributes = {
   fill_transparency :float;
   line_transparency :float;
}
type path_attributes = {
   path_transform :Transform.transform_matrix;
   path_fill :(Pdf.pdfobject * colvals) option;
   path_line :(Pdf.pdfobject * colvals) option;
   path_linewidth :float;
   path_joinstyle :int;
   path_capstyle :int;
   path_dash :float list * float;
   path_mitrelimit :float;
   path_transparency :transparency_attributes;
   path_intent :string;
}
Path attributes.
type text_attributes = {
   textmode :int;
}
type textblock_attributes = {
   textblock_transform :Transform.transform_matrix;
}
type textblock = text_attributes * Pdfpages.operator 
type image_attributes = {
   image_transform :Transform.transform_matrix;
   image_transparency :float;
   image_softmask :softmask option;
}
type softmask_subtype = 
| Alpha
| Luminosity
type transparency_group = {
   tr_group_colourspace :Pdf.pdfobject option;
   isolated :bool;
   knockout :bool;
   tr_graphic :graphic;
}
type softmask = {
   softmask_subtype :softmask_subtype;
   transparency_group :transparency_group;
   softmask_bbox :float * float * float * float;
   backdrop :float list option;
   softmask_transfer :Pdffun.pdf_fun option;
}
type fontname = string * Pdf.pdfobject 
type graphic_elt = 
| Path of (path * path_attributes)
| Text of textblock list * textblock_attributes
| MCPoint of string
| MCPointProperties of string * Pdf.pdfobject
| MCSection of string * graphic_elt list
| MCSectionProperties of string * Pdf.pdfobject * graphic_elt list
| Image of image_attributes * int
| GraphicInlineImage of Pdf.pdfobject * Utility.bytestream * Transform.transform_matrix
| Clip of path * graphic_elt list
| Shading of path option * shading * Transform.transform_matrix
For now, just support for reading paths out. Eventually a tree-structure for an op stream.
type graphic = {
   elements :graphic_elt list;
   fonts :fontname list;
   resources :Pdf.pdfobject;
}
val bbox_of_graphic : graphic -> float * float * float * float
Bounding box xmin, xmax, ymin, yman of a graphic
val graphic_of_page : Pdf.pdfdoc -> Pdfdoc.page -> graphic
Make a graphic from operations.
val graphic_of_ops : Pdfpages.operator list -> graphic
Make a graphic from a simple string.
val page_of_graphic : Pdf.pdfdoc ->
float * float * float * float -> graphic -> Pdfdoc.page
Flatten a graphic to a list of operations and replace the operations in a page by them, returning the new page.
val string_of_graphic : graphic -> string
Debug string of a graphic
val ops_of_simple_graphic : graphic -> Pdfpages.operator list
Operations from a simple graphic (i.e no need for resources etc.)
val streams_of_simple_graphic : graphic -> Pdf.pdfobject list
Pdfdoc.content entry from a simple graphic (i.e no need for resources etc.)
val transform_graphic : Transform.transform_matrix -> graphic -> graphic
Transform a graphic by a matrixn