File: pdfimage.mli

package info (click to toggle)
camlpdf 0.5-1
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze, wheezy
  • size: 1,516 kB
  • ctags: 2,689
  • sloc: ml: 18,229; ansic: 139; makefile: 139
file content (37 lines) | stat: -rw-r--r-- 1,429 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(** Extract Images - Incomplete and unsupported. *)
(* FIXME: Also CMYK etc... *)
type pixel_layout =
  | BPP1 (* Black and white *)
  | BPP8 (* Greyscale *)
  | BPP24 (* Colour *)
  | BPP48 (* 48 bit colour *)

type image =
  | JPEG of Utility.bytestream * float list option
  | JPEG2000 of Utility.bytestream * float list option
  | JBIG2 of Utility.bytestream * float list option
  | Raw of int * int * pixel_layout * Utility.bytestream

(** Given a pdf document, resources dictionary and a stream representing an
image, return a triple : width, height, and a stream of (width * height * 3)
bytes RGBRGB etc. In all instances, if JPEG or JPEG2000 or JBIG2 is the compression
 method, data is returned still encoded. *)
val get_image_24bpp :
  Pdf.pdfdoc -> Pdf.pdfobject -> Pdf.pdfobject -> image

(** Similarly, but if it's to be Raw, use the smallest pixel layout required to
represent the data. Not implemented yet. *)
val get_image :
  Pdf.pdfdoc -> Pdf.pdfobject -> Pdf.pdfobject -> image

(** Get the uncompressed image contents in 24bpp, decoding JPEG, JPEG2000 and JBIG2 as
required. Not implemented yet. *)
val get_image_raw_24bpp :
  Pdf.pdfdoc -> Pdf.pdfobject -> Pdf.pdfobject -> image

(** Get the uncompressed image contents, decoding JPEG, JPEG2000 and JBIG2 as
required. Not implemented yet. *)
val get_image_raw :
  Pdf.pdfdoc -> Pdf.pdfobject -> Pdf.pdfobject -> image