pub fn modify(&mut self, data: &[u8]) {
        #[cfg(all(feature = "std", feature = "image-shrinking"))]
        let data = {
            const MAX_IMAGE_SIZE: u32 = 128;

            shrinking::shrink(data, MAX_IMAGE_SIZE)
        };
        cfg_if::cfg_if! {
            // FIXME: Some targets don't have atomics, but we can't test for
            // this properly yet. So there's a feature you explicitly have to
            // opt into to deactivate the usage of atomics. Vice versa would be
            // too dangerous, as `default-features = false` would deactivate
            // atomics then. However there's also `cargo test --all-features`,
            // which is equally dangerous. To detect this, we have an additional
            // `internal-use-all-features` feature that is only ever activated
            // when `--all-features` is passed, so we can ignore the
            // `doesnt-have-atomics` in that case.
            // https://github.com/rust-lang/rust/issues/32976
            if #[cfg(any(
                not(feature = "doesnt-have-atomics"),
                feature = "internal-use-all-features",
            ))] {
                self.id = LAST_IMAGE_ID.fetch_add(1, Ordering::Relaxed);
            } else {
                self.id = LAST_IMAGE_ID.load(Ordering::SeqCst) + 1;
                LAST_IMAGE_ID.store(self.id, Ordering::SeqCst);
            }
        }
        self.data.clear();
        self.data.extend_from_slice(&*data);
    }
/// Modifies an image by replacing its image data with the new image data
/// provided. The image's ID changes to a new unique ID.
Modifies an image by replacing its image data with the new image data
provided. The image's ID changes to a new unique ID.
Modifies an image by replacing its image data with the new image data provided . The image ' s ID changes to a new unique ID .
pub fn modify(&mut self, data: &[u8]) {
        #[cfg(all(feature = "std", feature = "image-shrinking"))]
        let data = {
            const MAX_IMAGE_SIZE: u32 = 128;
            shrinking::shrink(data, MAX_IMAGE_SIZE)
        };
        cfg_if::cfg_if! {
            // FIXME: Some targets don't have atomics, but we can't test for
            // this properly yet. So there's a feature you explicitly have to
            // opt into to deactivate the usage of atomics. Vice versa would be
            // too dangerous, as `default-features = false` would deactivate
            // atomics then. However there's also `cargo test --all-features`,
            // which is equally dangerous. To detect this, we have an additional
            // `internal-use-all-features` feature that is only ever activated
            // when `--all-features` is passed, so we can ignore the
            // `doesnt-have-atomics` in that case.
            // https://github.com/rust-lang/rust/issues/32976
            if #[cfg(any(
                not(feature = "doesnt-have-atomics"),
                feature = "internal-use-all-features",
            ))] {
                self.id = LAST_IMAGE_ID.fetch_add(1, Ordering::Relaxed);
            } else {
                self.id = LAST_IMAGE_ID.load(Ordering::SeqCst) + 1;
                LAST_IMAGE_ID.store(self.id, Ordering::SeqCst);
            }
        }
        self.data.clear();
        self.data.extend_from_slice(&*data);
    }
pub fn modify ( & mut self , data : & [ u8 ] ) { # [ cfg ( all ( feature " " feature " " ) ) ] let data = { const MAX_IMAGE_SIZE : u32 = 128 ; shrinking :: shrink ( data , MAX_IMAGE_SIZE ) } ; cfg_if :: cfg_if ! { // FIXME: Some targets don't have atomics, but we can't test for // this properly yet. So there's a feature you explicitly have to // opt into to deactivate the usage of atomics. Vice versa would be // too dangerous, as `default-features = false` would deactivate // atomics then. However there's also `cargo test --all-features`, // which is equally dangerous. To detect this, we have an additional // `internal-use-all-features` feature that is only ever activated // when `--all-features` is passed, so we can ignore the // `doesnt-have-atomics` in that case. // https://github.com/rust-lang/rust/issues/32976 if [ cfg ( any ( not ( feature " " ) feature " " ) ) ] { self id LAST_IMAGE_ID fetch_add ( 1 Ordering Relaxed ) } else { self id LAST_IMAGE_ID load ( Ordering SeqCst ) 1 LAST_IMAGE_ID store ( self id Ordering SeqCst ) } } self . data . clear ( ) ; self . data . extend_from_slice ( & * data ) ; }
Modifies an image by replacing its image data with the new image data
provided.
Modifies an image by replacing its image data with the new image data provided .
&mut self
data
&[u8]
&mut self
data
&[u8]