Changeset 2809 for libpipi


Ignore:
Timestamp:
Aug 30, 2008, 12:03:33 PM (12 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Preliminary image histogram routines and example
Location:
libpipi/trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/examples/Makefile.am

    r2788 r2809  
    33AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/pipi
    44
    5 bin_PROGRAMS = edd img2rubik sharpen floodfill line bezier
     5bin_PROGRAMS = edd img2rubik sharpen floodfill line bezier histogram
    66
    77edd_SOURCES = edd.c
     
    2222bezier_SOURCES = bezier.c
    2323bezier_LDADD = ../pipi/libpipi.la
     24
     25histogram_SOURCES = histogram.c
     26histogram_LDADD = ../pipi/libpipi.la
  • libpipi/trunk/pipi/Makefile.am

    r2798 r2809  
    3232        $(quantize_sources) \
    3333        $(dither_sources) \
     34        $(histogram_sources) \
    3435        $(NULL)
    3536libpipi_la_CFLAGS = $(codec_cflags)
     
    8081        dither/random.c
    8182
     83histogram_sources = \
     84        histogram/histogram.c
     85
    8286if USE_SDL
    8387codec_cflags += `sdl-config --cflags`
  • libpipi/trunk/pipi/pipi.h

    r2790 r2809  
    5555pipi_format_t;
    5656
     57
     58typedef enum
     59{
     60    PIPI_COLOR_R = 1,
     61    PIPI_COLOR_G = 2,
     62    PIPI_COLOR_B = 4,
     63    PIPI_COLOR_A = 8,
     64    PIPI_COLOR_Y = 16
     65}
     66pipi_color_flag_t;
     67
    5768struct pixel_u32
    5869{
     
    89100typedef struct pipi_context pipi_context_t;
    90101
     102/* pipi_histogram_t: the histogram type */
     103typedef struct pipi_histogram pipi_histogram_t;
    91104
    92105extern pipi_context_t *pipi_create_context(void);
     
    171184extern void pipi_dither_24to16(pipi_image_t *);
    172185
     186extern pipi_histogram_t* pipi_new_histogram(void);
     187extern int pipi_get_image_histogram(pipi_image_t *, pipi_histogram_t *, int);
     188extern int pipi_free_histogram(pipi_histogram_t*);
     189extern int pipi_render_histogram(pipi_image_t *, pipi_histogram_t*, int);
     190
    173191
    174192#ifdef __cplusplus
  • libpipi/trunk/pipi/pipi_internals.h

    r2794 r2809  
    2323#define SET_FLAG_WRAP 0x00000002
    2424#define SET_FLAG_8BIT 0x00000004
     25
     26struct pipi_histogram
     27{
     28    int r_present, g_present, b_present, y_present;
     29    unsigned int a[256];
     30    unsigned int r[256];
     31    unsigned int g[256];
     32    unsigned int b[256];
     33    unsigned int y[256];
     34};
     35
    2536
    2637/* pipi_image_t: the image structure. This is probably going to be the most
Note: See TracChangeset for help on using the changeset viewer.