File: oJpeg.ml

package info (click to toggle)
camlimages 2.00-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,536 kB
  • ctags: 2,325
  • sloc: ml: 10,848; ansic: 2,396; makefile: 599; sh: 30
file content (28 lines) | stat: -rw-r--r-- 1,235 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
(***********************************************************************)
(*                                                                     *)
(*                           Objective Caml                            *)
(*                                                                     *)
(*            Jun Furuse, projet Cristal, INRIA Rocquencourt           *)
(*                                                                     *)
(*  Copyright 1999,2000,2001,2002,2001,2002                            *)
(*  Institut National de Recherche en Informatique et en Automatique.  *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)
open OImage

let load name opts = OImage.make (Jpeg.load name opts)

let load_thumbnail name opts geom_spec =
  let w, h, img = Jpeg.load_thumbnail name opts geom_spec in
  w, h, OImage.make img

let save name opts image =
  let rgb24 = OImage.rgb24 image in
  Jpeg.save name opts rgb24#image

let save_as_cmyk name opts trans image =
  let rgb24 = OImage.rgb24 image in
  Jpeg.save_as_cmyk name opts trans rgb24#image