Changes between Version 19 and Version 20 of PIL


Ignore:
Timestamp:
10/16/24 14:00:31 (19 months ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PIL

    v19 v20  
    316316== Objects
    317317
    318 The following operations are supported on the `$obj` type:
    319 
     318The function
     319- `$obj $empty_obj($int size);`
     320returns the empty object spanning `size` bytes.  Only values of a sized type can be written to an object.
     321
     322An object is modified through a pointer into the object, for example:
     323{{{
     324typedef $size(4) $int int;
     325typedef $size(8) $real double;
     326$obj o1 = $empty_obj(1000);
     327double* dp = (double*)&o1;  // points to byte 0
     328*dp = 3.14;
     329*(dp+7) = 2.718;
     330int* ip = (int*)&o1;
     331*(ip+2) = 17;
     332}}}
     333The operations above place the double value 3.14 in o1 at positions 0..7, the double value 2.718 at positions 28..35, and the integer value 17 at positions 8..11.
     334
     335If a write to an object overlaps the interval of an existing value, the old value is removed.
     336
     337The values in an object are also read using pointers.
    320338
    321339