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
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
def bitmapsHeaderCode(self, bitmaps, verbose ): if verbose: inform('generate bitmaps header file...') return NBitmapCodeGen.generateBitmapsHeader(bitmaps)
def bitmapsHeaderCode(self, bitmaps, verbose): if verbose: inform("generate bitmaps header file...") return NBitmapCodeGen.generateBitmapsHeader(bitmaps)