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

30 lines
932 B
Ada
Raw Normal View History

2023-01-24 23:58:22 +01:00
--
-- RGB images with fixed raster not using dynamic storage allocation
--
2023-01-20 17:13:35 +01:00
with Video.Images.Raster.Generic_Fixed;
generic
type Pixel_Type is private;
2023-07-29 21:24:23 +02:00
type Array_Type is array (Integer range <>, Integer range <>) of Pixel_Type;
2023-01-20 17:13:35 +01:00
with function To_Color (Pixel : Pixel_Type) return Color is <>;
with package Raster_Images is new Generic_Raster_Images (
2023-07-29 21:24:23 +02:00
Pixel_Type => Pixel_Type,
Array_Type => Array_Type,
Parent => RGB_Raster_Image);
2023-02-05 22:47:43 +01:00
package Video.Images.Raster.RGB.Generic_Fixed is
2023-02-12 23:15:59 +01:00
type Raster_Image_Base is abstract tagged null record;
2023-02-13 00:18:20 +01:00
function Map_Color (Map : Raster_Image_Base; Pixel : Pixel_Type) return Color
is (To_Color (Pixel)) with Inline;
2023-02-05 22:47:43 +01:00
package Base is new Raster.Generic_Fixed (
2023-02-12 23:15:59 +01:00
Raster_Images => Raster_Images,
Parent => Raster_Image_Base);
2023-01-24 23:58:22 +01:00
-- Generic instantiation
2023-01-20 17:13:35 +01:00
2023-02-05 22:47:43 +01:00
type Image is new Base.Image with null record;
2023-01-24 23:58:22 +01:00
-- Actual Fixed RGB Image
2023-01-20 17:13:35 +01:00
end Video.Images.Raster.RGB.Generic_Fixed;