EBK BIG JAVA: EARLY OBJECTS, INTERACTIV
EBK BIG JAVA: EARLY OBJECTS, INTERACTIV
6th Edition
ISBN: 8220102010314
Author: Horstmann
Publisher: YUZU
Question
Book Icon
Chapter 21, Problem 9PP
Program Plan Intro

Program to negate a 24-bit true-color image

Program plan:

  • In the file BMPImageNegater.java”, import necessary packages and create a class BMPImageNegater”,
    • Define the method “main()”,
      • Declare the variable to hold the file name.
      • Check if there is no command line input,
        • Print an error message.
      • Otherwise,
        • Get the file name from the command line input.
        • Execute “try” statement,
          • Set the offset value as “10”.
          • Advances the pointer to the starting position of the first pixel.
          • Calculate “256” to the power of “2”.
          • Calculate “256” to the power of “3”.
          • Read and compute the power of first pixel.
          • Advances the pointer to the starting position of the width.
          • Read and compute the width of an image.
          • Read and compute the height of an image.
          • Discover the number of padding bytes if any.
          • Advances the pointer to the first pixel in the image.
          • Declare the variables.
          • Execute a loop,
            • Execute a loop,
              • Read and negate the Red value of this pixel.
              • Read and negate the Green value of this pixel.
              • Read and negate the Blue value of this pixel
              • Overwrite the pixels with the negated value.
              • Update the values in an image.
            • Skip the padding bytes if any.
          • Close the file.
                • Catch if “FileNotFoundException” occurs,
                  • Handle the exception.
                • Catch if “IOException” occurs,
                  • Handle the exception.

Blurred answer
Students have asked these similar questions
We want to get an idea of how many tickets we have and what our issues are. Print the ticket ID number, ticket description, ticket priority, ticket status, and, if the information is available, employee first name assigned to it for our records. Include all tickets regardless of whether they have been assigned to an employee or not. Sort it alphabetically by ticket status, and then numerically by ticket ID, with the lower ticket IDs on top.
Figure 1 shows an ASM chart representing the operation of a controller. Stateassignments for each state are indicated in square brackets for [Q1, Q0].Using the ASM design technique:(a) Produce a State Transition Table from the ASM Chart in Figure 1.(b) Extract minimised Boolean expressions from your state transition tablefor Q1, Q0, DISPATCH and REJECT. Show all your working.(c) Implement your design using AND/OR/NOT logic gates and risingedgetriggered D-type Flip Flops. Your answer should include a circuitschematic.
A controller is required for a home security alarm, providing the followingfunctionality. The alarm does nothing while it is disarmed (‘switched off’). It canbe armed (‘switched on’) by entering a PIN on the keypad. Whenever thealarm is armed, it can be disarmed by entering the PIN on the keypad.If motion is detected while the alarm is armed, the siren should sound AND asingle SMS message sent to the police to notify them. Further motion shouldnot result in more messages being sent. If the siren is sounding, it can only bedisarmed by entering the PIN on the keypad. Once the alarm is disarmed, asingle SMS should be sent to the police to notify them.Two (active-high) input signals are provided to the controller:MOTION: Asserted while motion is detected inside the home.PIN: Asserted for a single clock cycle whenever the PIN has beencorrectly entered on the keypad.The controller must provide two (active-high) outputs:SIREN: The siren sounds while this output is asserted.POLICE: One SMS…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education