Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMAGELINE Class Reference

#include <img.h>

Public Member Functions

COLOUR_PIX operator[] (inT32 index)
 
 IMAGELINE ()
 
void init (inT32 width)
 
 ~IMAGELINE ()
 
void set_bpp (inT8 new_bpp)
 
void init ()
 

Public Attributes

uinT8pixels
 image pixels More...
 
inT8 bpp
 bits per pixel More...
 

Friends

void IMAGE::get_line (inT32 x, inT32 y, inT32 width, IMAGELINE *linebuf, inT32 margins)
 
void IMAGE::get_column (inT32 x, inT32 y, inT32 height, IMAGELINE *linebuf, inT32 margins)
 
void IMAGE::put_line (inT32 x, inT32 y, inT32 width, IMAGELINE *linebuf, inT32 margins)
 
void IMAGE::put_column (inT32 x, inT32 y, inT32 height, IMAGELINE *linebuf, inT32 margins)
 
void IMAGE::fast_get_line (inT32 x, inT32 y, inT32 width, IMAGELINE *linebuf)
 
void IMAGE::fast_put_line (inT32 x, inT32 y, inT32 width, IMAGELINE *linebuf)
 

Detailed Description

Definition at line 325 of file img.h.

Constructor & Destructor Documentation

IMAGELINE::IMAGELINE ( )
inline

default constructor

Definition at line 337 of file img.h.

337  {
338  linewidth = 0;
339  line = NULL;
340  pixels = line;
341  bpp = 8;
342  }
#define NULL
Definition: host.h:144
uinT8 * pixels
image pixels
Definition: img.h:328
inT8 bpp
bits per pixel
Definition: img.h:329
IMAGELINE::~IMAGELINE ( )
inline

Definition at line 356 of file img.h.

356  { //destructor
357  if (line != NULL)
358  free_mem(line);
359  }
#define NULL
Definition: host.h:144
void free_mem(void *oldchunk)
Definition: memry.cpp:56

Member Function Documentation

void IMAGELINE::init ( inT32  width)
inline

Definition at line 343 of file img.h.

344  { //size of line
345  if (width <= 0)
346  width = MAXIMAGEWIDTH;
347  if (width > linewidth) {
348  if (line != NULL)
349  free_mem(line);
350  linewidth = width;
351  line = (uinT8 *) alloc_mem (linewidth * sizeof (uinT8));
352  }
353  pixels = line;
354  bpp = 8;
355  }
#define NULL
Definition: host.h:144
void free_mem(void *oldchunk)
Definition: memry.cpp:56
void * alloc_mem(inT32 count)
Definition: memry.cpp:48
uinT8 * pixels
image pixels
Definition: img.h:328
inT8 bpp
bits per pixel
Definition: img.h:329
unsigned char uinT8
Definition: host.h:99
#define MAXIMAGEWIDTH
Definition: img.h:28
void IMAGELINE::init ( )
inline

Definition at line 369 of file img.h.

369  {
370  if (line == NULL)
371  init (0);
372  else {
373  pixels = line;
374  bpp = 8;
375  }
376  }
#define NULL
Definition: host.h:144
uinT8 * pixels
image pixels
Definition: img.h:328
void init()
Definition: img.h:369
inT8 bpp
bits per pixel
Definition: img.h:329
COLOUR_PIX IMAGELINE::operator[] ( inT32  index)
inline

colour pixels

Definition at line 331 of file img.h.

332  {
333  return &pixels[index * 3]; //coercion access op
334  }
uinT8 * pixels
image pixels
Definition: img.h:328
void IMAGELINE::set_bpp ( inT8  new_bpp)
inline

For colour

Definition at line 362 of file img.h.

362  {
363  if (new_bpp <= 8)
364  bpp = 8;
365  else
366  bpp = 24;
367  }
inT8 bpp
bits per pixel
Definition: img.h:329

Friends And Related Function Documentation

void IMAGE::fast_get_line ( inT32  x,
inT32  y,
inT32  width,
IMAGELINE linebuf 
)
friend
Note
may just change pointer
Parameters
xcoord to start at
yline to get
widthno of pixels to get
linebufline to copy to
void IMAGE::fast_put_line ( inT32  x,
inT32  y,
inT32  width,
IMAGELINE linebuf 
)
friend
Note
may just change pointer
Parameters
xcoord to start at
yline to get
widthno of pixels to put
linebufline to copy to
void IMAGE::get_column ( inT32  x,
inT32  y,
inT32  height,
IMAGELINE linebuf,
inT32  margins 
)
friend

copies a column

Parameters
xcoord to start at
yline to get
heightno of pixels to get
linebufline to copy to
marginssize of margins
void IMAGE::get_line ( inT32  x,
inT32  y,
inT32  width,
IMAGELINE linebuf,
inT32  margins 
)
friend

copies a line

Parameters
xcoord to start at
yline to get
widthno of pixels to get
linebufline to copy to
marginssize of margins
void IMAGE::put_column ( inT32  x,
inT32  y,
inT32  height,
IMAGELINE linebuf,
inT32  margins 
)
friend

writes a column

Parameters
xcoord to start at
yline to get
heightno of pixels to put
linebufline to copy to
marginssize of margins
void IMAGE::put_line ( inT32  x,
inT32  y,
inT32  width,
IMAGELINE linebuf,
inT32  margins 
)
friend

writes a line

Parameters
xcoord to start at
yline to get
widthno of pixels to put
linebufline to copy to
marginssize of margins

Member Data Documentation

inT8 IMAGELINE::bpp

bits per pixel

Definition at line 329 of file img.h.

uinT8* IMAGELINE::pixels

image pixels

Definition at line 328 of file img.h.


The documentation for this class was generated from the following file: