本文整理匯總了Golang中C.struct_jpeg_decompress_struct.do_fancy_upsampling方法的典型用法代碼示例。如果您正苦於以下問題:Golang struct_jpeg_decompress_struct.do_fancy_upsampling方法的具體用法?Golang struct_jpeg_decompress_struct.do_fancy_upsampling怎麽用?Golang struct_jpeg_decompress_struct.do_fancy_upsampling使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類C.struct_jpeg_decompress_struct
的用法示例。
在下文中一共展示了struct_jpeg_decompress_struct.do_fancy_upsampling方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: setupDecoderOptions
func setupDecoderOptions(dinfo *C.struct_jpeg_decompress_struct, opt *DecoderOptions) {
tw, th := opt.ScaleTarget.Dx(), opt.ScaleTarget.Dy()
if tw > 0 && th > 0 {
var scaleFactor int
for scaleFactor = 1; scaleFactor <= 8; scaleFactor++ {
if ((scaleFactor*int(dinfo.image_width)+7)/8) >= tw &&
((scaleFactor*int(dinfo.image_height)+7)/8) >= th {
break
}
}
if scaleFactor < 8 {
dinfo.scale_num = C.uint(scaleFactor)
dinfo.scale_denom = 8
}
}
dinfo.dct_method = C.J_DCT_METHOD(opt.DCTMethod)
if opt.DisableFancyUpsampling {
dinfo.do_fancy_upsampling = C.FALSE
} else {
dinfo.do_fancy_upsampling = C.TRUE
}
if opt.DisableBlockSmoothing {
dinfo.do_block_smoothing = C.FALSE
} else {
dinfo.do_block_smoothing = C.TRUE
}
}