Файл src/pnmio.c

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "allheaders.h"

Функции

static l_int32 pnmReadNextAsciiValue (FILE *fp, l_int32 *pval)
static l_int32 pnmSkipCommentLines (FILE *fp)
PIXpixReadStreamPnm (FILE *fp)
l_int32 pixWriteStreamPnm (FILE *fp, PIX *pix)
l_int32 pixWriteStreamAsciiPnm (FILE *fp, PIX *pix)
PIXpixReadMemPnm (const l_uint8 *cdata, size_t size)
l_int32 pixWriteMemPnm (l_uint8 **pdata, size_t *psize, PIX *pix)

Переменные

static const l_int32 MAX_PNM_WIDTH = 100000
static const l_int32 MAX_PNM_HEIGHT = 100000

Функции

PIX* pixReadMemPnm ( const l_uint8 cdata,
size_t  size 
)

PIX* pixReadStreamPnm ( FILE *  fp  ) 

pixReadStreamPnm()

Input: stream opened for read Return: pix, or null on error

l_int32 pixWriteMemPnm ( l_uint8 **  pdata,
size_t *  psize,
PIX pix 
)

l_int32 pixWriteStreamAsciiPnm ( FILE *  fp,
PIX pix 
)

pixWriteStreamAsciiPnm()

Input: stream opened for write pix Return: 0 if OK; 1 on error

Writes "ascii" format only: 1 bpp --> pbm (P1) 2, 4, 8, 16 bpp, no colormap or grayscale colormap --> pgm (P2) 2, 4, 8 bpp with color-valued colormap, or rgb --> rgb ppm (P3)

l_int32 pixWriteStreamPnm ( FILE *  fp,
PIX pix 
)

pixWriteStreamPnm()

Input: stream opened for write pix Return: 0 if OK; 1 on error

Notes: (1) This writes "raw" packed format only: 1 bpp --> pbm (P4) 2, 4, 8, 16 bpp, no colormap or grayscale colormap --> pgm (P5) 2, 4, 8 bpp with color-valued colormap, or rgb --> rgb ppm (P6) (2) 24 bpp rgb are not supported in leptonica, but this will write them out as a packed array of bytes (3 to a pixel).

static l_int32 pnmReadNextAsciiValue ( FILE *  fp,
l_int32 pval 
) [static]

pnmReadNextAsciiValue()

Return: 0 if OK, 1 on error or EOF.

Notes: (1) This reads the next sample value in ascii from the the file.

static l_int32 pnmSkipCommentLines ( FILE *  fp  )  [static]

pnmSkipCommentLines()

Return: 0 if OK, 1 on error or EOF

Notes: (1) Comment lines begin with '#' (2) Usage: caller should check return value for EOF


Переменные

const l_int32 MAX_PNM_HEIGHT = 100000 [static]

const l_int32 MAX_PNM_WIDTH = 100000 [static]


Документация по Leptonica. Последние изменения: Fri Aug 7 20:31:38 2009. Создано системой  doxygen 1.5.9