Video_library/source/base/video-images-raster-rgb-gen...

30 lines
932 B
Ada

--
-- RGB images with fixed raster not using dynamic storage allocation
--
with Video.Images.Raster.Generic_Fixed;
generic
type Pixel_Type is private;
type Array_Type is array (Integer range <>, Integer range <>) of Pixel_Type;
with function To_Color (Pixel : Pixel_Type) return Color is <>;
with package Raster_Images is new Generic_Raster_Images (
Pixel_Type => Pixel_Type,
Array_Type => Array_Type,
Parent => RGB_Raster_Image);
package Video.Images.Raster.RGB.Generic_Fixed is
type Raster_Image_Base is abstract tagged null record;
function Map_Color (Map : Raster_Image_Base; Pixel : Pixel_Type) return Color
is (To_Color (Pixel)) with Inline;
package Base is new Raster.Generic_Fixed (
Raster_Images => Raster_Images,
Parent => Raster_Image_Base);
-- Generic instantiation
type Image is new Base.Image with null record;
-- Actual Fixed RGB Image
end Video.Images.Raster.RGB.Generic_Fixed;