In the BMP format for 24-bit true-color images, an image is stored in binary format. The start

Question:

In the BMP format for 24-bit true-color images, an image is stored in binary format.

The start of the file has the following information:

• The position of the first pixel of the image data, starting at offset 10

• The width of the image, starting at offset 18

• The height of the image, starting at offset 22 Each of these is a 4-byte integer value stored in little-endian format. That is, you need to get the integer value as n = bk + 256 · bk+1 + 2562 · bk+2 + 256· bk+3, where k is the starting offset.

Each pixel of the image occupies three bytes; one each for red, green, and blue. At the end of each row are between 0 and 3 padding bytes to make the row lengths multiples of four. For example, if an image has a width of 101 pixels, there is one padding byte per row.

Using a RandomAccessFile, turn each pixel of such a BMP file into its negative.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Big Java, Enhanced Early Objects

ISBN: 9781119499091

7th Edition

Authors: Cay S Horstmann

Question Posted: