Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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: LaTeX: ev\:=\:\log_2\left(\frac{a^2}{t} ight)\:+\log_2\left(\frac{iso}{100} ight)e v = log 2 ( a 2 t ) + log 2 ( i s o 100 ) ev is exposure value, a is aperture value, and t is time (shutter speed). In Kotlin the log base 2 function and exponentiation power function can be imported via the math library: import kotlin.math.pow import kotlin.math.log2 var a = 2.0 println(log2(10.0)) println(a.pow(8)) // 2 to the 8 power (2^8) Finally, the lux value is calculated via the following formula: LaTeX: lux\:=\:2.5\:\times\:2^{ev}l u x = 2.5 2 e v 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. Use the following table to verify that your numbers are reasonable when the ISO is set to 100: https://en.wikipedia.org/wiki/Exposure_value#EV_as_an_indicator_of_camera_settings (Links to an external site.) This same table can be used by adding from the EV value as follows: ISO Number to add 25 -2 50 -1 100 0 200 1 400 2 800 3 1600 4 So, for an aperture of 4.0 at 1/4000 sec, with ISO 200, the EV value would be 17 rather than 16 as is shown in the table. Lux values can be verified using the following table: https://en.wikipedia.org/wiki/Exposure_value#EV_as_a_measure_of_luminance_and_illuminance (Links to an external site.) Note that in this table lux is abbreviated as lx. Requirements The class needs to have primary constructor. You may use an init block if desired The constructor should accept as input: iso, aperture, and shutter speed values. The ev and lux values should be a calculated properties. The description should initialize to an empty string. The description should be set via a custom setter that ensures all the text is capitalized. The property names MUST BE named exactly as described above. Failure to follow this rule will result in a 50% grade deduction. The class MUST BE named PhotoMetadata and MUST BE stored in a separate file named PhotoMetadata.kt failure to follow this rule will result in a 50% deduction. You must create a program that uses user input to create two instances of the PhotoMetadata class and test the output of each of the properties for both objects using print statements

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

The Power of Public Speaking Clarifying the

Answered: 1 week ago

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago