コード例 #1
0
    def convertQImage(image, name, nformat, compress, backcolor):
        compressType, _ = compress

        nbmp = NGL_Bitmap(name, image.width(), image.height(), compressType)

        # convert/compress data
        nbmp.data, nbmp.compressed = NBitmapsConverter.compressData(
            image, compress, nformat, name, backcolor)

        # code len in words and bytes
        nbmp.data_len_in_words = len(nbmp.data)

        if nformat == 'format8' or nbmp.compressed == 'JPG':
            nbmp.data_len_in_bytes = nbmp.data_len_in_words
            nbmp.data_word_size = 8
            nbmp.datatype = 'uint8_t'
        elif nformat == 'format16':
            nbmp.data_len_in_bytes = nbmp.data_len_in_words * 2
            nbmp.data_word_size = 16
            nbmp.datatype = 'uint16_t'

        # generate data code
        nbmp.code = NBitmapCodeGen.bitmap(nbmp)

        return nbmp
コード例 #2
0
ファイル: converter.py プロジェクト: LeftRadio/ngl_utils
    def convertQImage(image, name, nformat, compress, backcolor):
        compressType, _ = compress

        nbmp = NGL_Bitmap(name, image.width(), image.height(), compressType)

        # convert/compress data
        nbmp.data, nbmp.compressed = NBitmapsConverter.compressData(image, compress, nformat, name, backcolor)

        # code len in words and bytes
        nbmp.data_len_in_words = len(nbmp.data)

        if nformat == 'format8' or nbmp.compressed == 'JPG':
            nbmp.data_len_in_bytes = nbmp.data_len_in_words
            nbmp.data_word_size = 8
            nbmp.datatype = 'uint8_t'
        elif nformat == 'format16':
            nbmp.data_len_in_bytes = nbmp.data_len_in_words * 2
            nbmp.data_word_size = 16
            nbmp.datatype = 'uint16_t'

        # generate data code
        nbmp.code = NBitmapCodeGen.bitmap(nbmp)

        return nbmp
コード例 #3
0
    def bitmapsHeaderCode(self, bitmaps, verbose ):
        if verbose:
            inform('generate bitmaps header file...')

        return NBitmapCodeGen.generateBitmapsHeader(bitmaps)
コード例 #4
0
ファイル: ngluic.py プロジェクト: LeftRadio/ngl_utils
    def bitmapsHeaderCode(self, bitmaps, verbose):
        if verbose:
            inform("generate bitmaps header file...")

        return NBitmapCodeGen.generateBitmapsHeader(bitmaps)