Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Flat contracts Go to:
note description: "[ Color modeled as red, green, blue intensities each with range [0,1]. ]" legal: "See notice at end of class." keywords: "color, pixel, rgb, 8, 16, 24" status: "See notice at end of class." date: "$Date: 2019-04-19 04:59:32 -0800 (Fri, 19 Apr 2019) $" revision: "$Revision: 103082 $" class interface EV_COLOR create default_create -- Standard creation procedure. -- (from EV_ANY) require -- from ANY True ensure then -- from EV_ANY is_coupled: implementation /= Void is_initialized: is_initialized default_create_called: default_create_called is_in_default_state: is_in_default_state make_with_8_bit_rgb (an_8_bit_red, an_8_bit_green, an_8_bit_blue: INTEGER_32) -- Create with a_red, a_green, a_blue, and default name. require red_within_range: an_8_bit_red >= 0 and an_8_bit_red <= Max_8_bit green_within_range: an_8_bit_green >= 0 and an_8_bit_green <= Max_8_bit blue_within_range: an_8_bit_blue >= 0 and an_8_bit_blue <= Max_8_bit ensure red_assigned: red_8_bit = an_8_bit_red green_assigned: green_8_bit = an_8_bit_green blue_assigned: blue_8_bit = an_8_bit_blue make_with_rgb (a_red, a_green, a_blue: REAL_32) -- Create with a_red, a_green, a_blue, and default name. require a_red_within_range: a_red >= 0.to_real and then a_red <= 1.to_real a_green_within_range: a_green >= 0.to_real and then a_green <= 1.to_real a_blue_within_range: a_blue >= 0.to_real and then a_blue <= 1.to_real ensure red_assigned: (red - a_red).abs <= delta green_assigned: (green - a_green).abs <= delta blue_assigned: (blue - a_blue).abs <= delta feature -- Access blue: REAL_32 -- Intensity of blue component. Range: [0,1] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.blue data: detachable ANY -- Arbitrary user data may be stored here. -- (from EV_ANY) generating_type: TYPE [detachable EV_COLOR] -- Type of current object -- (type of which it is a direct instance) -- (from ANY) ensure -- from ANY generating_type_not_void: Result /= Void generator: STRING_8 -- Name of current object's generating class -- (base class of the type of which it is a direct instance) -- (from ANY) ensure -- from ANY generator_not_void: Result /= Void generator_not_empty: not Result.is_empty green: REAL_32 -- Intensity of green component. Range: [0,1] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.green hue: REAL_32 -- Hue of the color in radiant. Multiply by 60 to get in degree. require not_destroyed: not is_destroyed hue_as_degrees: INTEGER_32 -- Hue of the color in degree. ensure in_range: Result >= 0 and Result <= 360 hue_as_segments: REAL_32 -- Hue of the color in 6ths of a circle (each a vertex -- of a hexagon, a common abstraction) ensure in_range: Result >= 0.to_real and Result <= 6.to_real lightness: REAL_32 -- Lightness of the color require not_destroyed: not is_destroyed red: REAL_32 -- Intensity of red component. Range: [0,1] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.red saturation: REAL_32 -- Saturation of the color require not_destroyed: not is_destroyed feature -- Comparison copy (other: like Current) -- Update Current by setting attributes from other. require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_equal: Current ~ other frozen deep_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void -- or attached to isomorphic object structures? -- (from ANY) ensure -- from ANY instance_free: class shallow_implies_deep: standard_equal (a, b) implies Result both_or_none_void: (a = Void) implies (Result = (b = Void)) same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b)) symmetric: Result implies deep_equal (b, a) frozen equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached -- to objects considered equal? -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) frozen is_deep_equal alias "≡≡≡" (other: EV_COLOR): BOOLEAN -- Are Current and other attached to isomorphic object structures? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY shallow_implies_deep: standard_is_equal (other) implies Result same_type: Result implies same_type (other) symmetric: Result implies other.is_deep_equal (Current) is_equal (other: like Current): BOOLEAN -- Does Current look the same color as other? require -- from ANY other_not_void: other /= Void ensure -- from ANY symmetric: Result implies other ~ Current consistent: standard_is_equal (other) implies Result frozen standard_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached to -- field-by-field identical objects of the same type? -- Always uses default object comparison criterion. -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.standard_is_equal (b)) frozen standard_is_equal alias "" (other: EV_COLOR): BOOLEAN -- Is other attached to an object of the same type -- as current object, and field-by-field identical to it? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY same_type: Result implies same_type (other) symmetric: Result implies other.standard_is_equal (Current) feature -- Status report conforms_to (other: ANY): BOOLEAN -- Does type of current object conform to type -- of other (as per Eiffel: The Language, chapter 13)? -- (from ANY) require -- from ANY other_not_void: other /= Void is_hashable: BOOLEAN -- May current object be hashed? -- (True by default.) -- (from HASHABLE) same_type (other: ANY): BOOLEAN -- Is type of current object identical to type of other? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY definition: Result = (conforms_to (other) and other.conforms_to (Current)) feature -- Element change set_blue (a_blue: REAL_32) -- Assign a_blue to `blue`. require not_destroyed: not is_destroyed blue_within_range: a_blue >= 0.to_real and then a_blue <= 1.to_real ensure blue_assigned: (blue - a_blue).abs <= delta set_data (some_data: like data) -- Assign some_data to `data`. -- (from EV_ANY) require -- from EV_ANY not_destroyed: not is_destroyed ensure -- from EV_ANY data_assigned: data = some_data set_green (a_green: REAL_32) -- Assign a_green to `green`. require not_destroyed: not is_destroyed within_range: a_green >= 0.to_real and then a_green <= 1.to_real ensure green_assigned: (green - a_green).abs <= delta set_red (a_red: REAL_32) -- Assign a_red to `red`. require not_destroyed: not is_destroyed within_range: a_red >= 0.to_real and then a_red <= 1.to_real ensure red_assigned: (red - a_red).abs <= delta set_rgb (a_red, a_green, a_blue: REAL_32) -- Assign a_red, a_green and a_blue -- to `red`, `green` and `blue` respectively. require not_destroyed: not is_destroyed red_within_range: a_red >= 0.to_real and then a_red <= 1.to_real green_within_range: a_green >= 0.to_real and then a_green <= 1.to_real blue_within_range: a_blue >= 0.to_real and then a_blue <= 1.to_real ensure red_assigned: (red - a_red).abs <= delta green_assigned: (green - a_green).abs <= delta blue_assigned: (blue - a_blue).abs <= delta feature -- Conversion blue_16_bit: INTEGER_32 -- Intensity of blue component as an 16 bit unsigned integer. -- Range [0,65535] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.blue_16_bit blue_8_bit: INTEGER_32 -- Intensity of `blue` component as an 8 bit unsigned integer. -- Range [0,255] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.blue_8_bit green_16_bit: INTEGER_32 -- Intensity of green component as an 16 bit unsigned integer. -- Range [0,65535] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.green_16_bit green_8_bit: INTEGER_32 -- Intensity of `green` component as an 8 bit unsigned integer. -- Range [0,255] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.green_8_bit red_16_bit: INTEGER_32 -- Intensity of red component as an 16 bit unsigned integer. -- Range [0,65535] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.red_16_bit red_8_bit: INTEGER_32 -- Intensity of `red` component as an 8 bit unsigned integer. -- Range [0,255] require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.red_8_bit rgb_24_bit: INTEGER_32 -- `red`, `green` and `blue` intensities packed into 24 bits -- with 8 bits per colour and blue in the least significant 8 bits. require not_destroyed: not is_destroyed ensure bridge_ok: Result = implementation.rgb_24_bit set_blue_with_16_bit (a_16_bit_blue: INTEGER_32) -- Set `blue` from a_16_bit_blue intinsity. require not_destroyed: not is_destroyed within_range: a_16_bit_blue >= 0 and then a_16_bit_blue <= Max_16_bit ensure blue_assigned: blue_16_bit = a_16_bit_blue set_blue_with_8_bit (an_8_bit_blue: INTEGER_32) -- Set `blue` from an_8_bit_blue intinsity. require not_destroyed: not is_destroyed within_range: an_8_bit_blue >= 0 and then an_8_bit_blue <= Max_8_bit ensure blue_assigned: blue_8_bit = an_8_bit_blue set_green_with_16_bit (a_16_bit_green: INTEGER_32) -- Set `green` from a_16_bit_green intinsity. require not_destroyed: not is_destroyed within_range: a_16_bit_green >= 0 and then a_16_bit_green <= Max_16_bit ensure green_assigned: green_16_bit = a_16_bit_green set_green_with_8_bit (an_8_bit_green: INTEGER_32) -- Set `green` from an_8_bit_green intinsity. require not_destroyed: not is_destroyed within_range: an_8_bit_green >= 0 and then an_8_bit_green <= Max_8_bit ensure green_assigned: green_8_bit = an_8_bit_green set_red_with_16_bit (a_16_bit_red: INTEGER_32) -- Set `red` from a_8_bit_red intinsity. require not_destroyed: not is_destroyed within_range: a_16_bit_red >= 0 and then a_16_bit_red <= Max_16_bit ensure red_assigned: red_16_bit = a_16_bit_red set_red_with_8_bit (an_8_bit_red: INTEGER_32) -- Set `red` from an_8_bit_red intinsity. require not_destroyed: not is_destroyed within_range: an_8_bit_red >= 0 and then an_8_bit_red <= Max_8_bit ensure red_assigned: red_8_bit = an_8_bit_red set_rgb_with_16_bit (a_16_bit_red, a_16_bit_green, a_16_bit_blue: INTEGER_32) -- Set intensities  from a_16_bit_red, a_16_bit_green, and -- a_16_bit_blue intensity. (16 bits per channel.) require not_destroyed: not is_destroyed red_within_range: a_16_bit_red >= 0 and a_16_bit_red <= Max_16_bit green_within_range: a_16_bit_green >= 0 and a_16_bit_green <= Max_16_bit blue_within_range: a_16_bit_blue >= 0 and a_16_bit_blue <= Max_16_bit ensure red_assigned: red_16_bit = a_16_bit_red green_assigned: green_16_bit = a_16_bit_green blue_assigned: blue_16_bit = a_16_bit_blue set_rgb_with_24_bit (a_24_bit_rgb: INTEGER_32) -- Set intensities from a_24_bit_rgb value -- with blue in the least significant 8 bits. require not_destroyed: not is_destroyed within_range: a_24_bit_rgb >= 0 and a_24_bit_rgb <= Max_24_bit ensure rgb_assigned: rgb_24_bit = a_24_bit_rgb set_rgb_with_8_bit (an_8_bit_red, an_8_bit_green, an_8_bit_blue: INTEGER_32) -- Set intensities  from an_8_bit_red, an_8_bit_green, and -- an_8_bit_blue intensity. (8 bits per channel.) require not_destroyed: not is_destroyed red_within_range: an_8_bit_red >= 0 and an_8_bit_red <= Max_8_bit green_within_range: an_8_bit_green >= 0 and an_8_bit_green <= Max_8_bit blue_within_range: an_8_bit_blue >= 0 and an_8_bit_blue <= Max_8_bit ensure red_assigned: red_8_bit = an_8_bit_red green_assigned: green_8_bit = an_8_bit_green blue_assigned: blue_8_bit = an_8_bit_blue feature -- Duplication frozen deep_copy (other: EV_COLOR) -- Effect equivalent to that of: -- `copy` (other . `deep_twin`) -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY deep_equal: deep_equal (Current, other) frozen deep_twin: EV_COLOR -- New object structure recursively duplicated from Current. -- (from ANY) ensure -- from ANY deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) frozen standard_copy (other: EV_COLOR) -- Copy every field of other onto corresponding field -- of current object. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_standard_equal: standard_is_equal (other) frozen standard_twin: EV_COLOR -- New object field-by-field identical to other. -- Always uses default copying semantics. -- (from ANY) ensure -- from ANY standard_twin_not_void: Result /= Void equal: standard_equal (Result, Current) frozen twin: EV_COLOR -- New object equal to Current -- `twin` calls `copy`; to change copying/twinning semantics, redefine `copy`. -- (from ANY) ensure -- from ANY twin_not_void: Result /= Void is_equal: Result ~ Current feature -- Basic operations frozen default: detachable EV_COLOR -- Default value of object's type -- (from ANY) frozen default_pointer: POINTER -- Default value of type POINTER -- (Avoid the need to write p.`default` for -- some p of type POINTER.) -- (from ANY) ensure -- from ANY instance_free: class default_rescue -- Process exception for routines with no Rescue clause. -- (Default: do nothing.) -- (from ANY) frozen do_nothing -- Execute a null action. -- (from ANY) ensure -- from ANY instance_free: class feature -- Command destroy -- Destroy underlying native toolkit object. -- Render Current unusable. -- (from EV_ANY) ensure -- from EV_ANY is_destroyed: is_destroyed feature -- Constants Max_16_bit: INTEGER_32 = 65535 -- Maximum value for 16 bit unsigned integers. Max_24_bit: INTEGER_32 = 16777215 -- Maximum value for 24 bit unsigned integers. Max_8_bit: INTEGER_32 = 255 -- Maximum value for 8 bit unsigned integers. feature -- Hashable hash_code: INTEGER_32 -- Hash code value ensure -- from HASHABLE good_hash_value: Result >= 0 feature -- Output Io: STD_FILES -- Handle to standard file setup -- (from ANY) ensure -- from ANY instance_free: class io_not_void: Result /= Void out: STRING_8 -- Textual representation. ensure -- from ANY out_not_void: Result /= Void print (o: detachable ANY) -- Write terse external representation of o -- on standard output. -- (from ANY) ensure -- from ANY instance_free: class frozen tagged_out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY tagged_out_not_void: Result /= Void feature -- Platform Operating_environment: OPERATING_ENVIRONMENT -- Objects available from the operating system -- (from ANY) ensure -- from ANY instance_free: class operating_environment_not_void: Result /= Void feature -- Status Report is_destroyed: BOOLEAN -- Is Current no longer usable? -- (from EV_ANY) ensure -- from EV_ANY bridge_ok: Result = implementation.is_destroyed invariant red_within_range: red >= 0.to_real and red <= 1.to_real green_within_range: green >= 0.to_real and green <= 1.to_real blue_within_range: blue >= 0.to_real and blue <= 1.to_real red_8_bit_within_range: red_8_bit >= 0 and red_8_bit <= Max_8_bit green_8_bit_within_range: green_8_bit >= 0 and green_8_bit <= Max_8_bit blue_8_bit_within_range: blue_8_bit >= 0 and blue_8_bit <= Max_8_bit red_16_bit_within_range: red_16_bit >= 0 and red_16_bit <= Max_16_bit green_16_bit_within_range: green_16_bit >= 0 and green_16_bit <= Max_16_bit blue_16_bit_within_range: blue_16_bit >= 0 and blue_16_bit <= Max_16_bit rgb_24_bit_within_range: rgb_24_bit >= 0 and rgb_24_bit <= Max_24_bit red_16_bit_conversion: ((red * Max_16_bit.to_real) - red_16_bit.to_real).abs <= delta * Max_16_bit.to_real red_8_bit_conversion: ((red * Max_8_bit.to_real) - red_8_bit.to_real).abs <= delta * Max_8_bit.to_real green_16_bit_conversion: ((green * Max_16_bit.to_real) - green_16_bit.to_real).abs <= delta * Max_16_bit.to_real green_8_bit_conversion: ((green * Max_8_bit.to_real) - green_8_bit.to_real).abs < delta * Max_8_bit.to_real blue_16_bit_conversion: ((blue * Max_16_bit.to_real) - blue_16_bit.to_real).abs < delta * Max_16_bit.to_real blue_8_bit_conversion: ((blue * Max_8_bit.to_real) - blue_8_bit.to_real).abs < delta * Max_8_bit.to_real -- from EV_ANY is_initialized: is_initialized default_create_called: default_create_called is_coupled: default_create_called implies (implementation.interface = Current or (attached {EV_ENVIRONMENT} Current and then attached implementation.interface)) -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) note copyright: "Copyright (c) 1984-2019, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class EV_COLOR
Classes Clusters Cluster hierarchy Chart Relations Flat contracts Go to:

-- Generated by Eiffel Studio --
For more details: eiffel.org