• edited by
17,651 views
3 3 votes

A frame buffer array is addressed in row major order for a monitor with pixel locations starting from $(0,0)$ and ending with $(100,100).$ What is address of the pixel $(6,10)?$ Assume one bit storage per pixel and starting pixel location is at $0.$

  1. $1016$
  2. $1006$
  3. $610$
  4. $616$

4 Answers

Best answer
13 13 votes

Address of pixel (6,10) in row major order is,

= 0 + 1((6 - 0) +101 (10 - 0))

= 1016

(For pixel calculation address in row major order , use logic of how to find address of array element in column major order .)

• selected by
5 5 votes
Let’s imagine the frame buffer to be a matrix of 100x100, so we define this as 2d array in C(or any language for that matter), note that the size of the array should be actually array[101][101] since we need to store 100, this is from the fact that if you need to store a single element in a array you need to declare it as array[1] and not array[0] which would not make sense, right?

Now we have maximum rows = maximum colums = 101. So we can get the address of element by using row-major order.

 

Case 1: Row Major Order

Address = Base Adress + Size of Single Element * (Row * Maximum Row Value) + Column

So, we have,

0 + 1 * (6 * 101) + 10 = 616

 

Case 2: Column Major Order

Address = Base Address + Size of Single Element * (Column * Maximum Column Value) + Row

So, we have,

0 + 1 * (10 * 101) + 6 = 1016

I have no clue what is the answer, some website says it’s 616 and some say it’s 1016. If anyone have any ideas, please comment below. I really would like to know.
2 2 votes

Column Major System:

The address of a location in Column Major System is calculated using the following formula:

Address of A [ I ][ J ] = B + W * [  ( I – Lr ) + M*( J – Lc ) ]

A[6][10] = 0 + 1[(6-0) +100*10] = 1016

Answer is A

• edited by
Answer:
Position:
Show:

Related questions

5 5 votes
3 3 answers
6.8k
6.8k views
ninuarun asked May 31, 2016
6,806 views
How much memory is required to implement $z$-buffer algorithm for a $512 \times 512 \times 24$ bit-plane image?$768$ KB$1$ MB$1.5$ MB$2$ MB
2 2 votes
1 answers 1 answer
3.6k
3.6k views
Misbah Ghaya asked Jul 25, 2016
3,645 views
Match the following $:$$\begin{array}{clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Cavalier} & \text{i.} & \text{The direction of projection is ...
1 1 vote
2 2 answers
2.8k
2.8k views
Misbah Ghaya asked Jul 25, 2016
2,841 views
In Cyrus-Beck algorithm for line clipping the value of $t$ parameter is computed by the relation: (Here $P_{1}$ and $P_{2}$ are the two end points of the line, $f$ is a p...
2 2 votes
1 answers 1 answer
2.1k
2.1k views
Misbah Ghaya asked Jul 25, 2016
2,132 views
A technique used to approximate halftones without reducing spatial resolution is known as________.HalftoningDithering Error diffusionNone of the above