Пример #1
0
HPDF_STATUS
HPDF_Image_SetMask (HPDF_Image   image,
                    HPDF_BOOL    mask)
{
    HPDF_Boolean image_mask;

    if (!HPDF_Image_Validate (image))
        return HPDF_INVALID_IMAGE;

    if (mask && HPDF_Image_GetBitsPerComponent (image) != 1)
        return HPDF_SetError (image->error, HPDF_INVALID_BIT_PER_COMPONENT,
                0);

    image_mask = HPDF_Dict_GetItem (image, "ImageMask", HPDF_OCLASS_BOOLEAN);
    if (!image_mask) {
        HPDF_STATUS ret;
        image_mask = HPDF_Boolean_New (image->mmgr, HPDF_FALSE);

        if ((ret = HPDF_Dict_Add (image, "ImageMask", image_mask)) != HPDF_OK)
            return ret;
    }

    image_mask->value = mask;
    return HPDF_OK;
}
Пример #2
0
HPDF_3DAnnot_Set3DView    (HPDF_Annotation  annot)
{
    HPDF_Boolean b;

    HPDF_PTRACE((" HPDF_3DAnnot_Set3DView\n"));

    if (!CheckSubType (annot, HPDF_ANNOT_3D))
        return HPDF_INVALID_ANNOTATION;

    b = HPDF_Boolean_New (annot->mmgr, 0);
    if (!b)
        return HPDF_CheckError (annot->error);

    return  HPDF_Dict_Add (annot, "3DD", b);
}
Пример #3
0
HPDF_PopupAnnot_SetOpened (HPDF_Annotation  annot,
                           HPDF_BOOL        opened)
{
    HPDF_Boolean b;

    HPDF_PTRACE((" HPDF_TextAnnot_SetOpend\n"));

    if (!CheckSubType (annot, HPDF_ANNOT_POPUP))
        return HPDF_INVALID_ANNOTATION;

    b = HPDF_Boolean_New (annot->mmgr, opened);
    if (!b)
        return HPDF_CheckError (annot->error);

    return  HPDF_Dict_Add (annot, "Open", b);
}