Question: When a digital camera records a photograph, it also records data about how the photograph was taken. There are three values that determine the correct

When a digital camera records a photograph, it also records data about how the photograph was taken. There are three values that determine the correct contrast and exposure of a photograph. These are: Aperture Shutter Speed Sensitivity of the medium The aperture is recording using a number called an F-stop. These numbers have a set sequence but technically can be any value in between. 1, 1.4, 2, 2.8, 4.0, 5.6, 8, 11, 16, 22. The larger the number, the smaller the aperture and thus the less light the photographic surface will receive. The shutter speed is recorded using a time (usually this is 1/n seconds). For instance, 1/125 seconds is a common shutter speed. These range from 1 second up to 1/8000 of a second commonly. The numbers are usually a set sequence: 1, 1/2, 1/4, 1/8, 1/15, 1/30, 1/60, 1/125, 1/250, 1/500, 1/1000, 1/2000, 1/4000, 1/8000. Finally, the sensitivity is measured in a unit called ISO. This number is commonly one of the following: 100, 200, 400, 800, 1600. Another valued called exposure value (EV) represents the total amount of light used to create the photo. It is a derived value based on the shutter speed, aperture and ISO value. Different combinations of these values can be equivalent. The Lux value is another unit to measure total light. For this lab, you are going to create a Kotlin class that stores photo metadata. This metadata class will use computed properties and as well as methods to allow users to find out data about the photo that was not previously stored in the original camera data.

Your Kotlin class should include properties for the following:

aperture

shutterSpeed

ev

description

iso

lux The property names MUST BE named exactly as written above. The class MUST BE stored in a separate file named PhotoMetadata.kt and the class MUST BE named PhotoMetadata. EV is a value that should be derived using a getter. It should be set based on the following formula: ev=log2(a2t)+log2(iso100) ev is exposure value, a is aperture value, and t is time (shutter speed).

lux=2.52ev

Since lux is also totally calculated via the other data, there is no reason that it should be stored. This should be a calculated property as well. One you have completed the class, create a test program to create two instances of photos from user input (the user will provide aperture, shutter speed and ISO). Set the various properties and test the output by creating print statements that output the data from the various properties.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!