Subversion Repositories Kolibri OS

Rev

Rev 3056 | Rev 7105 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;================================================================================================;;
  2. ;;//// convert.asm //// (c) dunkaist, 2012 ///////////////////////////////////////////////////////;;
  3. ;;================================================================================================;;
  4. ;;                                                                                                ;;
  5. ;; This file is part of Common development libraries (Libs-Dev).                                  ;;
  6. ;;                                                                                                ;;
  7. ;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
  8. ;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
  9. ;; of the License, or (at your option) any later version.                                         ;;
  10. ;;                                                                                                ;;
  11. ;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  ;;
  12. ;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  ;;
  13. ;; Lesser General Public License for more details.                                                ;;
  14. ;;                                                                                                ;;
  15. ;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev.  ;;
  16. ;; If not, see <http://www.gnu.org/licenses/>.                                                    ;;
  17. ;;                                                                                                ;;
  18. ;;================================================================================================;;
  19.  
  20.  
  21.  
  22. ;;================================================================================================;;
  23. proc img.convert _src, _dst, _dst_type, _flags, _param                                            ;;
  24. ;;------------------------------------------------------------------------------------------------;;
  25. ;? convert _image                                                                                 ;;
  26. ;;------------------------------------------------------------------------------------------------;;
  27. ;> [_src]      = pointer to source image                                                          ;;
  28. ;> [_dst]      = pointer to destination image, or 0 to create a new one                           ;;
  29. ;> [_dst_type] = Image.Type of resulting image                                                    ;;
  30. ;> [_flags]    = see libimg.inc                                                                   ;;
  31. ;> [_param]    = depends on _flags fields, see libimg.inc                                         ;;
  32. ;;------------------------------------------------------------------------------------------------;;
  33. ;< eax = 0 / pointer to converted image                                                           ;;
  34. ;< ecx = error code / undefined                                                                   ;;
  35. ;;================================================================================================;;
  36.         push    ebx esi edi 0 0
  37.         mov     ebx, [_src]
  38.     @@:
  39.         mov     eax, [ebx + Image.Previous]
  40.         test    eax, eax
  41.         jz      .loop
  42.         mov     ebx, eax
  43.         jmp     @b
  44.   .loop:
  45.         stdcall img.convert.layer, ebx, [_dst], [_dst_type], [_flags], [_param]
  46.         test    eax, eax
  47.         jz      .error
  48.         cmp     dword[esp + 4], 0
  49.         jnz     @f
  50.         mov     [esp + 4], eax
  51.     @@:
  52.         mov     ecx, [esp]
  53.         jecxz   @f
  54.         mov     [ecx + Image.Next], eax
  55.     @@:
  56.         push    [ebx + Image.Flags]
  57.         pop     [eax + Image.Flags]
  58.         push    [ebx + Image.Delay]
  59.         pop     [eax + Image.Delay]
  60.         mov     [eax + Image.Previous], ecx
  61.         mov     [esp], eax
  62.         mov     ebx, [ebx + Image.Next]
  63.         test    ebx, ebx
  64.         jnz     .loop
  65.   .quit:
  66.         pop     eax eax edi esi ebx
  67.         ret
  68.   .error:
  69.         pop     eax eax edi esi ebx
  70.         ret
  71. endp
  72.  
  73.  
  74. ;;================================================================================================;;
  75. proc img.convert.layer _src, _dst, _dst_type, _flags, _param                                      ;;
  76. ;;------------------------------------------------------------------------------------------------;;
  77. ;? convert _image layer                                                                           ;;
  78. ;;------------------------------------------------------------------------------------------------;;
  79. ;> [_src]      = pointer to source image                                                          ;;
  80. ;> [_dst]      = pointer to destination image, or 0 to create a new one                           ;;
  81. ;> [_dst_type] = Image.Type of resulting image                                                    ;;
  82. ;> [_flags]    = see libimg.inc                                                                   ;;
  83. ;> [_param]    = depends on _flags fields, see libimg.inc                                         ;;
  84. ;;------------------------------------------------------------------------------------------------;;
  85. ;< eax = 0 / pointer to converted image                                                           ;;
  86. ;< ecx = error code / undefined                                                                   ;;
  87. ;;================================================================================================;;
  88. locals
  89.         width   rd 1
  90.         height  rd 1
  91. endl
  92.         push    ebx esi edi
  93.  
  94.         mov     ebx, [_src]
  95.         mov     eax, 1
  96.         mov     ecx, [_dst_type]
  97.         shl     eax, cl
  98.         mov     ecx, [ebx + Image.Type]
  99.         test    eax, [img.types_table + 4*ecx]
  100.         jnz     @f
  101.         mov     ecx, LIBIMG_ERROR_BIT_DEPTH
  102.         jmp     .error
  103.     @@:
  104.         mov     eax, [_dst]
  105.         test    eax, eax
  106.         jnz     @f
  107.         stdcall img.create, [ebx + Image.Width], [ebx + Image.Height], [_dst_type]
  108.         test    eax, eax
  109.         jz      .error
  110.         mov     [_dst], eax
  111.     @@:
  112.         mov     edi, [eax + Image.Data]
  113.         mov     esi, [ebx + Image.Data]
  114.         mov     eax, [ebx + Image.Type]
  115.         cmp     eax, Image.bpp8i
  116.         je      .bpp8i
  117.         cmp     eax, Image.bpp8g
  118.         je      .bpp8g
  119.         cmp     eax, Image.bpp24
  120.         je      .bpp24
  121.         cmp     eax, Image.bpp32
  122.         je      .bpp32
  123.         cmp     eax, Image.bpp15
  124.         je      .bpp15
  125.         cmp     eax, Image.bpp16
  126.         je      .bpp16
  127.         cmp     eax, Image.bpp1
  128.         je      .bpp1
  129.         cmp     eax, Image.bpp8a
  130.         je      .bpp8a
  131.         mov     ecx, LIBIMG_ERROR_BIT_DEPTH
  132.         jmp     .error
  133.  
  134.   .find_in_table_and_jump:
  135.         mov     ecx, [_dst_type]
  136.     @@:
  137.         mov     eax, [edx]
  138.         add     edx, 8
  139.         cmp     eax, ecx
  140.         jne     @b
  141.         jmp     dword[edx - 4]
  142.  
  143.  
  144.   .bpp8i:
  145.         mov     edx, img.convert.bpp8i.table
  146.         jmp     .find_in_table_and_jump
  147.   .bpp8i_to_bpp24:
  148.         mov     ecx, [ebx + Image.Width]
  149.         imul    ecx, [ebx + Image.Height]
  150.  
  151.         mov     ebx, [ebx + Image.Palette]
  152.         sub     ecx, 1
  153.         jz      .bpp8i.last
  154.     @@:
  155.         movzx   eax, byte[esi]
  156.         add     esi, 1
  157.         mov     eax, [ebx + eax*4]
  158.         mov     [edi], eax
  159.         add     edi, 3
  160.         sub     ecx, 1
  161.         jnz     @b
  162.   .bpp8i.last:
  163.         movzx   eax, byte[esi]
  164.         mov     eax, [ebx + eax*4]
  165.         mov     [edi], ax
  166.         shr     eax, 16
  167.         mov     [edi + 2], al
  168.         mov     eax, [_dst]
  169.         jmp     .quit
  170.  
  171.  
  172.  
  173.   .bpp8g:
  174.         mov     edx, img.convert.bpp8g.table
  175.         jmp     .find_in_table_and_jump
  176.   .bpp8g_to_bpp1:
  177.         mov     eax, [_dst]
  178.         mov     eax, [eax + Image.Palette]
  179.         mov     dword[eax], 0x00000000
  180.         mov     dword[eax + 4], 0x00ffffff
  181.         mov     edx, [ebx + Image.Height]
  182.   .bpp8g_to_bpp1.line:
  183.         mov     ax, 0x0800
  184.         mov     ecx, [ebx + Image.Width]
  185.   .bpp8g_to_bpp1.pixel:
  186.         shl     al, 1
  187.         cmp     byte[esi], 0x7f
  188.         cmc
  189.         adc     eax, 0
  190.         add     esi, 1
  191.         dec     ah
  192.         jnz     @f
  193.         mov     byte[edi], al
  194.         add     edi, 1
  195.         mov     ax, 0x0800
  196.     @@:
  197.         dec     ecx
  198.         jnz     .bpp8g_to_bpp1.pixel
  199.         cmp     ah, 8
  200.         je      @f
  201.         mov     cl, ah
  202.         shl     al, cl
  203.         mov     byte[edi], al
  204.         add     edi, 1
  205.     @@:
  206.         dec     edx
  207.         jnz     .bpp8g_to_bpp1.line
  208.         mov     eax, [_dst]
  209.         jmp     .quit
  210.  
  211.   .bpp8g_to_bpp8g:
  212.         mov     ecx, [ebx + Image.Width]
  213.         imul    ecx, [ebx + Image.Height]
  214.         rep     movsb
  215.         mov     eax, [_dst]
  216.         jmp     .quit
  217.  
  218.   .bpp8g_to_bpp24:
  219.         mov     ecx, [ebx + Image.Width]
  220.         imul    ecx, [ebx + Image.Height]
  221.     @@:
  222.         mov     al, byte[esi]
  223.         mov     byte[edi + 0], al
  224.         mov     byte[edi + 1], al
  225.         mov     byte[edi + 2], al
  226.         add     esi, 1
  227.         add     edi, 3
  228.         sub     ecx, 1
  229.         jnz     @b
  230.         mov     eax, [_dst]
  231.         jmp     .quit
  232.  
  233.   .bpp24:
  234.         mov     edx, img.convert.bpp24.table
  235.         jmp     .find_in_table_and_jump
  236.   .bpp24_to_bpp24:
  237.         mov     ecx, [ebx + Image.Width]
  238.         imul    ecx, [ebx + Image.Height]
  239.         lea     ecx, [ecx*3]
  240.         mov     edx, ecx
  241.         shr     ecx, 2
  242.         rep     movsd
  243.         mov     ecx, edx
  244.         and     ecx, 3
  245.         rep     movsb
  246.         mov     eax, [_dst]
  247.         jmp     .quit
  248.   .bpp24_to_bpp8g:
  249.         mov     ecx, [ebx + Image.Width]
  250.         imul    ecx, [ebx + Image.Height]
  251.     @@:
  252.         movzx   ebx, byte[esi + 0]
  253.         movzx   eax, byte[esi + 1]
  254.         add     ebx, eax
  255.         movzx   eax, byte[esi + 2]
  256.         add     eax, ebx
  257.         mov     ebx, 3
  258.         add     esi, 3
  259.         div     bl
  260.         mov     byte[edi], al
  261.         add     edi, 1
  262.         sub     ecx, 1
  263.         jnz     @b
  264.         mov     eax, [_dst]
  265.         jmp     .quit
  266.   .bpp24_to_bpp32:
  267.         mov     ecx, [ebx + Image.Width]
  268.         imul    ecx, [ebx + Image.Height]
  269.     @@:
  270.         lodsw
  271.         ror     eax, 16
  272.         lodsb
  273.         rol     eax, 16
  274.         stosd
  275.         dec     ecx
  276.         jnz     @b
  277.         mov     eax, [_dst]
  278.         jmp     .quit
  279.  
  280.  
  281.   .bpp32:
  282.         mov     edx, img.convert.bpp32.table
  283.         jmp     .find_in_table_and_jump
  284.   .bpp32_to_bpp24:
  285.         mov     ecx, [ebx + Image.Width]
  286.         imul    ecx, [ebx + Image.Height]
  287.     @@:
  288.         mov     eax, [esi]
  289.         mov     [edi], ax
  290.         shr     eax, 16
  291.         mov     [edi + 2], al
  292.         add     esi, 4
  293.         add     edi, 3
  294.         sub     ecx, 1
  295.         jnz     @b
  296.         mov     eax, [_dst]
  297.         jmp     .quit
  298.  
  299.  
  300.   .bpp15:
  301.         mov     edx, img.convert.bpp15.table
  302.         jmp     .find_in_table_and_jump
  303.   .bpp15_to_bpp24:
  304.         mov     ecx, [ebx + Image.Width]
  305.         imul    ecx, [ebx + Image.Height]
  306.  
  307.   .bpp15.intel: ; copypasted from do_rgb
  308.         push    ebx ebp
  309.         sub     ecx, 4
  310.         jb      .bpp15.tail
  311. align 16
  312.   .bpp15.intel.loop:
  313. repeat 2
  314.         mov     ebx, [esi]
  315.         mov     al, [esi]
  316.         mov     ah, [esi + 1]
  317.         add     esi, 4
  318.         and     al, 0x1F
  319.         and     ah, 0x1F shl 2
  320.         mov     ebp, ebx
  321.         mov     dl, al
  322.         mov     dh, ah
  323.         shr     al, 2
  324.         shr     ah, 4
  325.         shl     dl, 3
  326.         shl     dh, 1
  327.         and     ebp, 0x1F shl 5
  328.         add     al, dl
  329.         add     ah, dh
  330.         shr     ebp, 2
  331.         mov     [edi], al
  332.         mov     [edi + 2], ah
  333.         mov     eax, ebx
  334.         mov     ebx, ebp
  335.         shr     eax, 16
  336.         shr     ebx, 5
  337.         add     ebx, ebp
  338.         mov     ebp, eax
  339.         mov     [edi + 1], bl
  340.         and     eax, (0x1F) or (0x1F shl 10)
  341.         and     ebp, 0x1F shl 5
  342.         lea     edx, [eax + eax]
  343.         shr     al, 2
  344.         mov     ebx, ebp
  345.         shr     ah, 4
  346.         shl     dl, 2
  347.         shr     ebx, 2
  348.         shr     ebp, 7
  349.         add     al, dl
  350.         add     ah, dh
  351.         mov     [edi + 3], al
  352.         add     ebx, ebp
  353.         mov     [edi + 5], ah
  354.         mov     [edi + 4], bl
  355.         add     edi, 6
  356. end repeat
  357.         sub     ecx, 4
  358.         jnb     .bpp15.intel.loop
  359.   .bpp15.tail:
  360.         add     ecx, 4
  361.         jz      .bpp15.done
  362.     @@:
  363.         movzx   eax, word [esi]
  364.         mov     ebx, eax
  365.         add     esi, 2
  366.         and     eax, (0x1F) or (0x1F shl 10)
  367.         and     ebx, 0x1F shl 5
  368.         lea     edx, [eax + eax]
  369.         shr     al, 2
  370.         mov     ebp, ebx
  371.         shr     ebx, 2
  372.         shr     ah, 4
  373.         shl     dl, 2
  374.         shr     ebp, 7
  375.         add     eax, edx
  376.         add     ebx, ebp
  377.         mov     [edi], al
  378.         mov     [edi + 1], bl
  379.         mov     [edi + 2], ah
  380.         add     edi, 3
  381.         sub     ecx, 1
  382.         jnz     @b
  383.   .bpp15.done:
  384.         pop     ebp ebx
  385.         mov     eax, [_dst]
  386.         jmp     .quit
  387.  
  388.   .bpp15.amd:
  389.         push    ebx ebp
  390.         sub     ecx, 4
  391.         jb      .bpp15.tail
  392. align 16
  393.   .bpp15.amd.loop:
  394. repeat 4
  395. if (% mod 2) = 1
  396.         mov     eax, dword[esi]
  397.         mov     ebx, dword[esi]
  398. else
  399.         movzx   eax, word[esi]
  400.         mov     ebx, eax
  401. end if
  402.         add     esi, 2
  403.         and     eax, (0x1F) or (0x1F shl 10)
  404.         and     ebx, 0x1F shl 5
  405.         lea     edx, [eax + eax]
  406.         shr     al, 2
  407.         mov     ebp, ebx
  408.         shr     ebx, 2
  409.         shr     ah, 4
  410.         shl     dl, 2
  411.         shr     ebp, 7
  412.         add     eax, edx
  413.         add     ebx, ebp
  414.         mov     [edi], al
  415.         mov     [edi + 1], bl
  416.         mov     [edi + 2], ah
  417.         add     edi, 3
  418. end repeat
  419.         sub     ecx, 4
  420.         jnb     .bpp15.amd.loop
  421.         jmp     .bpp15.tail
  422.  
  423.  
  424.   .bpp16:
  425.         mov     edx, img.convert.bpp16.table
  426.         jmp     .find_in_table_and_jump
  427.   .bpp16_to_bpp24:
  428.         mov     ecx, [ebx + Image.Width]
  429.         imul    ecx, [ebx + Image.Height]
  430.   .bpp16.intel:
  431.         push    ebx ebp
  432.         sub     ecx, 4
  433.         jb      .bpp16.tail
  434. align 16
  435.   .bpp16.intel.loop:
  436. repeat 2
  437.         mov     ebx, [esi]
  438.         mov     al, [esi]
  439.         mov     ah, [esi + 1]
  440.         add     esi, 4
  441.         and     al, 0x1F
  442.         and     ah, 0x1F shl 3
  443.         mov     ebp, ebx
  444.         mov     dl, al
  445.         mov     dh, ah
  446.         shr     al, 2
  447.         shr     ah, 5
  448.         shl     dl, 3
  449.         and     ebp, 0x3F shl 5
  450.         add     al, dl
  451.         add     ah, dh
  452.         shr     ebp, 3
  453.         mov     [edi], al
  454.         mov     [edi + 2], ah
  455.         mov     eax, ebx
  456.         mov     ebx, ebp
  457.         shr     eax, 16
  458.         shr     ebx, 6
  459.         add     ebx, ebp
  460.         mov     ebp, eax
  461.         mov     [edi + 1], bl
  462.         and     eax, (0x1F) or (0x1F shl 11)
  463.         and     ebp, 0x3F shl 5
  464.         mov     edx, eax
  465.         shr     al, 2
  466.         mov     ebx, ebp
  467.         shr     ah, 5
  468.         shl     dl, 3
  469.         shr     ebx, 3
  470.         shr     ebp, 9
  471.         add     al, dl
  472.         add     ah, dh
  473.         mov     [edi + 3], al
  474.         add     ebx, ebp
  475.         mov     [edi + 5], ah
  476.         mov     [edi + 4], bl
  477.         add     edi, 6
  478. end repeat
  479.         sub     ecx, 4
  480.         jnb     .bpp16.intel.loop
  481.   .bpp16.tail:
  482.         add     ecx, 4
  483.         jz      .bpp16.done
  484.     @@:
  485.         movzx   eax, word[esi]
  486.         mov     ebx, eax
  487.         add     esi, 2
  488.         and     eax, (0x1F) or (0x1F shl 11)
  489.         and     ebx, 0x3F shl 5
  490.         mov     edx, eax
  491.         shr     al, 2
  492.         mov     ebp, ebx
  493.         shr     ebx, 3
  494.         shr     ah, 5
  495.         shl     dl, 3
  496.         shr     ebp, 9
  497.         add     eax, edx
  498.         add     ebx, ebp
  499.         mov     [edi], al
  500.         mov     [edi + 1], bl
  501.         mov     [edi + 2], ah
  502.         add     edi, 3
  503.         sub     ecx, 1
  504.         jnz     @b
  505.   .bpp16.done:
  506.         pop     ebp ebx
  507.         mov     eax, [_dst]
  508.         jmp     .quit
  509.  
  510.   .bpp16.amd:
  511.         push    ebx ebp
  512.         sub     ecx, 4
  513.         jb      .bpp16.tail
  514. align 16
  515.   .bpp16.amd.loop:
  516. repeat 4
  517. if (% mod 2) = 1
  518.         mov     eax, dword[esi]
  519.         mov     ebx, dword[esi]
  520. else
  521.         movzx   eax, word[esi]
  522.         mov     ebx, eax
  523. end if
  524.         add     esi, 2
  525.         and     eax, (0x1F) or (0x1F shl 11)
  526.         and     ebx, 0x3F shl 5
  527.         mov     edx, eax
  528.         shr     al, 2
  529.         mov     ebp, ebx
  530.         shr     ebx, 3
  531.         shr     ah, 5
  532.         shl     dl, 3
  533.         shr     ebp, 9
  534.         add     eax, edx
  535.         add     ebx, ebp
  536.         mov     [edi], al
  537.         mov     [edi + 1], bl
  538.         mov     [edi + 2], ah
  539.         add     edi, 3
  540. end repeat
  541.         sub     ecx, 4
  542.         jnb     .bpp16.amd.loop
  543.         jmp     .bpp16.tail
  544.  
  545.  
  546.   .bpp1:
  547.         mov     edx, img.convert.bpp1.table
  548.         jmp     .find_in_table_and_jump
  549.   .bpp1_to_bpp24:
  550.         push    [ebx + Image.Width]
  551.         pop     [width]
  552.         push    [ebx + Image.Height]
  553.         pop     [height]
  554.         mov     edx, [ebx + Image.Palette]
  555.   .bpp1_to_bpp24.line:
  556.         mov     ebx, [width]
  557.   .bpp1_to_bpp24.byte:
  558.         mov     ah, 8
  559.         mov     al, byte[esi]
  560.         add     esi, 1
  561.   .bpp1_to_bpp24.bit:
  562.         xor     ecx, ecx
  563.         shl     al, 1
  564.         adc     ecx, 0
  565.         mov     ecx, [edx + 4*ecx]
  566.         mov     word[edi], cx
  567.         shr     ecx, 8
  568.         mov     byte[edi + 2], ch
  569.         add     edi, 3
  570.         sub     ebx, 1
  571.         jnz     @f
  572.         sub     [height], 1
  573.         jnz     .bpp1_to_bpp24.line
  574.         jmp     .bpp1.done
  575.     @@:
  576.         sub     ah, 1
  577.         jnz     .bpp1_to_bpp24.bit
  578.         jmp     .bpp1_to_bpp24.byte
  579.   .bpp1.done:
  580.         mov     eax, [_dst]
  581.         jmp     .quit
  582.  
  583.  
  584.   .bpp8a:
  585.         mov     edx, img.convert.bpp8a.table
  586.         jmp     .find_in_table_and_jump
  587.   .bpp8a_to_bpp1:
  588.         mov     eax, [_dst]
  589.         mov     eax, [eax + Image.Palette]
  590.         mov     dword[eax], 0x00000000
  591.         mov     dword[eax + 4], 0x00ffffff
  592.         mov     edx, [ebx + Image.Height]
  593.   .bpp8a_to_bpp1.line:
  594.         mov     ax, 0x0800
  595.         mov     ecx, [ebx + Image.Width]
  596.   .bpp8a_to_bpp1.pixel:
  597.         shl     al, 1
  598.         cmp     byte[esi], 0x7f
  599.         cmc
  600.         adc     eax, 0
  601.         add     esi, 2
  602.         dec     ah
  603.         jnz     @f
  604.         mov     byte[edi], al
  605.         add     edi, 1
  606.         mov     ax, 0x0800
  607.     @@:
  608.         dec     ecx
  609.         jnz     .bpp8a_to_bpp1.pixel
  610.         cmp     ah, 8
  611.         je      @f
  612.         mov     cl, ah
  613.         shl     al, cl
  614.         mov     byte[edi], al
  615.         add     edi, 1
  616.     @@:
  617.         dec     edx
  618.         jnz     .bpp8a_to_bpp1.line
  619.         mov     eax, [_dst]
  620.         jmp     .quit
  621.  
  622.   .bpp8a_to_bpp24:
  623.         mov     ecx, [ebx + Image.Width]
  624.         imul    ecx, [ebx + Image.Height]
  625.     @@:
  626.         mov     al, byte[esi]
  627.         mov     byte[edi + 0], al
  628.         mov     byte[edi + 1], al
  629.         mov     byte[edi + 2], al
  630.         add     esi, 2
  631.         add     edi, 3
  632.         sub     ecx, 1
  633.         jnz     @b
  634.         mov     eax, [_dst]
  635.         jmp     .quit
  636.  
  637.  
  638.   .error:
  639.         xor     eax, eax
  640.   .quit:
  641.         pop     edi esi ebx
  642.         ret
  643. endp
  644.  
  645.  
  646. img.convert.bpp8i.table:
  647.         dd Image.bpp24, img.convert.layer.bpp8i_to_bpp24
  648. img.convert.bpp8g.table:
  649.         dd Image.bpp24, img.convert.layer.bpp8g_to_bpp24
  650.         dd Image.bpp8g, img.convert.layer.bpp8g_to_bpp8g
  651.         dd Image.bpp1,  img.convert.layer.bpp8g_to_bpp1
  652. img.convert.bpp24.table:
  653.         dd Image.bpp24, img.convert.layer.bpp24_to_bpp24
  654.         dd Image.bpp8g, img.convert.layer.bpp24_to_bpp8g
  655.         dd Image.bpp32, img.convert.layer.bpp24_to_bpp32
  656. img.convert.bpp32.table:
  657.         dd Image.bpp24, img.convert.layer.bpp32_to_bpp24
  658. img.convert.bpp15.table:
  659.         dd Image.bpp24, img.convert.layer.bpp15_to_bpp24
  660. img.convert.bpp16.table:
  661.         dd Image.bpp24, img.convert.layer.bpp16_to_bpp24
  662. img.convert.bpp1.table:
  663.         dd Image.bpp24, img.convert.layer.bpp1_to_bpp24
  664. img.convert.bpp8a.table:
  665.         dd Image.bpp24, img.convert.layer.bpp8a_to_bpp24
  666.