Subversion Repositories Kolibri OS

Rev

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