** Initialize, load and free a labelObj structure */
| 1599 | ** Initialize, load and free a labelObj structure |
| 1600 | */ |
| 1601 | void initLabel(labelObj *label) |
| 1602 | { |
| 1603 | int i; |
| 1604 | |
| 1605 | label->antialias = -1; /* off */ |
| 1606 | label->align = MS_ALIGN_LEFT; |
| 1607 | MS_INIT_COLOR(label->color, 0,0,0,255); |
| 1608 | MS_INIT_COLOR(label->outlinecolor, -1,-1,-1,255); /* don't use it */ |
| 1609 | label->outlinewidth=1; |
| 1610 | |
| 1611 | MS_INIT_COLOR(label->shadowcolor, -1,-1,-1,255); /* don't use it */ |
| 1612 | label->shadowsizex = label->shadowsizey = 1; |
| 1613 | |
| 1614 | label->font = NULL; |
| 1615 | label->type = MS_BITMAP; |
| 1616 | label->size = MS_MEDIUM; |
| 1617 | |
| 1618 | label->position = MS_CC; |
| 1619 | label->angle = 0; |
| 1620 | label->anglemode = MS_NONE; |
| 1621 | label->minsize = MS_MINFONTSIZE; |
| 1622 | label->maxsize = MS_MAXFONTSIZE; |
| 1623 | label->buffer = 0; |
| 1624 | label->offsetx = label->offsety = 0; |
| 1625 | label->minscaledenom=-1; |
| 1626 | label->maxscaledenom=-1; |
| 1627 | label->minfeaturesize = -1; /* no limit */ |
| 1628 | label->autominfeaturesize = MS_FALSE; |
| 1629 | label->mindistance = -1; /* no limit */ |
| 1630 | label->repeatdistance = 0; /* no repeat */ |
| 1631 | label->maxoverlapangle = 22.5; /* default max overlap angle */ |
| 1632 | label->partials = MS_TRUE; |
| 1633 | label->wrap = '\0'; |
| 1634 | label->maxlength = 0; |
| 1635 | label->minlength = 0; |
| 1636 | label->space_size_10=0.0; |
| 1637 | |
| 1638 | label->encoding = NULL; |
| 1639 | |
| 1640 | label->force = MS_FALSE; |
| 1641 | label->priority = MS_DEFAULT_LABEL_PRIORITY; |
| 1642 | |
| 1643 | /* Set maxstyles = 0, styles[] will be allocated as needed on first call |
| 1644 | * to msGrowLabelStyles() |
| 1645 | */ |
| 1646 | label->numstyles = label->maxstyles = 0; |
| 1647 | label->styles = NULL; |
| 1648 | |
| 1649 | label->numbindings = 0; |
| 1650 | for(i=0; i<MS_LABEL_BINDING_LENGTH; i++) { |
| 1651 | label->bindings[i].item = NULL; |
| 1652 | label->bindings[i].index = -1; |
| 1653 | } |
| 1654 | |
| 1655 | return; |
| 1656 | } |
| 1657 | |
| 1658 | static void freeLabel(labelObj *label) |
no outgoing calls
no test coverage detected