note
	description: "Read-only version of a {GAME_PIXEL_FORMAT}."
	author: "Louis Marchand"
	date: "Thu, 02 Apr 2015 02:40:10 +0000"
	revision: "2.0"

class interface
	GAME_PIXEL_FORMAT_READABLE

create {GAME_SDL_ANY}
	make_from_flags (a_enum: NATURAL_32)
			-- Initialization for Current usign the internal format index.

	make_from_structure_pointer (a_structure: POINTER)
			-- Initialize usign the copy of a_structure format C pointer.
			-- a_structure is not freed by Current
		require
			pixel_format_info_structure_not_null: not a_structure.is_default_pointer

	share_from_structure_pointer (a_structure: POINTER)
			-- Initialize usign a_structure format C pointer.
			-- a_structure is not freed by Current
		require
			pixel_format_info_structure_not_null: not a_structure.is_default_pointer

	own_from_structure_pointer (a_structure: POINTER)
			-- Initialize usign a_structure format C pointer.
			-- a_structure will be freed by Current
		require
			pixel_format_info_structure_not_null: not a_structure.is_default_pointer

	make_from_bits_per_pixel_and_masks (a_bits_per_pixel: INTEGER_32; a_red_mask, a_green_mask, a_blue_mask, a_alpha_mask: NATURAL_32)
			-- Initialize Current usign a_bits_per_pixel value and pixel masks: a_red_mask, a_green_mask, a_blue_mask and a_alpha_mask.


create 
	make_from_other (a_other: GAME_PIXEL_FORMAT_READABLE)
			-- Initialization for Current by copying a_others values.

