From f30e7c113bf09a664c94a7e467de0ee678bde018 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 24 Mar 2010 21:50:15 +0000 Subject: [PATCH] hist hacking --- TODO | 2 ++ libvips/histograms_lut/im_identity.c | 54 +++++++++++++++++----------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/TODO b/TODO index dd6a656f..ca7787d2 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,8 @@ - check the order of decls in hist.h, is it sensible? + check the order in freq_flt as well + - im_render() should be renamed as vips_sink_screen()? also vips_sink_disc() instead of vips_discsink()? diff --git a/libvips/histograms_lut/im_identity.c b/libvips/histograms_lut/im_identity.c index d74ffd75..ab35e2f9 100644 --- a/libvips/histograms_lut/im_identity.c +++ b/libvips/histograms_lut/im_identity.c @@ -1,23 +1,4 @@ -/* @(#) Creates a image file with Xsize=256, Ysize=1, Bands=bands, - * @(#) BandFmt=IM_BANDFMT_UCHAR, Type=IM_TYPE_HISTOGRAM; - * @(#) - * @(#) The created image consist a n bands linear lut and is the basis - * @(#) for building up look-up tables. - * @(#) - * @(#) int im_identity(lut, bands) - * @(#) IMAGE *lut; - * @(#) int bands; - * @(#) - * @(#) As above, but make a ushort LUT. ushort LUTs can be less than 65536 - * @(#) elements - sz is the number of elements required. - * @(#) - * @(#) int im_identity_ushort(lut, bands, sz) - * @(#) IMAGE *lut; - * @(#) int bands; - * @(#) int sz; - * @(#) - * @(#) Returns -1 on error and 0 on success - * @(#) +/* identity LUTs * * Copyright 1991, N. Dessipris. * @@ -29,6 +10,8 @@ * - ANSIfied * 24/8/94 JC * - im_identity_ushort() added + * 24/3/10 + * - gtkdoc */ /* @@ -72,6 +55,21 @@ #include #endif /*WITH_DMALLOC*/ +/** + * im_identity: + * @lut: output image + * @bands: number of bands to create + * + * Creates a image file with Xsize=256, Ysize=1, Bands=@bands, + * BandFmt=IM_BANDFMT_UCHAR, Type=IM_TYPE_HISTOGRAM. + * + * The created image consist a @bands-bands linear lut and is the basis + * for building up look-up tables. + * + * See also: im_identity_ushort(). + * + * Returns: 0 on success, -1 on error + */ int im_identity( IMAGE *lut, int bands ) { @@ -115,6 +113,22 @@ im_identity( IMAGE *lut, int bands ) return( 0 ); } +/** + * im_identity_ushort: + * @lut: output image + * @bands: number of bands to create + * @sz: size of LUT to create + * + * As im_identity(), but make a ushort LUT. ushort LUTs can be up to 65536 + * elements - @sz is the number of elements required. + * + * The created image consist a @bands-bands linear lut and is the basis + * for building up look-up tables. + * + * See also: im_identity(). + * + * Returns: 0 on success, -1 on error + */ int im_identity_ushort( IMAGE *lut, int bands, int sz ) {