Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file image_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163(***********************************************************************)(* *)(* Objective Caml *)(* *)(* FraníÐis Pessaux, projet Cristal, INRIA Rocquencourt *)(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)(* Jun Furuse, projet Cristal, INRIA Rocquencourt *)(* *)(* Copyright 1999-2004, *)(* Institut National de Recherche en Informatique et en Automatique. *)(* Distributed only by permission. *)(* *)(***********************************************************************)(* $Id: image_intf.mli,v 1.2 2009/07/04 03:39:28 furuse Exp $ *)(** Color to bytes encoder/decoder module type *)moduletypeENCODE=sigtypetvalbytes_per_pixel:intvalget:bytes->int->tvalset:bytes->int->t->unitvalmake:t->bytesend(** Low level image module type *)moduletypeRAWIMAGE=sigmoduleEncode:ENCODEtypeeltandbitmapandt={width:int;height:int;bitmap:bitmap;}valwidth:t->intvalheight:t->intvaldump:t->bytesvalcreate_with:int->int->bytes->tvalcreate_with_scanlines:int->int->bytesarray->tvalcreate:int->int->tvalmake:int->int->elt->tvalunsafe_access:t->int->int->bytes*intvalget_strip:t->int->int->int->bytesvalset_strip:t->int->int->int->bytes->unitvalget_scanline:t->int->bytesvalget_scanline_ptr:t->(int->(bytes*int)*int)optionvalset_scanline:t->int->bytes->unitvalunsafe_get:t->int->int->eltvalunsafe_set:t->int->int->elt->unitvalget:t->int->int->eltvalset:t->int->int->elt->unitvaldestroy:t->unitvalcopy:t->tvalsub:t->int->int->int->int->tvalblit:t->int->int->t->int->int->int->int->unitvalmap:(elt->elt->elt)->t->int->int->t->int->int->int->int->unitvalblocks:t->int*intvaldump_block:t->int->int->Bitmap.Block.tend(** low image container module type *)moduletypeCONTAINER=sigtypecontainertyperawimagevalrawimage:container->rawimagevalcreate_default:int->int->rawimage->containervalcreate_duplicate:container->int->int->rawimage->containerendmoduletypeIMAGE=sigtypettypeelt(** Image creation *)valcreate:int->int->t(** [create w h] creates an image with a size [w]x[h]. The content is
the image is not initialized. *)valmake:int->int->elt->t(** [make w h c] creates an image with a size [w]x[h]. The content is
the image is initialized to the color [c]. *)valdestroy:t->unit(** [destroy t] explicitly frees the image content of [t].
If you do not use bitmap swap files, you do not need to call
this function, since GC will free unreachable image data automatically.
Read bitmap.mli for more details. *)(** Pixel access *)valget:t->int->int->elt(** [get t x y] gets image pixel of [t] at [x],[y]. If [x],[y] is
outside of the image size, Images.Out_of_image exception is raised. *)valset:t->int->int->elt->unit(** [set t x y c] sets image pixel of [t] at [x],[y] by the color [c].
If [x],[y] is outside of the image size, Images.Out_of_image exception
is raised. *)valunsafe_get:t->int->int->eltvalunsafe_set:t->int->int->elt->unit(** Unsafe versions of [get] and [set]. It does not perform any image
boundary check. If the coordinates are out of the given image,
the result is undefined. Use carefully. *)(** Image copy *)valcopy:t->t(** [copy t] duplicates the image [t]. *)valsub:t->int->int->int->int->t(** [sub t x y w h] duplicates a subimage of [t] of size [w]x[h],
whose origin (0,0) is at (x,y) of [t]. *)valblit:t->int->int->t->int->int->int->int->unit(** [blit src x y dst x' y' w h] copies rectangular area of [src] at
[x],[y] with size [w]x[h], to an image [dst]. The origin of
the subimage comes at [x'],[y'] of [dst]. *)valmap:(elt->elt->elt)->t->int->int->t->int->int->int->int->unit(** [map f src x y dst x' y' w h] maps pixels of the rectangular area
of [src] at [x],[y] with size [w]x[h], to an image [dst],
using color conversion function [f]. The origin of the subimage
comes at [x'],[y'] of [dst]. *)(** functions for internal use *)valdump:t->bytesvalunsafe_access:t->int->int->bytes*intvalget_strip:t->int->int->int->bytesvalset_strip:t->int->int->int->bytes->unitvalget_scanline:t->int->bytesvalget_scanline_ptr:t->(int->(bytes*int)*int)optionvalset_scanline:t->int->bytes->unitvalblocks:t->int*intvaldump_block:t->int->int->Bitmap.Block.tendmoduletypeCONTAINER_INDEXED=sigtypecontainertyperawimagetypemapeltvalrawimage:container->rawimagevalcreate_default:int->int->rawimage->containervalcreate_duplicate:container->int->int->rawimage->containervalcolormap:container->mapeltColor.mapendmoduletypeIMAGEINDEXED=sigincludeIMAGEtypemapelt(** Pixel access *)valget_color:t->int->int->mapelt(** [get_color x y] returns image pixel color value of [t] at [x],[y].
If [x],[y] is outside of the image size, Images.Out_of_image exception
is raised. *)valunsafe_get_color:t->int->int->mapeltend