| 628 | } |
| 629 | |
| 630 | int 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 |
no test coverage detected