Home Index classes Index static functions Index enumerations Index structure types

{Bitmap_direct}


CLASS {Bitmap_direct} , UNTESTED, BYTES :



A class on base of the {Bitmap} to work with pixels as an array of bytes. To do so, an object should be locked (entire or a range of rows) using functions Lock / Lock_rows. A lock result can be accessed as an array of bytes Pixels[*]. Do not forget to unlock the bitmap at the end of an operation(Unlock). This is not too critical but your application can fail to function.


IMPORT : {Bitmap} , {AL4_drawing} .


BASE CLASS {Bitmap} .


 

FUN New_bitmap_direct (
     
INT Pixels_w|idth ,
     
INT Pixels_h|eight ,
     
INT Bpp|_value ) ==> {Bitmap_direct} , NEW


BYTE Pixels|_array[*]


INT Row_width|_bytes , READ


INT Bpp||Bits_per_pixel , READ


 

METHOD Lock|_entire_bitmap ( BOOL Read|_from_source )


INT Locked_Y|_start , READ


INT Locked_h|eight , READ


     

METHOD Lock_rows (
     
INT Y|_top_row ,
     
INT Height_rows ,
     
BOOL Read|_from_source )



OVERRIDE Unlock ( BOOL Write|_back_to_bitmap )



ENUMERATION {rgb|a_items_of_color} :

        'R|ED_COMPONENT_ITEM' ,

        'G|REEN_COMPONENT_ITEM' ,

        'B|LUE_COMPONENT_ITEM' ,

        'A|LPHA_COMPONENT_ITEM' .



FUN Mask_RGB ( {rgb} C|omponent_item ) ==> INT



FUN Shift_RGB|_left ( {rgb} C|omponent_item ) ==> INT


END