mozjpeg_enc.d.ts 839 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // eslint-disable-next-line no-shadow
  2. export const enum MozJpegColorSpace {
  3. GRAYSCALE = 1,
  4. RGB,
  5. YCbCr,
  6. }
  7. export interface EncodeOptions {
  8. quality: number
  9. baseline: boolean
  10. arithmetic: boolean
  11. progressive: boolean
  12. optimize_coding: boolean
  13. smoothing: number
  14. color_space: MozJpegColorSpace
  15. quant_table: number
  16. trellis_multipass: boolean
  17. trellis_opt_zero: boolean
  18. trellis_opt_table: boolean
  19. trellis_loops: number
  20. auto_subsample: boolean
  21. chroma_subsample: number
  22. separate_chroma_quality: boolean
  23. chroma_quality: number
  24. }
  25. export interface MozJPEGModule extends EmscriptenWasm.Module {
  26. encode(
  27. data: BufferSource,
  28. width: number,
  29. height: number,
  30. options: EncodeOptions
  31. ): Uint8Array
  32. }
  33. declare var moduleFactory: EmscriptenWasm.ModuleFactory<MozJPEGModule>
  34. export default moduleFactory