10
votes
Accepted
How does “RGBTRIPLE triple;” know whitch pixel to store?
You have mixed them a little in your head but we are here. :)
Firstly, the line
RGBTRIPLE triple;
doesn't get a pixel, it just declares a variable, of type RGBTRIPLE with the name triple. It would ...
5
votes
Why is RGBTRIPLE in our bitmap 3 bytes? Is that defined somewhere?
If you take a look in bmp.h, which is included as a header file to copy.c, you'll see a definition for structures named RGBTRIPLE:
typedef struct
{
BYTE rgbtBlue;
BYTE rgbtGreen;
BYTE ...
2
votes
Why is RGBTRIPLE in our bitmap 3 bytes? Is that defined somewhere?
The missing part of Dr.Queso's response is this. A pixel is made of 3 parts - one red, one green and one blue. Each of these is represented by a number that determines it's intensity. The range for ...
1
vote
Accepted
pset4 - (Filter Less ) - Doubts with malloc()
You seem to be confused about malloc(). malloc allocates memory from heap. You can store anything inside this allotted memory location.
Specifically it expects the following input: number of bytes of ...
1
vote
Accepted
How does RGBTRIPLE differentiate between the 3 bytes it reads from input file and assign them to rgbt blue, green and red?
When a struct is stored in memory, the data for each struct element is stored in sequence. That means that when a struct's data is read, the data is simply read into each element in the same order ...
Only top scored, non community-wiki answers of a minimum length are eligible