AI-NeuralNet-BackProp

 view release on metacpan or  search on metacpan

BackProp.pm  view on Meta::CPAN

1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
# Loads and decompresses a PCX-format 320x200, 8-bit image file and returns
# two arrays, first is a 64000-byte long array, each element contains a palette
# index, and the second array is a 255-byte long array, each element is a hash
# ref with the keys 'red', 'green', and 'blue', each key contains the respective color
# component for that color index in the palette.
sub load_pcx {
        shift if(substr($_[0],0,4) eq 'AI::');
         
        # open the file
        open(FILE, "$_[0]");
        binmode(FILE);
         
        my $tmp;
        my @image;
        my @palette;
        my $data;
         
        # Read header
        read(FILE,$tmp,128);
         
        # load the data and decompress into buffer



( run in 0.226 second using v1.01-cache-2.11-cpan-0f795438458 )