feature -- Access

	bits_per_pixel: INTEGER_32
			-- The number of significant bits in a pixel value

	bytes_per_pixel: INTEGER_32
			-- The number of bytes in a pixel value

	color_palette: detachable GAME_COLOR_PALETTE
			-- The palette of color used in the indexed pixel format
		require
			is_indexed: is_indexed

	generating_type: TYPE [detachable GAME_PIXEL_FORMAT_READABLE]
			-- 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

	has_alpha: BOOLEAN
			-- Current used a color system with alpha channel

	has_error: BOOLEAN
			-- Is the library has generate an error
			-- (from GAME_ERROR_MANAGER)

	is_abgr1555: BOOLEAN
			-- the pixel format of Current is abgr1555

	is_abgr4444: BOOLEAN
			-- the pixel format of Current is abgr4444

	is_abgr8888: BOOLEAN
			-- the pixel format of Current is abgr8888

	is_argb1555: BOOLEAN
			-- the pixel format of Current is argb1555

	is_argb2101010: BOOLEAN
			-- the pixel format of Current is argb2101010

	is_argb4444: BOOLEAN
			-- the pixel format of Current is argb4444

	is_argb8888: BOOLEAN
			-- the pixel format of Current is argb8888

	is_bgr24: BOOLEAN
			-- the pixel format of Current is bgr24

	is_bgr555: BOOLEAN
			-- the pixel format of Current is bgr555

	is_bgr565: BOOLEAN
			-- the pixel format of Current is bgr565

	is_bgr888: BOOLEAN
			-- the pixel format of Current is bgr888

	is_bgra4444: BOOLEAN
			-- the pixel format of Current is bgra4444

	is_bgra5551: BOOLEAN
			-- the pixel format of Current is bgra5551

	is_bgra8888: BOOLEAN
			-- the pixel format of Current is bgra8888

	is_bgrx8888: BOOLEAN
			-- the pixel format of Current is bgrx8888

	is_equal (a_other: like Current): BOOLEAN
			-- Is other attached to an object considered
			-- equal to current object?
		require -- from ANY
			other_not_void: a_other /= Void
		ensure -- from ANY
			symmetric: Result implies a_other ~ Current
			consistent: standard_is_equal (a_other) implies Result

	is_four_cc: BOOLEAN
			-- Current used a color system that represent a FourCC format (Like YUV)

	is_index1lsb: BOOLEAN
			-- the pixel format of Current is index1lsb

	is_index1msb: BOOLEAN
			-- the pixel format of Current is index1msb

	is_index4lsb: BOOLEAN
			-- the pixel format of Current is index4lsb

	is_index4msb: BOOLEAN
			-- the pixel format of Current is index4msb

	is_index8: BOOLEAN
			-- the pixel format of Current is index8

	is_indexed: BOOLEAN
			-- Current used an indexed color system

	is_iyuv: BOOLEAN
			-- the pixel format of Current is iyuv

	is_order_array_abgr: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is ABGR
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_array_argb: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is ARGB
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_array_bgr: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is BGR
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_array_bgra: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is BGRA
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_array_rgb: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is RGB
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_array_rgba: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is RGBA
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_array_unknown: BOOLEAN
			-- The arrayed component order (low byte -> high byte) or Current is not known
		require
			is_arrayed: is_type_array_natural_8 or is_type_array_natural_16 or is_type_array_natural_32

	is_order_bitmap_1234: BOOLEAN
			-- The bitmap pixel order (high bit -> low bit) or Current is 1234
		require
			is_bitmaped: is_type_index_1 or is_type_index_4

	is_order_bitmap_4321: BOOLEAN
			-- The bitmap pixel order (high bit -> low bit) or Current is 4321
		require
			is_bitmaped: is_type_index_1 or is_type_index_4

	is_order_bitmap_unknow: BOOLEAN
			-- The bitmap pixel order (high bit -> low bit) or Current is unknown
		require
			is_bitmaped: is_type_index_1 or is_type_index_4

	is_order_packed_abgr: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is ABGR
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_argb: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is ARGB
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_bgra: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is BGRA
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_bgrx: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is BGRX
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_rgba: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is RGBA
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_rgbx: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is RGBX
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_unknown: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is not known
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_xbgr: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is XBGR
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_order_packed_xrgb: BOOLEAN
			-- The packed component order (high bit -> low bit) or Current is XRGB
		require
			is_packed: is_type_packed_8 or is_type_packed_16 or is_type_packed_32

	is_packed_layout_1010102: BOOLEAN
			-- Current have the channel layouts 1010102
		require
			is_packed: is_type_packed_32

	is_packed_layout_1555: BOOLEAN
			-- Current have the channel layouts 1555
		require
			is_packed: is_type_packed_16

	is_packed_layout_2101010: BOOLEAN
			-- Current have the channel layouts 2101010
		require
			is_packed: is_type_packed_32

	is_packed_layout_332: BOOLEAN
			-- Current have the channel layouts 332
		require
			is_packed: is_type_packed_8

	is_packed_layout_4444: BOOLEAN
			-- Current have the channel layouts 4444
		require
			is_packed: is_type_packed_16

	is_packed_layout_5551: BOOLEAN
			-- Current have the channel layouts 5551
		require
			is_packed: is_type_packed_16

	is_packed_layout_565: BOOLEAN
			-- Current have the channel layouts 565
		require
			is_packed: is_type_packed_16

	is_packed_layout_8888: BOOLEAN
			-- Current have the channel layouts 8888
		require
			is_packed: is_type_packed_32

	is_rgb24: BOOLEAN
			-- the pixel format of Current is rgb24

	is_rgb332: BOOLEAN
			-- the pixel format of Current is rgb332

	is_rgb444: BOOLEAN
			-- the pixel format of Current is rgb444

	is_rgb555: BOOLEAN
			-- the pixel format of Current is rgb555

	is_rgb565: BOOLEAN
			-- the pixel format of Current is rgb565

	is_rgb888: BOOLEAN
			-- the pixel format of Current is rgb888

	is_rgba4444: BOOLEAN
			-- the pixel format of Current is rgba4444

	is_rgba5551: BOOLEAN
			-- the pixel format of Current is rgba5551

	is_rgba8888: BOOLEAN
			-- the pixel format of Current is rgba8888

	is_rgbx8888: BOOLEAN
			-- the pixel format of Current is rgbx8888

	is_type_array_natural_16: BOOLEAN
			-- the pixel format of Current is of type array of 16 bits natural number (ARRAYU16)

	is_type_array_natural_32: BOOLEAN
			-- the pixel format of Current is of type array of 32 bits natural number (ARRAYU16)

	is_type_array_natural_8: BOOLEAN
			-- the pixel format of Current is of type array of 8 bits natural number (ARRAYU8)

	is_type_index_1: BOOLEAN
			-- the pixel format of Current is of type index 1 bit

	is_type_index_4: BOOLEAN
			-- the pixel format of Current is of type index 4 bits

	is_type_index_8: BOOLEAN
			-- the pixel format of Current is of type index 8 bits

	is_type_packed_16: BOOLEAN
			-- the pixel format of Current is of type packed 16 bits

	is_type_packed_32: BOOLEAN
			-- the pixel format of Current is of type packed 32 bits

	is_type_packed_8: BOOLEAN
			-- the pixel format of Current is of type packed 8 bits

	is_type_unknown: BOOLEAN
			-- the pixel format of Current is not of a known type

	is_unknown: BOOLEAN
			-- the pixel format of Current is unknown

	is_unsuported: BOOLEAN
			-- the pixel format of Current is not currently supported

	is_uyvy: BOOLEAN
			-- the pixel format of Current is uyvy

	is_yuy2: BOOLEAN
			-- the pixel format of Current is yuy2

	is_yv12: BOOLEAN
			-- the pixel format of Current is yv12

	is_yvyu: BOOLEAN
			-- the pixel format of Current is yvyu

	last_error: READABLE_STRING_GENERAL
			-- The last error generate by the library
			-- (from GAME_SDL_ANY)

	masks: TUPLE [red_mask: NATURAL_32; green_mask: NATURAL_32; blue_mask: NATURAL_32; alpha_mask: NATURAL_32]
			-- Masks representing the location of the red, green, blue and alpha components of the pixel

	out: STRING_8
			-- A text representation of the pixel format of Current.
		ensure -- from ANY
			out_not_void: Result /= Void
	
feature -- Comparison

	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: GAME_PIXEL_FORMAT_READABLE): 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)

	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: GAME_PIXEL_FORMAT_READABLE): 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

	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 -- Duplication

	copy (other: GAME_PIXEL_FORMAT_READABLE)
			-- Update current object using fields of object attached
			-- to other, so as to yield equal objects.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: Current ~ other

	frozen deep_copy (other: GAME_PIXEL_FORMAT_READABLE)
			-- 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: GAME_PIXEL_FORMAT_READABLE
			-- 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: GAME_PIXEL_FORMAT_READABLE)
			-- 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: GAME_PIXEL_FORMAT_READABLE
			-- 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: GAME_PIXEL_FORMAT_READABLE
			-- 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 GAME_PIXEL_FORMAT_READABLE
			-- 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 -- Implementation

	dispose
			-- Action to be executed just before garbage collection
			-- reclaims an object.
			-- Effect it in descendants to perform specific dispose
			-- actions. Those actions should only take care of freeing
			-- external resources; they should not perform remote calls
			-- on other objects since these may also be dead and reclaimed.
	
feature -- Output

	Io: STD_FILES
			-- Handle to standard file setup
			-- (from ANY)
		ensure -- from ANY
			instance_free: class
			io_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
	
invariant
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class GAME_PIXEL_FORMAT_READABLE

Generated by ISE EiffelStudio