Leptonica  1.77.0
Image processing and image analysis suite
imageio.h File Reference

Go to the source code of this file.

Data Structures

struct  L_Compressed_Data
 
struct  L_Pdf_Data
 

Typedefs

typedef struct L_Compressed_Data L_COMP_DATA
 
typedef struct L_Pdf_Data L_PDF_DATA
 

Enumerations

enum  {
  IFF_UNKNOWN = 0, IFF_BMP = 1, IFF_JFIF_JPEG = 2, IFF_PNG = 3,
  IFF_TIFF = 4, IFF_TIFF_PACKBITS = 5, IFF_TIFF_RLE = 6, IFF_TIFF_G3 = 7,
  IFF_TIFF_G4 = 8, IFF_TIFF_LZW = 9, IFF_TIFF_ZIP = 10, IFF_PNM = 11,
  IFF_PS = 12, IFF_GIF = 13, IFF_JP2 = 14, IFF_WEBP = 15,
  IFF_LPDF = 16, IFF_TIFF_JPEG = 17, IFF_DEFAULT = 18, IFF_SPIX = 19
}
 
enum  { BMP_ID = 0x4d42, TIFF_BIGEND_ID = 0x4d4d, TIFF_LITTLEEND_ID = 0x4949 }
 
enum  { L_JPEG_READ_LUMINANCE = 1, L_JPEG_FAIL_ON_BAD_DATA = 2 }
 
enum  {
  L_DEFAULT_ENCODE = 0, L_JPEG_ENCODE = 1, L_G4_ENCODE = 2, L_FLATE_ENCODE = 3,
  L_JP2K_ENCODE = 4
}
 
enum  { L_FIRST_IMAGE = 1, L_NEXT_IMAGE = 2, L_LAST_IMAGE = 3 }
 

Detailed Description

 General features of image I/O in leptonica
 At present, there are 9 file formats for images that can be read
 and written:
     png (requires libpng, libz)
     jpeg (requires libjpeg)
     tiff (requires libtiff, libz)
     gif (requires libgif)
     webp (requires libwebp)
     jp2 (requires libopenjp2)
     bmp (no library required)
     pnm (no library required)
     spix (no library required)
 Additionally, there are two file formats for writing (only) images:
     PostScript (requires libpng, libz, libjpeg, libtiff)
     pdf (requires libpng, libz, libjpeg, libtiff)
 For all 9 read/write formats, leptonica provides interconversion
 between pix (with raster data) and formatted image data:
     Conversion from pix (typically compression):
         pixWrite():        pix –> file
         pixWriteStream():  pix –> filestream (aka FILE*)
         pixWriteMem():     pix –> memory buffer
     Conversion to pix (typically decompression):
         pixRead():         file –> pix
         pixReadStream():   filestream –> pix
         pixReadMem():      memory buffer –> pix
 Conversions for which the image data is not compressed are:
    * uncompressed tiff   (IFF_TIFF)
    * bmp
    * pnm
    * spix (fast serialization that copies the pix raster data)
 The image header (metadata) information can be read from either
 the compressed file or a memory buffer, for all 9 formats.

Definition in file imageio.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Format header ids

Enumerator
BMP_ID 

BM - for bitmaps

TIFF_BIGEND_ID 

MM - for 'motorola'

TIFF_LITTLEEND_ID 

II - for 'intel'

Definition at line 120 of file imageio.h.

◆ anonymous enum

anonymous enum

Hinting bit flags in jpeg reader

Enumerator
L_JPEG_READ_LUMINANCE 

only want luminance data; no chroma

L_JPEG_FAIL_ON_BAD_DATA 

don't return possibly damaged pix

Definition at line 132 of file imageio.h.

◆ anonymous enum

anonymous enum

Pdf formatted encoding types

Enumerator
L_DEFAULT_ENCODE 

use default encoding based on image

L_JPEG_ENCODE 

use dct encoding: 8 and 32 bpp, no cmap

L_G4_ENCODE 

use ccitt g4 fax encoding: 1 bpp

L_FLATE_ENCODE 

use flate encoding: any depth, cmap ok

L_JP2K_ENCODE 

use jp2k encoding: 8 and 32 bpp, no cmap

Definition at line 143 of file imageio.h.

◆ anonymous enum

anonymous enum

Pdf multi image flags

Enumerator
L_FIRST_IMAGE 

first image to be used

L_NEXT_IMAGE 

intermediate image; not first or last

L_LAST_IMAGE 

last image to be used

Definition at line 194 of file imageio.h.

◆ anonymous enum

anonymous enum

Image file format types

Definition at line 91 of file imageio.h.