MCPcopy Create free account
hub / github.com/MapServer/MapServer / aggInitializeRasterBuffer

Function aggInitializeRasterBuffer

mapagg.cpp:630–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630int aggInitializeRasterBuffer(rasterBufferObj *rb, int width, int height, int mode) {
631 rb->type = MS_BUFFER_BYTE_RGBA;
632 rb->data.rgba.pixel_step = 4;
633 rb->data.rgba.row_step = rb->data.rgba.pixel_step * width;
634 rb->width = width;
635 rb->height = height;
636 int nBytes = rb->data.rgba.row_step * height;
637 rb->data.rgba.pixels = (band_type*)msSmallCalloc(nBytes,sizeof(band_type));
638 rb->data.rgba.r = &(rb->data.rgba.pixels[band_order::R]);
639 rb->data.rgba.g = &(rb->data.rgba.pixels[band_order::G]);
640 rb->data.rgba.b = &(rb->data.rgba.pixels[band_order::B]);
641 if(mode == MS_IMAGEMODE_RGBA) {
642 rb->data.rgba.a = &(rb->data.rgba.pixels[band_order::A]);
643 }
644 return MS_SUCCESS;
645}
646
647
648

Callers 1

aggGetRasterBufferCopyFunction · 0.85

Calls 1

msSmallCallocFunction · 0.85

Tested by

no test coverage detected