1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "core/fxcodec/jpx/jpxmodule.h" 8 9 #include "third_party/base/ptr_util.h" 10 11 namespace fxcodec { 12 13 // static CreateDecoder(pdfium::span<const uint8_t> src_span,CJPX_Decoder::ColorSpaceOption option)14std::unique_ptr<CJPX_Decoder> JpxModule::CreateDecoder( 15 pdfium::span<const uint8_t> src_span, 16 CJPX_Decoder::ColorSpaceOption option) { 17 auto decoder = pdfium::MakeUnique<CJPX_Decoder>(option); 18 if (!decoder->Init(src_span)) 19 return nullptr; 20 21 return decoder; 22 } 23 24 } // namespace fxcodec 25