Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

NRPixBlock* nr_pixblock_new_fast ( NR_PIXBLOCK_MODE  mode,
int  x0,
int  y0,
int  x1,
int  y1,
bool  clear 
)

Allocates NRPixBlock and sets it up.

Returns:
Pointer to fresh pixblock. Calls g_new() and nr_pixblock_setup().

Definition at line 243 of file nr-pixblock.cpp.

References NRPixBlock::data, nr_pixblock_setup_fast(), NR_PIXBLOCK_SIZE_TINY, NRPixBlock::px, and NRPixBlock::size.

{
    NRPixBlock *pb;

    pb = g_new (NRPixBlock, 1);
    if (!pb) return 0;

    nr_pixblock_setup_fast (pb, mode, x0, y0, x1, y1, clear);
    if (pb->size!=NR_PIXBLOCK_SIZE_TINY && !pb->data.px) {
        g_free(pb);
        return 0;
    }

    return pb;
}


Generated by  Doxygen 1.6.0   Back to index