Generated from libpicproc.summary with ROBODoc v3.2.2 on Mon Sep 11 15:48:20 2000
TABLE OF CONTENTS
- libpicproc/_module
- libpicproc/picproc_bitmap_drawPixel
- libpicproc/picproc_bitmap_getPixel
- libpicproc/picproc_drawArea
- libpicproc/picproc_drawArrow
- libpicproc/picproc_drawBox
- libpicproc/picproc_drawCircle
- libpicproc/picproc_drawLine
- libpicproc/picproc_drawPixel
- libpicproc/picproc_pnmEncode
- libpicproc/picproc_rgb24_drawPixel
- libpicproc/picture_clear
- libpicproc/picture_delete
- libpicproc/picture_init
- libpicproc/picture_new
NAME
Picture processing library
DESCRIPTION
Image processing functions operating on a common Picture struct.
This library do not depend no any other libraries then the
standard C library.
SYNOPSIS
#include "picproc.h"
int picproc_bitmap_drawPixel(Picture *img,
picture_coord column, picture_coord row,
int value);
DESCRIPTION
Set the pixel at (column,row) to the given value. Only works on
pix_bitmap pictures.
RETURN VALUE
0 on success, -1 if the parameters are inconsistent.
SYNOPSIS
#include "picproc.h"
int picproc_bitmap_getPixel(Picture *pic,
picture_coord column, picture_coord row);
DESCRIPTION
Get the pixel value at (column,row). Only works on pix_bitmap
pictures.
RETURN VALUE
0 or 1 on success, -1 if the parameters are inconsistent.
SYNOPSIS
#include "picproc.h"
int picproc_drawArea(Picture *pic, picture_coord column1, picture_coord row1,
picture_coord column2, picture_coord row2, int color)
DESCRIPTION
Fill area with corners at (column1,row1) and (column2,row2) using
the given color. The given color must match the image format.
Calls picproc_drawPixel() to draw the edges.
RESULT
0 on success and -1 if coordinates are out of range
SEE ALSO
picproc_drawPixel()
SYNOPSIS
#include "picproc.h"
int picproc_drawArrow(Picture *pic, picture_coord column,
picture_coord row, double angle, int color)
DESCRIPTION
Draw box with corners at (column1,row1) and (column2,row2) using
the given color. The given color must match the image format.
Calls picproc_drawLine() to draw the edges. The angle is
specified in radians and 0 radians is along the x axis, and
positive rotation is counter-clockwise.
RESULT
0 on success and -1 if coordinates are out of range
SEE ALSO
picproc_drawLine(), picproc_drawPixel()
SYNOPSIS
#include "picproc.h"
int picproc_drawBox(Picture *pic, picture_coord column1, picture_coord row1,
picture_coord column2, picture_coord row2, int color)
DESCRIPTION
Draw box with corners at (column1,row1) and (column2,row2) using the given
color. The given color must match the image format. Calls
picproc_drawLine() to draw the edges.
RESULT
0 on success and -1 if coordinates are out of range
SEE ALSO
picproc_drawLine(), picproc_drawPixel()
SYNOPSIS
#include "picproc.h"
int picproc_drawCircle(Picture *img, picture_coord column, picture_coord row,
int radius, int color)
DESCRIPTION
Draw circle with the given radius and center at (x,y) using the
given color. The given color must match the image format.
Calls picproc_drawPixel() to draw in the image.
SEE ALSO
picproc_drawPixel()
SYNOPSIS
#include "picproc.h"
int picproc_drawLine(Picture *pic, picture_coord column1, picture_coord row1,
picture_coord column2, picture_coord row2, int color)
DESCRIPTION
Draw line from (column1,row1) to (column2,row2) using the
Bresenham Algorithm with the given color. The given color must
match the image format. Calls picproc_drawPixel() to draw in the
image.
RESULT
0 on success and -1 if coordinates are out of range
SEE ALSO
picproc_drawPixel()
SYNOPSIS
#include "picproc.h"
int picproc_drawPixel(Picture *img, picture_coord column, picture_coord row,
int color)
DESCRIPTION
Set color at pixel position x,y. The given color must match
the image format.
NOTE
Currently only support pix_bitmap and pix_rgb24 format.
SYNOPSIS
#include "picproc.h"
typedef long (*picproc_writer)(int ref, const void *buf, long count);
int picproc_pnmEncode(Picture *pic, picproc_writer writer, int ref)
DESCRIPTION
Encode given picture as PPM or PGM and send the result to
writer(). The writer prototype is supposed to be compatible with
UNIX write(), to make it easy to write to file.
EXAMPLE
Picture *pic = get_picture();
FILE *fp = fopen("picture.ppm", "w");
picproc_pnmEncode(pic, (picproc_writer)write, fileno(fp));
fclose(fp);
RESULT
0 on success and -1 on failure.
NOTE
Only work on pixel formats bitmap, grey4, grey, rgb24 and rgb32
at the moment.
SYNOPSIS
#include "picproc.h"
int picproc_rgb24_drawPixel(Picture *img, picture_coord column,
picture_coord row, int value);
DESCRIPTION
Set the pixel at (column,row) to the given value. Only works on
pix_rgb24 pictures. The 32 bits in color is read as red 16-24,
green 8-15 and blue 0-7.
RETURN VALUE
0 on success, -1 if the parameters are inconsistent.
SYNOPSIS
#include "picproc.h"
void picture_clear(Picture *img)
DESCRIPTION
Make all pixels in the given picture black.
SYNOPSIS
#include "picproc.h"
int picture_delete(Picture *pic)
DESCRIPTION
Release the resources allocated by picture_new().
RETURN VALUE
0 of success, -1 on failure.
SEE ALSO
picture_new()
SYNOPSIS
#include "picproc.h"
void picture_init(Picture *pic, picture_coord width, picture_coord height,
pixel_format format, int bytes_per_pixel,
unsigned char *data, unsigned int datasize)
DESCRIPTION
Initialize all the members of a the picture struct.
EXAMPLE
Picture pic;
...
picture_init(&pic, width, heigth, format, bpp,
malloc(width*heigth*bpp), width*heigth*bpp);
SYNOPSIS
#include "picproc.h"
Picture *picture_new(picture_coord width, picture_coord height,
pixel_format format)
DESCRIPTION
Allocate a new picture with the given size and format. Call
picture_delete() to release the allocated resources.
EXAMPLE
Picture *pic = picture_new(320,240, pix_rgb24);
SEE ALSO
picture_delete()