Exemple #1
0
NITFAPI(cgm_PictureBody*) cgm_PictureBody_construct(nitf_Error* error)
{
    cgm_PictureBody* body =
        (cgm_PictureBody*)NITF_MALLOC(sizeof(cgm_PictureBody));

    if (!body)
    {
        nitf_Error_init(error, NITF_STRERROR(NITF_ERRNO),
                NITF_CTXT, NITF_ERR_MEMORY);
        return NULL;
    }

    body->auxColor = NULL;
    body->elements = NULL;

    body->elements = nitf_List_construct(error);
    if (!body->elements)
    {
        cgm_PictureBody_destruct(&body);
        return NULL;
    }

    body->auxColor = cgm_Color_construct(-1, -1, -1, error);
    if (!body->auxColor)
    {
        cgm_PictureBody_destruct(&body);
        return NULL;
    }

    body->transparency = 1;
    return body;
}
Exemple #2
0
    cgm_LineAttributes_construct(nitf_Error* error)
{
    cgm_LineAttributes* atts = 
        (cgm_LineAttributes*)NITF_MALLOC(sizeof(cgm_LineAttributes));
    if (!atts)
    {
        nitf_Error_init(error, NITF_STRERROR(NITF_ERRNO), NITF_CTXT,
                        NITF_ERR_MEMORY);
        return NULL;
    }

    atts->lineWidth = -1;
    atts->lineType = CGM_TYPE_NOT_SET;
    
    atts->lineColor = cgm_Color_construct(-1, -1, -1, error);
    if (!atts->lineColor)
    {
        cgm_LineAttributes_destruct(&atts);
        return NULL;
    }
    
    return atts;
}