當前位置: 首頁>>代碼示例>>Golang>>正文


Golang struct_jpeg_compress_struct.dest方法代碼示例

本文整理匯總了Golang中C.struct_jpeg_compress_struct.dest方法的典型用法代碼示例。如果您正苦於以下問題:Golang struct_jpeg_compress_struct.dest方法的具體用法?Golang struct_jpeg_compress_struct.dest怎麽用?Golang struct_jpeg_compress_struct.dest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在C.struct_jpeg_compress_struct的用法示例。


在下文中一共展示了struct_jpeg_compress_struct.dest方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: makeDestinationManager

func makeDestinationManager(dest io.Writer, cinfo *C.struct_jpeg_compress_struct) (ret destinationManager) {
	ret.magic = magic
	ret.dest = dest
	ret.pub.init_destination = (*[0]byte)(C.destinationInit)
	ret.pub.empty_output_buffer = (*[0]byte)(C.destinationEmpty)
	ret.pub.term_destination = (*[0]byte)(C.destinationTerm)
	ret.pub.free_in_buffer = writeBufferSize
	ret.pub.next_output_byte = (*C.JOCTET)(&ret.buffer[0])
	cinfo.dest = &ret.pub
	return
}
開發者ID:edvakf,項目名稱:go-libjpeg,代碼行數:11,代碼來源:destinationManager.go

示例2: makeDestinationManager

func makeDestinationManager(dest io.Writer, cinfo *C.struct_jpeg_compress_struct) (ret *destinationManager) {
	ret = (*destinationManager)(C.malloc(C.size_t(unsafe.Sizeof(destinationManager{}))))
	if ret == nil {
		panic("Failed to allocate destinationManager")
	}
	ret.magic = magic
	ret.dest = dest
	ret.pub.init_destination = (*[0]byte)(C.destinationInit)
	ret.pub.empty_output_buffer = (*[0]byte)(C.destinationEmpty)
	ret.pub.term_destination = (*[0]byte)(C.destinationTerm)
	ret.pub.free_in_buffer = writeBufferSize
	ret.pub.next_output_byte = (*C.JOCTET)(&ret.buffer[0])
	cinfo.dest = &ret.pub
	return
}
開發者ID:ieee0824,項目名稱:go-thumber,代碼行數:15,代碼來源:jpeg_write.go

示例3: makeDestinationManager

func makeDestinationManager(dest io.Writer, cinfo *C.struct_jpeg_compress_struct) (mgr *destinationManager) {
	mgr = new(destinationManager)
	mgr.dest = dest
	mgr.pub = C.malloc_jpeg_destination_mgr()
	if mgr.pub == nil {
		panic("Failed to allocate C.struct_jpeg_destination_mgr")
	}
	mgr.buffer = C.malloc(writeBufferSize)
	if mgr.buffer == nil {
		panic("Failed to allocate buffer")
	}
	mgr.pub.init_destination = (*[0]byte)(C.destinationInit)
	mgr.pub.empty_output_buffer = (*[0]byte)(C.destinationEmpty)
	mgr.pub.term_destination = (*[0]byte)(C.destinationTerm)
	mgr.pub.free_in_buffer = writeBufferSize
	mgr.pub.next_output_byte = (*C.JOCTET)(mgr.buffer)
	cinfo.dest = mgr.pub

	destinationManagerMapMutex.Lock()
	defer destinationManagerMapMutex.Unlock()
	destinationManagerMap[uintptr(unsafe.Pointer(mgr.pub))] = mgr

	return
}
開發者ID:ieee0824,項目名稱:go-libjpeg,代碼行數:24,代碼來源:destinationManager.go


注:本文中的C.struct_jpeg_compress_struct.dest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。