![]() |
Leptonica
1.77.0
Image processing and image analysis suite
|
#include <string.h>#include "allheaders.h"Go to the source code of this file.
Data Structures | |
| struct | CompParameterMap |
Functions | |
| static l_int32 | selaExtendArray (SELA *sela) |
| static SEL * | selCreateFromSArray (SARRAY *sa, l_int32 first, l_int32 last) |
| SELA * | selaCreate (l_int32 n) |
| void | selaDestroy (SELA **psela) |
| SEL * | selCreate (l_int32 height, l_int32 width, const char *name) |
| void | selDestroy (SEL **psel) |
| SEL * | selCopy (SEL *sel) |
| SEL * | selCreateBrick (l_int32 h, l_int32 w, l_int32 cy, l_int32 cx, l_int32 type) |
| SEL * | selCreateComb (l_int32 factor1, l_int32 factor2, l_int32 direction) |
| l_int32 ** | create2dIntArray (l_int32 sy, l_int32 sx) |
| l_ok | selaAddSel (SELA *sela, SEL *sel, const char *selname, l_int32 copyflag) |
| l_int32 | selaGetCount (SELA *sela) |
| SEL * | selaGetSel (SELA *sela, l_int32 i) |
| char * | selGetName (SEL *sel) |
| l_ok | selSetName (SEL *sel, const char *name) |
| l_ok | selaFindSelByName (SELA *sela, const char *name, l_int32 *pindex, SEL **psel) |
| l_ok | selGetElement (SEL *sel, l_int32 row, l_int32 col, l_int32 *ptype) |
| l_ok | selSetElement (SEL *sel, l_int32 row, l_int32 col, l_int32 type) |
| l_ok | selGetParameters (SEL *sel, l_int32 *psy, l_int32 *psx, l_int32 *pcy, l_int32 *pcx) |
| l_ok | selSetOrigin (SEL *sel, l_int32 cy, l_int32 cx) |
| l_ok | selGetTypeAtOrigin (SEL *sel, l_int32 *ptype) |
| char * | selaGetBrickName (SELA *sela, l_int32 hsize, l_int32 vsize) |
| char * | selaGetCombName (SELA *sela, l_int32 size, l_int32 direction) |
| l_ok | getCompositeParameters (l_int32 size, l_int32 *psize1, l_int32 *psize2, char **pnameh1, char **pnameh2, char **pnamev1, char **pnamev2) |
| SARRAY * | selaGetSelnames (SELA *sela) |
| l_ok | selFindMaxTranslations (SEL *sel, l_int32 *pxp, l_int32 *pyp, l_int32 *pxn, l_int32 *pyn) |
| SEL * | selRotateOrth (SEL *sel, l_int32 quads) |
| SELA * | selaRead (const char *fname) |
| SELA * | selaReadStream (FILE *fp) |
| SEL * | selRead (const char *fname) |
| SEL * | selReadStream (FILE *fp) |
| l_ok | selaWrite (const char *fname, SELA *sela) |
| l_ok | selaWriteStream (FILE *fp, SELA *sela) |
| l_ok | selWrite (const char *fname, SEL *sel) |
| l_ok | selWriteStream (FILE *fp, SEL *sel) |
| SEL * | selCreateFromString (const char *text, l_int32 h, l_int32 w, const char *name) |
| char * | selPrintToString (SEL *sel) |
| SELA * | selaCreateFromFile (const char *filename) |
| SEL * | selCreateFromPta (PTA *pta, l_int32 cy, l_int32 cx, const char *name) |
| SEL * | selCreateFromPix (PIX *pix, l_int32 cy, l_int32 cx, const char *name) |
| SEL * | selReadFromColorImage (const char *pathname) |
| SEL * | selCreateFromColorPix (PIX *pixs, const char *selname) |
| PIX * | selDisplayInPix (SEL *sel, l_int32 size, l_int32 gthick) |
| PIX * | selaDisplayInPix (SELA *sela, l_int32 size, l_int32 gthick, l_int32 spacing, l_int32 ncols) |
Variables | |
| static const l_int32 | L_BUFSIZE = 256 |
| static const l_int32 | INITIAL_PTR_ARRAYSIZE = 50 |
| static const l_int32 | MANY_SELS = 1000 |
| static const struct CompParameterMap | comp_parameter_map [] |
Basic ops on Sels and Selas
Create/destroy/copy:
SELA *selaCreate()
void selaDestroy()
SEL *selCreate()
void selDestroy()
SEL *selCopy()
SEL *selCreateBrick()
SEL *selCreateComb()
Helper proc:
l_int32 **create2dIntArray()
Extension of sela:
SELA *selaAddSel()
static l_int32 selaExtendArray()
Accessors:
l_int32 selaGetCount()
SEL *selaGetSel()
char *selGetName()
l_int32 selSetName()
l_int32 selaFindSelByName()
l_int32 selGetElement()
l_int32 selSetElement()
l_int32 selGetParameters()
l_int32 selSetOrigin()
l_int32 selGetTypeAtOrigin()
char *selaGetBrickName()
char *selaGetCombName()
static char *selaComputeCompositeParameters()
l_int32 getCompositeParameters()
SARRAY *selaGetSelnames()
Max translations for erosion and hmt
l_int32 selFindMaxTranslations()
Rotation by multiples of 90 degrees
SEL *selRotateOrth()
Sela and Sel serialized I/O
SELA *selaRead()
SELA *selaReadStream()
SEL *selRead()
SEL *selReadStream()
l_int32 selaWrite()
l_int32 selaWriteStream()
l_int32 selWrite()
l_int32 selWriteStream()
Building custom hit-miss sels from compiled strings
SEL *selCreateFromString()
char *selPrintToString() [for debugging]
Building custom hit-miss sels from a simple file format
SELA *selaCreateFromFile()
static SEL *selCreateFromSArray()
Making hit-only sels from Pta and Pix
SEL *selCreateFromPta()
SEL *selCreateFromPix()
Making hit-miss sels from Pix and image files
SEL *selReadFromColorImage()
SEL *selCreateFromColorPix()
Printable display of sel
PIX *selDisplayInPix()
PIX *selaDisplayInPix()
Usage notes:
In this file we have seven functions that make sels:
(1) selCreate(), with input (h, w, [name])
The generic function. Roll your own, using selSetElement().
(2) selCreateBrick(), with input (h, w, cy, cx, val)
The most popular function. Makes a rectangular sel of
all hits, misses or don't-cares. We have many morphology
operations that create a sel of all hits, use it, and
destroy it.
(3) selCreateFromString() with input (text, h, w, [name])
Adam Langley's clever function, allows you to make a hit-miss
sel from a string in code that is geometrically laid out
just like the actual sel.
(4) selaCreateFromFile() with input (filename)
This parses a simple file format to create an array of
hit-miss sels. The sel data uses the same encoding
as in (3), with geometrical layout enforced.
(5) selCreateFromPta() with input (pta, cy, cx, [name])
Another way to make a sel with only hits.
(6) selCreateFromPix() with input (pix, cy, cx, [name])
Yet another way to make a sel from hits.
(7) selCreateFromColorPix() with input (pix, name).
Another way to make a general hit-miss sel, starting with
an image editor.
In addition, there are three functions in selgen.c that
automatically generate a hit-miss sel from a pix and
a number of parameters. This is useful for problems like
"find all patterns that look like this one."
Consistency, being the hobgoblin of small minds,
is adhered to here in the dimensioning and accessing of sels.
Everything is done in standard matrix (row, column) order.
When we set specific elements in a sel, we likewise use
(row, col) ordering:
selSetElement(), with input (row, col, type)
Definition in file sel1.c.
| l_int32** create2dIntArray | ( | l_int32 | sy, |
| l_int32 | sx | ||
| ) |
| [in] | sy | rows == height |
| [in] | sx | columns == width |
Notes:
(1) The array[sy][sx] is indexed in standard "matrix notation",
with the row index first.
Definition at line 515 of file sel1.c.
Referenced by selCopy(), and selCreate().
| l_ok getCompositeParameters | ( | l_int32 | size, |
| l_int32 * | psize1, | ||
| l_int32 * | psize2, | ||
| char ** | pnameh1, | ||
| char ** | pnameh2, | ||
| char ** | pnamev1, | ||
| char ** | pnamev2 | ||
| ) |
| [in] | size | |
| [out] | psize1 | [optional] brick factor size |
| [out] | psize2 | [optional] comb factor size |
| [out] | pnameh1 | [optional] name of horiz brick |
| [out] | pnameh2 | [optional] name of horiz comb |
| [out] | pnamev1 | [optional] name of vert brick |
| [out] | pnamev2 | [optional] name of vert comb |
Notes:
(1) This uses the big lookup table at the top of this file.
(2) All returned strings are copies that must be freed.
| [in] | sela | |
| [in] | sel | to be added |
| [in] | selname | ignored if already defined in sel; req'd in sel when added to a sela |
| [in] | copyflag | L_INSERT or L_COPY |
Notes:
(1) This adds a sel, either inserting or making a copy.
(2) Because every sel in a sela must have a name, it copies
the input name if necessary. You can input NULL for
selname if the sel already has a name.
Definition at line 566 of file sel1.c.
References L_COPY, L_INSERT, Sela::n, Sela::nalloc, Sel::name, Sela::sel, selaExtendArray(), selaGetCount(), selCopy(), and stringNew().
Referenced by selaAddCrossJunctions(), selaAddDwaLinear(), selaAddHitMiss(), selaAddTJunctions(), selaCreateFromFile(), and selaMakeThinSets().
| SELA* selaCreate | ( | l_int32 | n | ) |
| [in] | n | initial number of sel ptrs; use 0 for default |
Definition at line 239 of file sel1.c.
Referenced by sela4and8ccThin(), sela4ccThin(), sela8ccThin(), selaAddBasic(), selaAddCrossJunctions(), selaAddDwaCombs(), selaAddDwaLinear(), selaAddHitMiss(), selaAddTJunctions(), selaCreateFromFile(), and selaMakeThinSets().
| SELA* selaCreateFromFile | ( | const char * | filename | ) |
| [in] | filename |
Notes:
(1) The file contains a sequence of Sel descriptions.
(2) Each Sel is formatted as follows:
~ Any number of comment lines starting with '#' are ignored
~ The next line contains the selname
~ The next lines contain the Sel data. They must be
formatted similarly to the string format in
selCreateFromString(), with each line beginning and
ending with a double-quote, and showing the 2D layout.
~ Each Sel ends when a blank line, a comment line, or
the end of file is reached.
(3) See selCreateFromString() for a description of the string
format for the Sel data. As an example, here are the lines
of is a valid file for a single Sel. In the file, all lines
are left-justified:
diagonal sel
sel_5diag
"x "
" x "
" X "
" x "
" x"
Definition at line 1779 of file sel1.c.
References l_binaryRead(), L_NOCOPY, numaAddNumber(), numaCreate(), numaDestroy(), numaGetCount(), numaGetIValue(), sarrayCreateLinesFromString(), sarrayDestroy(), sarrayGetCount(), sarrayGetString(), selaAddSel(), selaCreate(), selaDestroy(), and selCreateFromSArray().
| void selaDestroy | ( | SELA ** | psela | ) |
| [in,out] | psela | to be nulled |
Definition at line 272 of file sel1.c.
References Sela::n, Sela::sel, and selDestroy().
Referenced by pixaThinConnected(), selaCreateFromFile(), and selaMakeThinSets().
| [in] | sela | |
| [in] | size | of grid interiors; odd; minimum size of 13 is enforced |
| [in] | gthick | grid thickness; minimum size of 2 is enforced |
| [in] | spacing | between sels, both horizontally and vertically |
| [in] | ncols | number of sels per "line" |
Notes:
(1) This gives a visual representation of all the sels in a sela.
(2) See notes in selDisplayInPix() for display params of each sel.
(3) This gives the nicest results when all sels in the sela
are the same size.
Definition at line 2318 of file sel1.c.
References L_CLONE, L_INSERT, pixaAddPix(), pixaCreate(), pixaDestroy(), pixaDisplayTiledInRows(), pixaGetPix(), pixDestroy(), pixGetDimensions(), selaGetCount(), selaGetSel(), and selDisplayInPix().
Referenced by selaMakeThinSets().
|
static |
| [in] | sela |
Definition at line 611 of file sel1.c.
References Sela::nalloc, reallocNew(), and Sela::sel.
Referenced by selaAddSel().
| [in] | sela | |
| [in] | name | sel name |
| [out] | pindex | [optional] |
| [in] | psel | [optional] sel (not a copy) |
Definition at line 732 of file sel1.c.
References selaGetCount(), selaGetSel(), and selGetName().
Referenced by selaMakeThinSets().
| char* selaGetBrickName | ( | SELA * | sela, |
| l_int32 | hsize, | ||
| l_int32 | vsize | ||
| ) |
| [in] | sela | |
| [in] | hsize,vsize | of brick sel |
Definition at line 937 of file sel1.c.
References selaGetCount(), selaGetSel(), selGetName(), selGetParameters(), and stringNew().
| char* selaGetCombName | ( | SELA * | sela, |
| l_int32 | size, | ||
| l_int32 | direction | ||
| ) |
| [in] | sela | |
| [in] | size | the product of sizes of the brick and comb parts |
| [in] | direction | L_HORIZ, L_VERT |
Notes:
(1) Combs are by definition 1-dimensional, either horiz or vert.
(2) Use this with comb Sels; e.g., from selaAddDwaCombs().
| l_int32 selaGetCount | ( | SELA * | sela | ) |
| [in] | sela |
Definition at line 639 of file sel1.c.
References Sela::n.
Referenced by fhmtautogen1(), fhmtautogen2(), fmorphautogen1(), selaAddSel(), selaDisplayInPix(), selaFindSelByName(), selaGetBrickName(), selaGetSelnames(), and selaWriteStream().
| [in] | sela | |
| [in] | i | index of sel to be retrieved not copied |
Notes:
(1) This returns a ptr to the sel, not a copy, so the caller
must not destroy it!
Definition at line 664 of file sel1.c.
References Sela::n, and Sela::sel.
Referenced by selaDisplayInPix(), selaFindSelByName(), selaGetBrickName(), and selaGetSelnames().
| [in] | sela |
Definition at line 1148 of file sel1.c.
References L_COPY, sarrayAddString(), sarrayCreate(), selaGetCount(), selaGetSel(), and selGetName().
| SELA* selaRead | ( | const char * | fname | ) |
| [in] | fname | filename |
Definition at line 1310 of file sel1.c.
References fopenReadStream(), and selaReadStream().
| SELA* selaReadStream | ( | FILE * | fp | ) |
| [in] | fp | file stream |
Definition at line 1339 of file sel1.c.
Referenced by selaRead().
| l_ok selaWrite | ( | const char * | fname, |
| SELA * | sela | ||
| ) |
| [in] | fname | filename |
| [in] | sela |
Definition at line 1464 of file sel1.c.
References fopenWriteStream(), and selaWriteStream().
| l_ok selaWriteStream | ( | FILE * | fp, |
| SELA * | sela | ||
| ) |
| [in] | fp | file stream |
| [in] | sela |
Definition at line 1493 of file sel1.c.
References selaGetCount().
Referenced by selaWrite().
| [in] | sel |
Definition at line 370 of file sel1.c.
References create2dIntArray(), Sel::cx, Sel::cy, Sel::data, Sel::name, selGetParameters(), stringNew(), Sel::sx, and Sel::sy.
Referenced by selaAddSel(), and selRotateOrth().
| SEL* selCreate | ( | l_int32 | height, |
| l_int32 | width, | ||
| const char * | name | ||
| ) |
| [in] | height,width | |
| [in] | name | [optional] sel name; can be null |
Notes:
(1) selCreate() initializes all values to 0.
(2) After this call, (cy,cx) and nonzero data values must be
assigned. If a text name is not assigned here, it will
be needed later when the sel is put into a sela.
Definition at line 306 of file sel1.c.
References create2dIntArray(), Sel::data, Sel::name, stringNew(), Sel::sx, and Sel::sy.
Referenced by selCreateFromPix(), selCreateFromPta(), selCreateFromSArray(), and selCreateFromString().
| SEL* selCreateBrick | ( | l_int32 | h, |
| l_int32 | w, | ||
| l_int32 | cy, | ||
| l_int32 | cx, | ||
| l_int32 | type | ||
| ) |
| [in] | h,w | height, width |
| [in] | cy,cx | origin, relative to UL corner at 0,0 |
| [in] | type | SEL_HIT, SEL_MISS, or SEL_DONT_CARE |
Notes:
(1) This is a rectangular sel of all hits, misses or don't cares.
Definition at line 418 of file sel1.c.
Referenced by selaAddDwaLinear(), selaAddHitMiss(), and selRotateOrth().
| SEL* selCreateComb | ( | l_int32 | factor1, |
| l_int32 | factor2, | ||
| l_int32 | direction | ||
| ) |
| [in] | factor1 | contiguous space between comb tines |
| [in] | factor2 | number of comb tines |
| [in] | direction | L_HORIZ, L_VERT |
Notes:
(1) This generates a comb Sel of hits with the origin as
near the center as possible.
(2) In use, this is complemented by a brick sel of size factor1,
Both brick and comb sels are made by selectComposableSels().
| [in] | pixs | cmapped or rgb |
| [in] | selname | [optional] sel name; can be null |
Notes:
(1) The sel size is given by the size of pixs.
(2) In pixs, hits are represented by green pixels, misses by red
pixels, and don't-cares by white pixels.
(3) In pixs, there may be no misses, but there must be at least 1 hit.
(4) At most there can be only one origin pixel, which is optionally
specified by using a lower-intensity pixel:
if a hit: dark green
if a miss: dark red
if a don't care: gray
If there is no such pixel, the origin defaults to the approximate
center of the sel.
Definition at line 2109 of file sel1.c.
Referenced by selaAddCrossJunctions(), selaAddTJunctions(), and selReadFromColorImage().
| [in] | pix | |
| [in] | cy,cx | origin of sel |
| [in] | name | [optional] sel name; can be null |
Notes:
(1) The origin must be positive.
Definition at line 2009 of file sel1.c.
References pixGetDimensions(), pixGetPixel(), selCreate(), selSetElement(), and selSetOrigin().
| [in] | pta | |
| [in] | cy,cx | origin of sel |
| [in] | name | [optional] sel name; can be null |
Notes:
(1) The origin and all points in the pta must be positive.
Definition at line 1959 of file sel1.c.
References boxDestroy(), boxGetGeometry(), ptaGetBoundingRegion(), ptaGetCount(), ptaGetIPt(), selCreate(), selSetElement(), and selSetOrigin().
Notes:
(1) The Sel contains the following lines:
~ The first line is the selname
~ The remaining lines contain the Sel data. They must
be formatted similarly to the string format in
selCreateFromString(), with each line beginning and
ending with a double-quote, and showing the 2D layout.
~ 'last' gives the last line in the Sel data.
(2) See selCreateFromString() for a description of the string
format for the Sel data. As an example, here are the lines
of is a valid file for a single Sel. In the file, all lines
are left-justified:
diagonal sel
sel_5diag
"x "
" x "
" X "
" x "
" x"
Definition at line 1880 of file sel1.c.
References L_NOCOPY, sarrayGetCount(), sarrayGetString(), selCreate(), selSetElement(), and selSetOrigin().
Referenced by selaCreateFromFile().
| SEL* selCreateFromString | ( | const char * | text, |
| l_int32 | h, | ||
| l_int32 | w, | ||
| const char * | name | ||
| ) |
| [in] | text | |
| [in] | h,w | height, width |
| [in] | name | [optional] sel name; can be null |
Notes:
(1) The text is an array of chars (in row-major order) where
each char can be one of the following:
'x': hit
'o': miss
' ': don't-care
(2) When the origin falls on a hit or miss, use an upper case
char (e.g., 'X' or 'O') to indicate it. When the origin
falls on a don't-care, indicate this with a 'C'.
The string must have exactly one origin specified.
(3) The advantage of this method is that the text can be input
in a format that shows the 2D layout of the Sel; e.g.,
static const char *seltext = "x " "x Oo " "x " "xxxxx";
Definition at line 1616 of file sel1.c.
References selCreate(), selSetElement(), and selSetOrigin().
Referenced by sela4and8ccThin(), sela4ccThin(), and sela8ccThin().
| void selDestroy | ( | SEL ** | psel | ) |
| [in] | sel | |
| [in] | size | of grid interiors; odd; minimum size of 13 is enforced |
| [in] | gthick | grid thickness; minimum size of 2 is enforced |
Notes:
(1) This gives a visual representation of a general (hit-miss) sel.
(2) The empty sel is represented by a grid of intersecting lines.
(3) Three different patterns are generated for the sel elements:
~ hit (solid black circle)
~ miss (black ring; inner radius is radius2)
~ origin (cross, XORed with whatever is there)
Definition at line 2200 of file sel1.c.
References generatePtaFilledCircle(), L_FLIP_PIXELS, L_SET_PIXELS, PIX_DST, PIX_NOT, pixCreate(), pixGenerateFromPta(), pixRasterop(), pixRenderLine(), pixSubtract(), ptaTransform(), selGetParameters(), and selGetTypeAtOrigin().
Referenced by selaDisplayInPix().
| l_ok selFindMaxTranslations | ( | SEL * | sel, |
| l_int32 * | pxp, | ||
| l_int32 * | pyp, | ||
| l_int32 * | pxn, | ||
| l_int32 * | pyn | ||
| ) |
| [in] | sel | |
| [out] | pxp,pyp,pxn,pyn | max shifts |
Notes:
These are the maximum shifts for the erosion operation.
For example, when j < cx, the shift of the image
is +x to the cx. This is a positive xp shift.
Definition at line 1193 of file sel1.c.
References Sel::data, and selGetParameters().
Referenced by pixHMT().
| l_ok selGetElement | ( | SEL * | sel, |
| l_int32 | row, | ||
| l_int32 | col, | ||
| l_int32 * | ptype | ||
| ) |
| [in] | sel | |
| [in] | row | |
| [in] | col | |
| [out] | ptype | SEL_HIT, SEL_MISS, SEL_DONT_CARE |
Definition at line 781 of file sel1.c.
Referenced by selPrintToString().
| char* selGetName | ( | SEL * | sel | ) |
| [in] | sel |
Definition at line 685 of file sel1.c.
References Sel::name.
Referenced by selaFindSelByName(), selaGetBrickName(), and selaGetSelnames().
| l_ok selGetParameters | ( | SEL * | sel, |
| l_int32 * | psy, | ||
| l_int32 * | psx, | ||
| l_int32 * | pcy, | ||
| l_int32 * | pcx | ||
| ) |
| [in] | sel | |
| [out] | psy,psx,pcy,pcx | [optional] each can be null |
Definition at line 850 of file sel1.c.
References Sel::cx, Sel::cy, Sel::sx, and Sel::sy.
Referenced by pixDilate(), pixErode(), pixHMT(), selaGetBrickName(), selCopy(), selDisplayInPix(), selFindMaxTranslations(), selPrintToString(), selRotateOrth(), and selWriteStream().
| l_ok selGetTypeAtOrigin | ( | SEL * | sel, |
| l_int32 * | ptype | ||
| ) |
| [in] | sel | |
| [out] | ptype | SEL_HIT, SEL_MISS, SEL_DONT_CARE |
Definition at line 902 of file sel1.c.
Referenced by selDisplayInPix().
| char* selPrintToString | ( | SEL * | sel | ) |
| [in] | sel |
Notes:
(1) This is an inverse function of selCreateFromString.
It prints a textual representation of the SEL to a malloc'd
string. The format is the same as selCreateFromString
except that newlines are inserted into the output
between rows.
(2) This is useful for debugging. However, if you want to
save some Sels in a file, put them in a Sela and write
them out with selaWrite(). They can then be read in
with selaRead().
Definition at line 1704 of file sel1.c.
References selGetElement(), and selGetParameters().
| SEL* selRead | ( | const char * | fname | ) |
| [in] | fname | filename |
Definition at line 1380 of file sel1.c.
References fopenReadStream(), and selReadStream().
| SEL* selReadFromColorImage | ( | const char * | pathname | ) |
| [in] | pathname |
Notes:
(1) Loads an image from a file and creates a (hit-miss) sel.
(2) The sel name is taken from the pathname without the directory
and extension.
Definition at line 2060 of file sel1.c.
References pixDestroy(), pixRead(), selCreateFromColorPix(), splitPathAtDirectory(), and splitPathAtExtension().
| SEL* selReadStream | ( | FILE * | fp | ) |
| [in] | sel | |
| [in] | quads | 0 - 4; number of 90 degree cw rotations |
Definition at line 1243 of file sel1.c.
References selCopy(), selCreateBrick(), and selGetParameters().
Referenced by selaMakeThinSets().
| l_ok selSetElement | ( | SEL * | sel, |
| l_int32 | row, | ||
| l_int32 | col, | ||
| l_int32 | type | ||
| ) |
| [in] | sel | |
| [in] | row | |
| [in] | col | |
| [in] | type | SEL_HIT, SEL_MISS, SEL_DONT_CARE |
Notes:
(1) Because we use row and column to index into an array,
they are always non-negative. The location of the origin
(and the type of operation) determine the actual
direction of the rasterop.
Definition at line 821 of file sel1.c.
Referenced by selCreateFromPix(), selCreateFromPta(), selCreateFromSArray(), and selCreateFromString().
| l_ok selSetName | ( | SEL * | sel, |
| const char * | name | ||
| ) |
| [in] | sel | |
| [in] | name | [optional]; can be null |
Notes:
(1) Always frees the existing sel name, if defined.
(2) If name is not defined, just clears any existing sel name.
Definition at line 710 of file sel1.c.
References Sel::name, and stringReplace().
| l_ok selSetOrigin | ( | SEL * | sel, |
| l_int32 | cy, | ||
| l_int32 | cx | ||
| ) |
| [in] | sel | |
| [in] | cy,cx |
Definition at line 880 of file sel1.c.
References Sel::cx, and Sel::cy.
Referenced by selCreateFromPix(), selCreateFromPta(), selCreateFromSArray(), and selCreateFromString().
| l_ok selWrite | ( | const char * | fname, |
| SEL * | sel | ||
| ) |
| [in] | fname | filename |
| [in] | sel |
Definition at line 1526 of file sel1.c.
References fopenWriteStream(), and selWriteStream().
| l_ok selWriteStream | ( | FILE * | fp, |
| SEL * | sel | ||
| ) |
| [in] | fp | file stream |
| [in] | sel |
Definition at line 1555 of file sel1.c.
References selGetParameters().
Referenced by selWrite().