Feature #4: Color of the first pixel on the second line
Print the color in RGB of the first pixel of the second line (coordinates 1,0) in the output terminal.
Feature description
Print the color in RGB of the first pixel of the second line (coordinates 1,0) in the output terminal. A possible prototype:
second_line(char *source_path);| Parameters | value |
|---|---|
| name | second_line |
| Command | -c second_line |
| Input | an image that has at least a height of 2 pixels |
| output | second_line: R, G, BR, G, B are the integer values of the components in the range 0-255 |
Usage
freud.exe -f ./images/input/image.jpeg -c second_line Output
second_line: 89, 139, 164Describe tips for implementing feature
Use the data from the function read_image_data from estia-image.h.
int read_image_data(const char *filename, unsigned char **data, int *width, int *height, int *channel_count);The components R, G, B of the first pixel of the second line are located at 3width, 3width+1 and 3*width+2 in the data array(the first line has width pixel of 3 channels). Read the estia-image documentation