jeudi 2 avril 2015

Overlay title on an image c++

I have a greyscale image (150 x 200) and a title image (150 x 30), the title image has a transparent background (stored as values 0x00).


I need to create a function that is passed three parameters (2D matrix of image, 2D matrix of Title, integer value indicating which row the title overlay should start from).


The function should scan each pixel in the title matrix and if it is 0x00 the corresponding pixel should be unchanged in the image. If it is not 0x00 then the pixel from the title matrix should be copied into the corresponding position of the image.


The title should overlay the original image starting at row 160.


my function is called:



void TitleOverlay (unsigned char PixelGrid[WIDTH][HEIGHT], TitleGrid[WIDTH][MASKHEIGHT], int startrow)


I am struggling to figure out what this function would include, possibly some nested loops?


Aucun commentaire:

Enregistrer un commentaire